Ji Wang <firstname.lastname@example.org> wrote:
| Hi, I am a beginner of Scheme. I can use vi to write a program in Scheme,
| but I cannot read it in... I just cannot type the program each time.
As someone else said, (load "filename") reads/executes a file.
But here's a further convenience for us non-Emacs users:
(let ((current-working-file "tmp.scm"))
(if (not (null? x))
(set! current-working-file (car x)))
(e "foo.scm") edits the file foo.scm, and then loads/executes it.
(e) by itself edits the most recent file explicitly named, or
tmp.scm if no file has ever been explicitly named.
p.s. If you're not using "SCM", here's some code for "ed":
(define (ed fname)
(let ((editor (getenv "EDITOR")))
(if (not editor) (set! editor "/usr/bin/vi")) ; or other default
(system (string-append editor " " fname))))
Rob Warnock, MS-9U/510 email@example.com
Silicon Graphics, Inc. Phone: 415-390-1673
2011 N. Shoreline Blvd. FAX: 415-967-8496
Mountain View, CA 94043 PP-ASEL-IA