Hello:
I am trying out "Lisp in a box", the CLISP version.
I have some LISP code I'd like to have available every time I launch -
the equivalent of typing in (load "mycode.lisp") at the prompt after
emacs/slime finishes launching.
With Corman lisp you can just drop the LISP file in the Modules
directory (I have the necessary (provide) set-up in the file), but I
don't see how to do the equivalent with CLISP.
Thanks for any info,
Tom
··········@medialab.com writes:
> I am trying out "Lisp in a box", the CLISP version.
>
> I have some LISP code I'd like to have available every time I launch -
> the equivalent of typing in (load "mycode.lisp") at the prompt after
> emacs/slime finishes launching.
Still, you have the right to look out of the box.
See on http://cons.clisp.org the Implementation Notes of clisp.
You can put that code in ~/.clisprc.lisp
--
__Pascal Bourguignon__ http://www.informatimago.com/
"You can tell the Lisp programmers. They have pockets full of punch
cards with close parentheses on them." --> http://tinyurl.com/8ubpf
Thanks for the reply.
I'm sorry, I'm a newb at this, so i know this is a dumb question.
Is .clisprc.lisp supposed to already exist in my home directory? (This
is under Windows.)
I tried adding ".clisprc.lisp" in my home directory with a test
function in it but it didn't seem to be loaded by CLISP.
From: Peter Seibel
Subject: Re: CLISP in a box: adding functions at load time
Date:
Message-ID: <m2irpy1mjo.fsf@gigamonkeys.com>
··········@medialab.com writes:
> Thanks for the reply.
>
> I'm sorry, I'm a newb at this, so i know this is a dumb question.
>
> Is .clisprc.lisp supposed to already exist in my home directory? (This
> is under Windows.)
>
> I tried adding ".clisprc.lisp" in my home directory with a test
> function in it but it didn't seem to be loaded by CLISP.
If you're running my Lispbox distribution (as opposed to the old Lisp
in a Box) it's possible that I've set $HOME to something other than
the normal default. That's because the point of Lispbox is to get
folks up and running in a sane environment as quickly as possible and
I didn't want remnants of failed attempts at installing Emacs or a
Lisp to interfere with it. Lispbox is not necessarily meant as a tool
for mature Lisp developers. If you've gotten to the point where you
want to customize your environment you can look inside the box and see
what it's doing or simply set up your own Emacs/SLIME/Lisp
environment.
-Peter
--
Peter Seibel * ·····@gigamonkeys.com
Gigamonkeys Consulting * http://www.gigamonkeys.com/
Practical Common Lisp * http://www.gigamonkeys.com/book/
··········@medialab.com writes:
> Thanks for the reply.
>
> I'm sorry, I'm a newb at this, so i know this is a dumb question.
>
> Is .clisprc.lisp supposed to already exist in my home directory? (This
> is under Windows.)
No.
> I tried adding ".clisprc.lisp" in my home directory with a test
> function in it but it didn't seem to be loaded by CLISP.
clisp
(with-open-file (init (merge-pathnames
(make-pathname :name ".clisprc" :type "lisp")
(user-homedir-pathname))
:direction :output :if-does-not-exist :create
:if-exists :supersede)
(print (truename init))
(print '(format t "~2% Hello Master! ~2% ~
Welcome to CLISP, have a nice day!~2%") init))
(quit)
clisp
What do you get?
--
__Pascal Bourguignon__ http://www.informatimago.com/
Cats meow out of angst
"Thumbs! If only we had thumbs!
We could break so much!"
Well, I pasted it into th listener and executed it. Next time I ran
clisp it gave an error message that indicated to me that my "~/"
diectory was "c:\", not my home user directory, so I added my code to
.cliprc.lisp at my HD root and now it works!
Thank you!
··········@medialab.com writes:
> Well, I pasted it into th listener and executed it. Next time I ran
> clisp it gave an error message that indicated to me that my "~/"
> diectory was "c:\", not my home user directory, so I added my code to
> .cliprc.lisp at my HD root and now it works!
Yes. If you want another home directory you'll have to set the
environment variable HOME, I guess.
--
__Pascal Bourguignon__ http://www.informatimago.com/
In a World without Walls and Fences,
who needs Windows and Gates?