Page 1 of 1

Load equalvalent?

Posted: Wed Mar 03, 2004 7:12 pm
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.

Posted: Wed Mar 03, 2004 7:25 pm
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