Hi I'm a really newbie with lisp in general, I have been reading about
this, i have gcl installed and even
I run some examples which I read (I have a copy of chapter 2 of the
book " Ansi common lisp" ), I have a question,
how can generate an 'executable file', I mean, I only have running
I.E.
>(defun foo())
foo
>
but this works only within the gcl, how I can create, i.e. an "hello
world" which execute:
····@host:~$ ./hello
hello world
····@host:~$
and some similar, where I can found more documentation about some
similar or good tuto of lisp in general
many thanks.
On Apr 2, 9:28 am, "someusernamehere" <················@gmail.com>
wrote:
...
> I.E.
>
> >(defun foo())
> foo
>
> but this works only within the gcl, how I can create, i.e. an "hello
> world" which execute:
>
> ····@host:~$ ./hello
> hello world
> ····@host:~$
>
> and some similar, where I can found more documentation about some
> similar or good tuto of lisp in general
>
> many thanks.
Try "info gcl" - for my installation that brings up the documentation,
in which I find that gcl understand #! syntax, so try starting your
file with
#!/usr/local/bin/gcl -f
;; Followed by Lisp code:
and "chmod +x filename" to make it run itself. Lisp systems usually
take a while to get up and running (compared to C executables) but
provide much more reflection and flexibility. I tend to think of a
running Lisp process as an application server (like Tomcat/WebLogic/
WebSphere in the Java world) - something you start once, but can
remotely administer and add code to.
I recommend going with a Lisp that provides ANSI Common Lisp. GCL is
CLtL 1 ( http://savannah.gnu.org/projects/gcl ) and is missing some
things you might enjoy as a learner. SLIME + Emacs, Allegro CL and
Lispworks provide very different GUIs for interacting with the Lisp
"application server".
[c.l.l, please pardon the vastly oversimplified categorization that
follows]
Check out ``Practical Common Lisp'' ( free at http://www.gigamonkeys.com/book/
). There are plenty of other books recommended in past posts on this
site. ``On Lisp'' is a good guide to macros ( also free:
http://www.paulgraham.com/onlisp.html ), PAIP teaches Lisp in AI
examples, SICP delivers the minimalistic beauty of Scheme, etc.
On Apr 2, 1:23 pm, "Harold Lee" <·······@gmail.com> wrote:
> On Apr 2, 9:28 am, "someusernamehere" <················@gmail.com>
> wrote:
> ...
>
>
>
> > I.E.
>
> > >(defun foo())
> > foo
>
> > but this works only within the gcl, how I can create, i.e. an "hello
> > world" which execute:
>
> > ····@host:~$ ./hello
> > hello world
> > ····@host:~$
>
> > and some similar, where I can found more documentation about some
> > similar or good tuto of lisp in general
>
> > many thanks.
>
> Try "info gcl" - for my installation that brings up the documentation,
> in which I find that gcl understand #! syntax, so try starting your
> file with
>
> #!/usr/local/bin/gcl -f
> ;; Followed by Lisp code:
>
> and "chmod +x filename" to make it run itself
I have tried this, but really doesn't work, even I have tried with a
simply "hello world" such as:
#!/usr/bin/gcl -f
;; /usr/bin/gcl is the path of my gcl
(format t "hello world")
I get some such as:
····@host:~$ ./hello.lisp
./hola.lisp: line 2: format: command not found
····@host:~$
> I recommend going with a Lisp that provides ANSI Common Lisp. GCL is
> CLtL 1 (http://savannah.gnu.org/projects/gcl) and is missing some
> things you might enjoy as a learner. SLIME + Emacs, Allegro CL and
> Lispworks provide very different GUIs for interacting with the Lisp
> "application server".
and what about clisp?
I have read about slime in the book Practical common Lisp, but I dont
know how to use this,
for example, I start Emacs and M-x slime RET i get some like:
Searching for program: don't exist the file or directory, lisp
But I have installed slime, indeed when I write the word slime and
press TAB appear
much more completations for slime, what's wrong?, how I can use slime?
>
> [c.l.l, please pardon the vastly oversimplified categorization that
> follows]
> Check out ``Practical Common Lisp'' ( free athttp://www.gigamonkeys.com/book/
I'm reading now these book, is very good for me, thanks for
recommendation.
thanks to all.
"someusernamehere" <················@gmail.com> writes:
> I have read about slime in the book Practical common Lisp, but I dont
> know how to use this,
> for example, I start Emacs and M-x slime RET i get some like:
> Searching for program: don't exist the file or directory, lisp
> But I have installed slime, indeed when I write the word slime and
> press TAB appear
> much more completations for slime, what's wrong?, how I can use slime?
In your .emacs file, put something like this:
(setq inferior-lisp-program "/usr/bin/clisp")
Use the exact location of clisp on your system.
Zach
"someusernamehere" <················@gmail.com> writes:
> I have tried this, but really doesn't work, even I have tried with a
> simply "hello world" such as:
> #!/usr/bin/gcl -f
> ;; /usr/bin/gcl is the path of my gcl
> (format t "hello world")
>
> I get some such as:
> ····@host:~$ ./hello.lisp
> ./hola.lisp: line 2: format: command not found
> ····@host:~$
I wonder if the problem is not that the gcl executable is a shell
script... Can a shell script be an interpreter for a shell script?
It doesn't look like it's possible: the interpreter of the
"interpreter" script is used to interpret the script in the
"interpreter" script language...
A solution could be to use a shell script compiler, or to use use a
little bootstrap program.
If you insist on gcl, here is how you can save an executable:
http://groups.google.de/group/comp.lang.lisp/msg/07b76a57feb67ec0
For scripts I prefer clisp, but any implementation works too.
--
__Pascal Bourguignon__
http://www.informatimago.com
http://pjb.ogamita.org
On Apr 4, 3:51 am, Pascal Bourguignon <····@informatimago.com> wrote:
> "someusernamehere" <················@gmail.com> writes:
> > I have tried this, but really doesn't work, even I have tried with a
> > simply "hello world" such as:
> > #!/usr/bin/gcl -f
> > ;; /usr/bin/gcl is the path of my gcl
> > (format t "hello world")
>
> > I get some such as:
> > ····@host:~$ ./hello.lisp
> > ./hola.lisp: line 2: format: command not found
> > ····@host:~$
>
> I wonder if the problem is not that the gcl executable is a shell
> script... Can a shell script be an interpreter for a shell script?
> It doesn't look like it's possible: the interpreter of the
> "interpreter" script is used to interpret the script in the
> "interpreter" script language...
>
> A solution could be to use a shell script compiler, or to use use a
> little bootstrap program.
>
> If you insist on gcl, here is how you can save an executable:http://groups.google.de/group/comp.lang.lisp/msg/07b76a57feb67ec0
>
> For scripts I prefer clisp, but any implementation works too.
>
> --
> __Pascal Bourguignon__http://www.informatimago.comhttp://pjb.ogamita.org
Definitelly doesn't work:
$ gcl -load hola.lisp
GCL (GNU Common Lisp) 2.6.7 CLtL1 Sep 19 2006 21:46:08
Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl)
Binary License: GPL due to GPL'ed components: (XGCL READLINE BFD
UNEXEC)
Modifications of this banner must retain notice of a compatible
license
Dedicated to the memory of W. Schelter
Use (help) to get some basic information on how to use GCL.
Temporary directory for compiler files set to /tmp/
$
thanks anyway :-(
"someusernamehere" <················@gmail.com> writes:
> On Apr 4, 3:51 am, Pascal Bourguignon <····@informatimago.com> wrote:
>> "someusernamehere" <················@gmail.com> writes:
>> > I have tried this, but really doesn't work, even I have tried with a
>> > simply "hello world" such as:
>> > #!/usr/bin/gcl -f
>> > ;; /usr/bin/gcl is the path of my gcl
>> > (format t "hello world")
>>
>> > I get some such as:
>> > ····@host:~$ ./hello.lisp
>> > ./hola.lisp: line 2: format: command not found
>> > ····@host:~$
>>
>> I wonder if the problem is not that the gcl executable is a shell
>> script... Can a shell script be an interpreter for a shell script?
>> It doesn't look like it's possible: the interpreter of the
>> "interpreter" script is used to interpret the script in the
>> "interpreter" script language...
>>
>> A solution could be to use a shell script compiler, or to use use a
>> little bootstrap program.
>>
>> If you insist on gcl, here is how you can save an executable:http://groups.google.de/group/comp.lang.lisp/msg/07b76a57feb67ec0
>>
>> For scripts I prefer clisp, but any implementation works too.
>>
>> --
>> __Pascal Bourguignon__http://www.informatimago.comhttp://pjb.ogamita.org
>
> Definitelly doesn't work:
> $ gcl -load hola.lisp
> GCL (GNU Common Lisp) 2.6.7 CLtL1 Sep 19 2006 21:46:08
> Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl)
> Binary License: GPL due to GPL'ed components: (XGCL READLINE BFD
> UNEXEC)
> Modifications of this banner must retain notice of a compatible
> license
> Dedicated to the memory of W. Schelter
>
> Use (help) to get some basic information on how to use GCL.
> Temporary directory for compiler files set to /tmp/
> $
>
>
> thanks anyway :-(
Works perfectly for me. I get a hw executable that displays: hello world!
[···@dev225-l wac]$ gcl
GCL (GNU Common Lisp) 2.7.0 CLtL1 Apr 4 2007 10:22:59
Source License: LGPL(gcl,gmp,pargcl), GPL(unexec,bfd,xgcl)
Binary License: GPL due to GPL'ed components: (XGCL READLINE BFD UNEXEC)
Modifications of this banner must retain notice of a compatible license
Dedicated to the memory of W. Schelter
Use (help) to get some basic information on how to use GCL.
Temporary directory for compiler files set to /tmp/
> (defun main ()
(format t "hello world!")
(force-output)
(quit))
MAIN
>(setf system::*top-level-hook* #'main)
#<interpreted-function (LAMBDA-BLOCK MAIN ()
(FORMAT T "hello world!")
(FORCE-OUTPUT)
(QUIT))>
> (system::save-system "hw")
[···@dev225-l wac]$ ./hw
GCL (GNU Common Lisp) 2.7.0 CLtL1 Apr 4 2007 10:22:59
Source License: LGPL(gcl,gmp,pargcl), GPL(unexec,bfd,xgcl)
Binary License: GPL due to GPL'ed components: (XGCL READLINE BFD UNEXEC)
Modifications of this banner must retain notice of a compatible license
Dedicated to the memory of W. Schelter
Use (help) to get some basic information on how to use GCL.
Temporary directory for compiler files set to /tmp/
hello world![···@dev225-l wac]$
--
__Pascal Bourguignon__
http://www.informatimago.com
http://pjb.ogamita.org
Pascal Bourguignon <···@informatimago.com> wrote:
+---------------
| Can a shell script be an interpreter for a shell script?
| It doesn't look like it's possible: the interpreter of the
| "interpreter" script is used to interpret the script in the
| "interpreter" script language...
|
| A solution could be to use a shell script compiler, or to
| use a little bootstrap program.
+---------------
My favorite such trampoline is the "env" program.
As it says in the FreeBSD man page:
"env" is sometimes useful with the ``#!'' construct (see execve(2)).
The only difference between "#!/usr/local/bin/foo" and
"#!/usr/bin/env /usr/local/bin/foo" is that the latter works
even if /usr/local/bin/foo is itself interpreted. Using "env"
this way also allows one to reference "foo" without the path,
as well as set up the environment as desired.
-Rob
-----
Rob Warnock <····@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607
On Wed, 04 Apr 2007 10:51:35 +0200, Pascal Bourguignon
<···@informatimago.com> wrote:
> I wonder if the problem is not that the gcl executable is a shell
> script... Can a shell script be an interpreter for a shell script?
> It doesn't look like it's possible: the interpreter of the
> "interpreter" script is used to interpret the script in the
> "interpreter" script language...
>
eval `script-name`
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
"someusernamehere" <················@gmail.com> writes:
> On Apr 2, 1:23 pm, "Harold Lee" <·······@gmail.com> wrote:
>> I recommend going with a Lisp that provides ANSI Common Lisp. GCL is
>> CLtL 1 (http://savannah.gnu.org/projects/gcl) and is missing some
>> things you might enjoy as a learner. SLIME + Emacs, Allegro CL and
>> Lispworks provide very different GUIs for interacting with the Lisp
>> "application server".
>
> and what about clisp?
>
> I have read about slime in the book Practical common Lisp, but I dont
> know how to use this, for example, I start Emacs and M-x slime RET i
> get some like: Searching for program: don't exist the file or
> directory, lisp But I have installed slime, indeed when I write the
> word slime and press TAB appear much more completations for slime,
> what's wrong?, how I can use slime?
Try tweaking the default value of inferior-lisp-program. In my own
Emacs startup code, I have:
% grep inferior-lisp ~/elisp/keramida-defaults.el
(setq-default inferior-lisp-program "sbcl")
%