* doc/ref/scheme-using.texi (System Commands): Better documentation for
,option.
* module/system/repl/command.scm (option): Evaluate the RHS when setting
an option. Fixes bug 13076.
Display statistics.
@end deffn
-@deffn {REPL Command} option [key value]
-List/show/set options.
+@deffn {REPL Command} option [name] [exp]
+With no arguments, lists all options. With one argument, shows the
+current value of the @var{name} option. With two arguments, sets the
+@var{name} option to the result of evaluating the Scheme expression
+@var{exp}.
@end deffn
@deffn {REPL Command} quit
(newline))
(define-meta-command (option repl . args)
- "option [KEY VALUE]
+ "option [NAME] [EXP]
List/show/set options."
(pmatch args
(()
(for-each (lambda (spec)
(format #t " ~A~24t~A\n" (car spec) (cadr spec)))
(repl-options repl)))
- ((,key)
- (display (repl-option-ref repl key))
+ ((,name)
+ (display (repl-option-ref repl name))
(newline))
- ((,key ,val)
- (repl-option-set! repl key val))))
+ ((,name ,exp)
+ ;; Would be nice to evaluate in the current language, but the REPL
+ ;; option parser doesn't permit that, currently.
+ (repl-option-set! repl name (eval exp (current-module))))))
(define-meta-command (quit repl)
"quit