(index ("toplevel-command" 0) ("set-describer!" 450))
(def (sig (procedure "(toplevel-command SYMBOL PROC [HELPSTRING])" (id toplevel-command))) (p "Defines or redefines a toplevel interpreter command which can be invoked by entering " (tt ",SYMBOL") ". " (tt "PROC") " will be invoked when the command is entered and may read any required argument via " (tt "read") " (or " (tt "read-line") "). If the optional argument " (tt "HELPSTRING") " is given, it will be listed by the " (tt ",?") " command."))
(def (sig (procedure "(set-describer! TAG PROC)" (id set-describer!))) (p "Sets a custom description handler that invokes " (tt "PROC") " when the " (tt ",d") " command is invoked with a record-type object that has the type " (tt "TAG") " (a symbol). " (tt "PROC") " is called with two arguments: the object to be described and an output-port. It should write a possibly useful textual description of the object to the passed output-port. For example:") (pre "#;1> (define-record-type point (make-point x y) point?\n       (x point-x)\n       (y point-y))\n#;2> (set-describer! 'point \n       (lambda (pt o)\n         (with-output-to-port o\n           (lambda ()\n             (print \"a point with x=\" (point-x pt) \" and y=\" (point-y pt))))))\n#;3> ,d (make-point 1 2)\na point with x=1 and y=2"))
