summaryrefslogtreecommitdiff
path: root/doc/ref/scheme-using.texi
diff options
context:
space:
mode:
authorAndreas Rottmann <a.rottmann@gmx.at>2010-11-20 23:14:05 +0100
committerLudovic Courtès <ludo@gnu.org>2010-11-20 23:55:19 +0100
commit8fdd85f834aa1e0ed76542cdc8ce63d323dc6c1e (patch)
tree917c67ffbd226e8504531a524509927d3c267af1 /doc/ref/scheme-using.texi
parent6349a556298edc3e11b88bb45a59c545823a0755 (diff)
downloadguile-8fdd85f834aa1e0ed76542cdc8ce63d323dc6c1e.tar.gz
Allow user-defined meta-commands
Besides allowing user-defined meta-commands, this change also refactors the meta-command machinery to split reading a command's arguments from the procedure actually implementing it, and hence allows nesting meta-commands. As an example of such a command, ",in" is added as a new meta-command. * module/system/repl/command.scm: Export `define-meta-command'. (*command-module*): Replaced by the hash table `*command-infos*'. (command-info, make-command-info, command-info-procedure) (command-info-arguments-reader): New procedures, encapsulating the information about a meta-command. (command-procedure): Adapted to use the `command-info' lookup procedure. (read-command-arguments): New auxiliary procedure invoking a command's argument reader procedure. (meta-command): Adapted to the split of reading arguments and executing a command. (add-meta-command!): New auxiliary procedure, registers a meta command's procedure and argument reader into `*command-infos* and `*command-table*. (define-meta-command): Extended to allow specification of the command's category; split the argument reader and actual command procedure. (guile:apropos, guile:load, guile:compile-file, guile:gc): Remove these aliases, they are unnecessary as we now use a hash table instead of the module to store the commands. (in): New meta-command, which evaluates an expression, or alternatively executes another meta-command, in the context of a specific module. * doc/ref/scheme-using.texi (Module Commands): Document the `in' meta-command. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'doc/ref/scheme-using.texi')
-rw-r--r--doc/ref/scheme-using.texi7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/ref/scheme-using.texi b/doc/ref/scheme-using.texi
index 223295cc6..7700cbe9b 100644
--- a/doc/ref/scheme-using.texi
+++ b/doc/ref/scheme-using.texi
@@ -227,6 +227,13 @@ Load a file in the current module.
List current bindings.
@end deffn
+@deffn {REPL Command} in module expression
+@deffnx {REPL Command} in module command [args ...]
+Evaluate an expression, or alternatively, execute another meta-command
+in the context of a module. For example, @samp{,in (foo bar) ,binding}
+will show the bindings in the module @code{(foo bar)}.
+@end deffn
+
@node Language Commands
@subsubsection Language Commands