Load equalvalent?

For the Compleat Fan
Locked
newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Load equalvalent?

Post by newdep »

Hello Lutz,

Is there an equalvalent of 'load inside newlisp that does 'load the script,
evaluates it, but does NOT run the script ?

So it will load the script into a list (evaluated and sorted) so this list can
then be used (de-listed and executed by i.e. the script that loaded it).

Currently i can only think of using 'read-file for this and then rebuilding it
into a list...but then it still suffers from "\r\n" and is not evaluated into (fn) or
(lambda) functions...

Norman.

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

you could put this in a file:

;; file: myprog.lsp ;;;;;;;;;;;;;;

(set 'myprog '(print "hello world"))

;; eof ;;


Now do a:

(load "myprog.lsp")

myprog => (print "hello world")

(eval myprog) => "hello world" ; return value
hello world ; output from running myprog

Lutz

Locked