1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00
guile/module/system/repl
Andreas Rottmann 8fdd85f834 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>
2010-11-20 23:55:19 +01:00
..
command.scm Allow user-defined meta-commands 2010-11-20 23:55:19 +01:00
common.scm repl read/write using current ports, not captured ports 2010-11-18 14:32:53 +01:00
debug.scm ,frame and related commands handle for-trap? appropriately 2010-10-12 13:24:46 +02:00
describe.scm eval.c closures are now applicable smobs, not tc3s 2009-12-04 19:20:11 +01:00
error-handling.scm call-with-error-handling pass-keys w/ procedural handlers fix 2010-11-12 17:16:35 +01:00
repl.scm repl read/write using current ports, not captured ports 2010-11-18 14:32:53 +01:00
server.scm add (system repl server) 2010-10-10 12:15:34 +02:00