From: Alexis
Subject: Lisp newbie question
Date: 
Message-ID: <55b8b8c2.0211120710.4a565088@posting.google.com>
Hello, I am fairly new to lisp and I am learning to use it more or
less successfully. The question(s) I do have are:

I run clisp from the console (on linux) and there are somethings that
I don't understand using it: When defining functions with defun and
then leaving clisp, they're gone. Is there a way to store these
functions in a file that I load when starting up clisp? I saved a
function in a file called myfun.lsp and tried to start clisp with it
like this: "$>clisp ./myfile.lsp. It wouldn't work. What do I need to
do to access these written-down funtion(s) while running clisp? Is
this common or useful at all? Are there better ways?

Thank you so much in advance for your time and thought. 

Alexis

From: Barry Margolin
Subject: Re: Lisp newbie question
Date: 
Message-ID: <dh9A9.6$Wf1.687@paloalto-snr1.gtei.net>
In article <····························@posting.google.com>,
Alexis <······@veritaspuris.com> wrote:
>Hello, I am fairly new to lisp and I am learning to use it more or
>less successfully. The question(s) I do have are:
>
>I run clisp from the console (on linux) and there are somethings that
>I don't understand using it: When defining functions with defun and
>then leaving clisp, they're gone. Is there a way to store these
>functions in a file that I load when starting up clisp? I saved a
>function in a file called myfun.lsp and tried to start clisp with it
>like this: "$>clisp ./myfile.lsp. It wouldn't work. What do I need to
>do to access these written-down funtion(s) while running clisp? Is
>this common or useful at all? Are there better ways?

(load "myfile.lsp")

-- 
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.
From: Alexis
Subject: Re: Lisp newbie question
Date: 
Message-ID: <55b8b8c2.0211121109.7eda79eb@posting.google.com>
Thank very much, I even have received 2 Mails helping me :)

All the best.
From: Sam Steingold
Subject: Re: Lisp newbie question
Date: 
Message-ID: <m34ramsl33.fsf@loiso.podval.org>
> * In message <····························@posting.google.com>
> * On the subject of "Lisp newbie question"
> * Sent on 12 Nov 2002 07:10:24 -0800
> * Honorable ······@veritaspuris.com (Alexis) writes:
>
> When defining functions with defun and then leaving clisp, they're
> gone.  Is there a way to store these functions in a file that I load
> when starting up clisp? I saved a function in a file called myfun.lsp
> and tried to start clisp with it like this: "$>clisp ./myfile.lsp. It
> wouldn't work. What do I need to do to access these written-down
> funtion(s) while running clisp? Is this common or useful at all?

do
$ clisp -i myfile.lisp
(see <http://clisp.cons.org/clisp.html#opt-init>) or put

(load "myfile")

into you ~/.clisprc and clisp will load it automatically.
(see <http://clisp.cons.org/clisp.html#opt-norc>)

> Are there better ways?

Yes, if your files are large and many, you should save the memory image.
(see <http://clisp.cons.org/impnotes/p-indep.html#image>).

It might be a good idea to compile the files, see
<http://www.lisp.org/HyperSpec/Body/fun_compile-file.html>
<http://clisp.cons.org/clisp.html#opt-compile>
<http://clisp.cons.org/impnotes/system.html>

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat8 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
History doesn't repeat itself, but historians do repeat each other.
From: Thomas A. Russ
Subject: Re: Lisp newbie question
Date: 
Message-ID: <ymiwunfagsj.fsf@sevak.isi.edu>
······@veritaspuris.com (Alexis) writes:

> 
> Hello, I am fairly new to lisp and I am learning to use it more or
> less successfully. The question(s) I do have are:
> 
> I run clisp from the console (on linux) and there are somethings that
> I don't understand using it: When defining functions with defun and
> then leaving clisp, they're gone. Is there a way to store these
> functions in a file that I load when starting up clisp? I saved a
> function in a file called myfun.lsp and tried to start clisp with it
> like this: "$>clisp ./myfile.lsp. It wouldn't work. What do I need to
> do to access these written-down funtion(s) while running clisp? 

(load "./myfile.lsp")

> Is this common or useful at all? Are there better ways?

Well, at some point you might want to compile the functions.
Also, most people find it easier to develop lisp code using a suitable
editor, for example Emacs.  I don't know if there is a ilisp package
available for Emacs that will let you execute code directly from
the emacs buffer.  If there is something like that, it will make your
programming life much simpler.

> Thank you so much in advance for your time and thought. 
> 
> Alexis

-- 
Thomas A. Russ,  USC/Information Sciences Institute          ···@isi.edu