reader-command.scm 505 B

1234567891011121314151617181920
  1. ; Part of Scheme 48 1.9. See file COPYING for notices and license.
  2. ; Authors: Marcus Crestani
  3. ; R6RS Scheme reader with ##
  4. ; ## should evaluate to the last REPL result.
  5. (define-sharp-macro #\#
  6. (lambda (c port)
  7. (read-char port)
  8. ((current-sharp-sharp) port)))
  9. ; Read a single form, allowing ## as a way to refer to last command
  10. ; output.
  11. (define (read-form port)
  12. (with-sharp-sharp (make-node (get-operator 'quote)
  13. (list 'quote (focus-object)))
  14. (lambda () (get-datum port))))