fork download
  1. ; edit files in a repl
  2.  
  3.  
  4. (define-top-level-value '*editor* "ed")
  5. (define-top-level-value '*edfile* #f)
  6.  
  7. (define (ed . args)
  8. (if (pair? args) (set-top-level-value! '*edfile* (car args)))
  9. (if (not (top-level-value '*edfile*)) (error 'ed "file not found"))
  10. (system (string-append (top-level-value '*editor*) " " (top-level-value '*edfile*)))
  11. (load (top-level-value '*edfile*)))
Runtime error #stdin #stdout #stderr 0.02s 44560KB
stdin
Standard input is empty
stdout

Standard output is empty

stderr
Backtrace:
In ice-9/boot-9.scm:
 160: 11 [catch #t #<catch-closure 2b751d555260> ...]
In unknown file:
   ?: 10 [apply-smob/1 #<catch-closure 2b751d555260>]
In ice-9/boot-9.scm:
  66: 9 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 8 [eval # #]
In ice-9/boot-9.scm:
2404: 7 [save-module-excursion #<procedure 2b751d577940 at ice-9/boot-9.scm:4051:3 ()>]
4058: 6 [#<procedure 2b751d577940 at ice-9/boot-9.scm:4051:3 ()>]
1727: 5 [%start-stack load-stack ...]
1732: 4 [#<procedure 2b751d58cc60 ()>]
In unknown file:
   ?: 3 [primitive-load "/home/RYVRXe/prog.scm"]
In ice-9/eval.scm:
 386: 2 [eval #<memoized (define-top-level-value (quote *editor*) (quote "ed"))> ()]
 393: 1 [eval #<memoized define-top-level-value> ()]
In unknown file:
   ?: 0 [memoize-variable-access! # #]

ERROR: In procedure memoize-variable-access!:
ERROR: Unbound variable: define-top-level-value