From: Juan Pardillos
Subject: Executing a Lisp file
Date: 
Message-ID: <6278687.0206090939.4618fbdf@posting.google.com>
Hi,

I would like to know how can I execute a Lisp file (all sentences in
the file as if they were typed in the Lisp interpreter).

At present, I call (load "myFile.lsp"), but this only loads function
definitions, but when I put forms in "myFile.lsp" they are not
evaluated.

Thanks in advance

From: Karsten Poeck
Subject: Re: Executing a Lisp file
Date: 
Message-ID: <ae0d1v$7ej$1@news.wanadoo.es>
Huh?
With c:\test.lisp defined as
;;;; beginnung of file
(defvar *toplevel-form*)

(defun test (n)
  (if (<= n 1)
      1
    (* n (test (1- n)))))


(setq *toplevel-form* (test 100))
;;;;; End of file

(load "c:/test.lisp" :verbose t :print t)
results in the expected
; Loading c:\test.lisp
*TOPLEVEL-FORM*
TEST
9332621544394415268169923885626670049071596826438162146859296389521759999322
9915608941463976156518286253697920827223758251185210916864000000000000000000
000000
T
and even the global is bound
CL-USER(2): *TOPLEVEL-FORM*
9332621544394415268169923885626670049071596826438162146859296389521759999322
9915608941463976156518286253697920827223758251185210916864000000000000000000
000000
CL-USER(3):

Un saludo
Karsten

"Juan Pardillos" <·······@eresmas.com> wrote in message
································@posting.google.com...
> Hi,
>
> I would like to know how can I execute a Lisp file (all sentences in
> the file as if they were typed in the Lisp interpreter).
>
> At present, I call (load "myFile.lsp"), but this only loads function
> definitions, but when I put forms in "myFile.lsp" they are not
> evaluated.
>
> Thanks in advance
From: Coby Beck
Subject: Re: Executing a Lisp file
Date: 
Message-ID: <SITM8.119062$Ka.8451479@news2.calgary.shaw.ca>
Juan Pardillos <·······@eresmas.com> wrote in message
································@posting.google.com...
> Hi,
>
> I would like to know how can I execute a Lisp file (all sentences in
> the file as if they were typed in the Lisp interpreter).
>
> At present, I call (load "myFile.lsp"), but this only loads function
> definitions, but when I put forms in "myFile.lsp" they are not
> evaluated.

Why don't you show us the line(s) that don't do what you expect and tell us
what is your expectation?  That is to say, it should evaluate all toplevel
forms in the file.

--
Coby Beck
(remove #\Space "coby 101 @ bigpond . com")
From: Barry Margolin
Subject: Re: Executing a Lisp file
Date: 
Message-ID: <i06N8.10$rS5.84@paloalto-snr1.gtei.net>
In article <···························@posting.google.com>,
Juan Pardillos <·······@eresmas.com> wrote:
>Hi,
>
>I would like to know how can I execute a Lisp file (all sentences in
>the file as if they were typed in the Lisp interpreter).
>
>At present, I call (load "myFile.lsp"), but this only loads function
>definitions, but when I put forms in "myFile.lsp" they are not
>evaluated.

If that's really true, the Lisp interpreter is severely broken.

The LOAD function should execute all the forms in the file.  However,
unlike the interactive READ-EVAL-PRINT loop, it doesn't print their
results; it's just a READ-EVAL loop.  So if you need things to be printed
while loading the file, you should put explicit PRINT or FORMAT statements
in it.

-- 
Barry Margolin, ······@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.