Hi all,
I am in a programming languages class, and Lisp has me freaked out! I
have a basic programming assignment where we make some functions and
then make a function EVALUATE that takes in a combination of those
functions as a list from a .data text file, and evaluates it.
Here's what is tearing me up: how do I program here? I am used to
using a text editor (pico) in our Unix system, and making a .c or .cpp
or .f or .p file, and then compiling it, and then running it, perhaps
with file or command line i/o. I can't figure out how to get this
program going!
I have my functions written, but I can't even test them out because I
don't know even know it all is supposed to be run.
In gcl, our Lisp environment, you enter it by typing "gcl", and then
exit it by (bye). You can type Lisp expressions at the prompt while
gcl. I am totally confused.
Can anyone help me get oriented, or is there a link? Our professor is
not that available to a working student, even by email.
Thanks,
Dan Neill
From: KenNULLSPAMTilton
Subject: Re: lisp newbie - how to use lisp with gcl?
Date:
Message-ID: <N5POf.69$kE6.59@fe12.lga>
·······@iwebworks.com wrote:
> Hi all,
> I am in a programming languages class, and Lisp has me freaked out! I
> have a basic programming assignment where we make some functions and
> then make a function EVALUATE that takes in a combination of those
> functions as a list from a .data text file, and evaluates it.
>
> Here's what is tearing me up: how do I program here? I am used to
> using a text editor (pico) in our Unix system, and making a .c or .cpp
> or .f or .p file, and then compiling it, and then running it, perhaps
> with file or command line i/o. I can't figure out how to get this
> program going!
>
> I have my functions written, but I can't even test them out because I
> don't know even know it all is supposed to be run.
>
> In gcl, our Lisp environment, you enter it by typing "gcl", and then
> exit it by (bye). You can type Lisp expressions at the prompt while
> gcl. I am totally confused.
>
> Can anyone help me get oriented, or is there a link? Our professor is
> not that available to a working student, even by email.
The ugly solution is to use the editor to write the code and save it in
my-code.lisp, then at the gcl prompt enter (load "my-code.lisp"), or
more likely (load "dan/lispstuff/my-code.lisp").
That is ugly because any mistake means: re-edit, save, re-load. You
might want to download free trial versions of Lispworks for your OS, or
AllegroCL for win32 or Linux. That gives you an integrated development
environment with Lisp and editor and more all in one.
btw, editing Lisp without a Lisp-friendly editor is hell on wheels. At
least get Emacs as your editor. And there are bundled Emacs/Slime/Lisp
packages that you can install to give you a poor-man's IDE.
The easiest thing is the free trials I mentioned.
ken
in message <···············@fe12.lga>, KenNULLSPAMTilton
(············@optonline.net') wrote:
> ·······@iwebworks.com wrote:
>> Hi all,
>> I am in a programming languages class, and Lisp has me freaked out! I
>> have a basic programming assignment where we make some functions and
>> then make a function EVALUATE that takes in a combination of those
>> functions as a list from a .data text file, and evaluates it.
>>
>> Here's what is tearing me up: how do I program here? I am used to
>> using a text editor (pico) in our Unix system, and making a .c or .cpp
>> or .f or .p file, and then compiling it, and then running it, perhaps
>> with file or command line i/o. I can't figure out how to get this
>> program going!
>>
>> I have my functions written, but I can't even test them out because I
>> don't know even know it all is supposed to be run.
>>
>> In gcl, our Lisp environment, you enter it by typing "gcl", and then
>> exit it by (bye). You can type Lisp expressions at the prompt while
>> gcl. I am totally confused.
>>
>> Can anyone help me get oriented, or is there a link? Our professor is
>> not that available to a working student, even by email.
>
> The ugly solution is to use the editor to write the code and save it in
> my-code.lisp, then at the gcl prompt enter (load "my-code.lisp"), or
> more likely (load "dan/lispstuff/my-code.lisp").
>
> That is ugly because any mistake means: re-edit, save, re-load. You
> might want to download free trial versions of Lispworks for your OS, or
> AllegroCL for win32 or Linux. That gives you an integrated development
> environment with Lisp and editor and more all in one.
Another useful tool - better in my experience than ilisp or slime - is
Jabberwocky <URL:http://jabberwocky.sourceforge.net/>.
--
·····@jasmine.org.uk (Simon Brooke) http://www.jasmine.org.uk/~simon/
Just as defying the law of gravity through building aircraft requires
careful design and a lot of effort, so too does defying laws of
economics. It seems to be a deeply ingrained aspect of humanity to
forever strive to improve things, so unquestioning acceptance of a
free market system seems to me to be unnatural. ;; Charles Bryant
·······@iwebworks.com wrote:
>
---snip---
>
> In gcl, our Lisp environment, you enter it by typing "gcl", and then
> exit it by (bye).
>
I use clisp, and it works the way you expect. Say, clisp your-test.lisp
just runs.
Indeed, it escapses me why neither gcl, nor sbcl (cmucl as well?), do
not have a standard command line process-one-file thing. Sbcl's site
mentioned some addition to it, so that it does the thing. I have never
tried it, and I do not know if you can put it onto gcl without
adustments.
Mikalai <········@yahoo.com> wrote:
+---------------
| Indeed, it escapses me why neither gcl, nor sbcl (cmucl as well?),
| do not have a standard command line process-one-file thing.
+---------------
I'm not sure what you mean w.r.t. CMUCL, since you can always
use the "-load" switch:
$ cat foo.lisp
(format t "hello world!~%")
$ cmucl -load foo.lisp -eval '(quit)'
; Loading #p"/u/rpw3/.cmucl-init".
; Loading #p"/u/rpw3/foo.lisp".
hello world!
$
-Rob
-----
Rob Warnock <····@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607
Check this manual:
http://www.sunsite.ualberta.ca/Documentation/Gnu/gcl-2.3.6/man/gcl.1.html
It seems I was wrong about gcl. I haven't tried the options, though.
The interface is not as usual as clisp or python.