* Get rid of the concept of `modspec': `getarg' now has `require' for
require specs and `module' for a module name (the latter is what all
previous uses of 'modspec except for ,require really needed); command
descriptions use "<require-spec>" and "<module>", documentation
adjusted as well.
* `module-name?' etc turn to `known-module' and `known-module-name',
with a saner behavior, and tests to keep it sane.
* This cleans up a lot of things. Two specific points: ,switch works
better with toplevel-defined modules (see the corresponding change in
the test suite), and also fixes PR 12148.
* Ensure that ,sh commands return void.
* Add tests for ,r with non-atomic require spec, and for use of $F in
,sh commands.
* Improved the test suite, including uses of `module+' so each file can
be run by itself to perform a subset of the tests.
* Avoid using readline on windows (segfaults, and anyway mostly not
useful)
* Don't try to read init file if it doesn't exist.
* Improve asking questions in the `install!' command.
Set `current-load-relative-directory' to the path of the module file so
paths that it resolves in the description (in `describe-modeul') are not
bogus.
* a single function to set up all environment parameters.
* improve `getarg's treatment of default thunk
* Add an error display handler that doesn't show the context and instead
add a ,bt command to show it.
Not too much, but already tests large parts of sensitive code. Caught a
bug where ,top would use (enter! #f) but enter grabbed the wrong
namespace since it was instantiated in the wrong namespace.
For the record, a way to do this permanently is to add something like
this to your ~/.racketrc:
(eval '(begin
(saved-values-char #\~)
(defcommand eli "stuff" "eli says" ["Make eli say stuff"]
(printf "Eli says: ~a\n" (getarg 'line)))
(defcommand er #f "alias for errortrace" ["Runs errortrace"]
(run-command 'errortrace)))
(module->namespace 'xrepl/xrepl))
But this is too stupid even for a section that has "Hacking" in its title.
There should definitely be an organized way to do this. This will
require several things:
* A decent API for doing these things for user code. (So the above
`eval' turns to a `require' for your file which uses this API.) This
goes beyond just documenting what's in there -- there are issues to
resolve like some argument reading protocol (separating the
declaration of argument types from the command implementation code),
so a new command can call another with arguments that it reads.
* There should also be some ,set command for customization
options (reading and changing) and code to use the preference file for
doing that. I almost started to do this, but currently there are only
three values that this could apply to (`saved-values-char', `-number',
and `wrap-column' (which might be better to dump and use
`pretty-print-columns' instead)).
* Also, it might be nice to have some command to do the same for simple
aliases. (But this might get into shady parsing issues if it's more
than just "I want `foo' to be an alias for an existing `bar' command".)
* Rename `make-command-{reader,evaluator}' -> `make-xrepl-{reader,evaluator}'
* Move the commented-out ,meta block to a better place
* Protect the prompt computation against errors, to avoid infinite
exception output if an exception is raised.
* Add ",switch ?" to query namespaces, and ",switch - <name>" to remove
one. Forbid resetting the default initial `*' namespace.
* Clarify that multiple arguments can be sent to ,stx and fix it to
display the current syntax when there are no arguments.
* Various minor typos and improvements.
* Restore the use-last-arguments-by-default functionality of ,rr
* Re-do argument reading to make it easier to have a default
argument (as in ,enter and ,edit).
requiring itself into the entered namespace.
This makes it useful in some cases where this require leads to a
dependency cycle, eg (enter! racket/list). It's obviously not useful
for use as-is, since you will not have a bound `enter!' to get out of
the namespace (and possibly no `require' to get it) -- but it is useful
for meta-tools like xrepl. This is why the flag is verbose. `xrepl'
now uses this flag.
Also, the check for valid keywords for the form is now done at runtime
rather than in the macro. This doesn't matter in this case, since the
form is intended for interactive use anyway.
Also, separate the two parts of `enter-load/use-compiled' (it was
defined curried, but didn't use it).