Basic new user questions 
Author Message
 Basic new user questions

I'm trying out gcl on Linux.  I have two simple questions:
How do I exit the list interpreter?  How do I save/load a lisp file from
within the interpreter?  Thanks.


Wed, 08 Aug 2001 03:00:00 GMT  
 Basic new user questions

Quote:

> I'm trying out gcl on Linux.

You might also try out Allegro CL and CMUCL. GCL is reputably far from
compliant with the ANSI standard.

Quote:
> I have two simple questions: How do I exit the list interpreter?

This is implementation-dependent, but try (quit) or (exit).

Quote:
> How do I save/load a lisp file from within the interpreter?

To load a file:
(load #p"/path/to/my/file.lisp")

You can write data to files within the interpreter, but in general you
should write actual programs worth saving in an Emacs buffer and send
expressions from the buffer if you want to test stuff interactively.

Christopher



Wed, 08 Aug 2001 03:00:00 GMT  
 Basic new user questions

Quote:
> > How do I save/load a lisp file from within the interpreter?

> To load a file:
> (load #p"/path/to/my/file.lisp")

Actually, while not an incorrect response, cbarry's answer is overly complex.
Just doing:

(load "/path/to/my/file.lisp")

is entirely satisfactory.  Nothing is gained by putting #p in front of
the string except obfuscation.  LOAD already coerces its argument to a
pathname when it gets it, and is happy to accept a string as an argument,
so suplying a pathname instead of a string just clutters the caller's
program, and to no good end.

JMO.
 --Kent



Wed, 08 Aug 2001 03:00:00 GMT  
 Basic new user questions

Quote:

> > > How do I save/load a lisp file from within the interpreter?

> > To load a file:
> > (load #p"/path/to/my/file.lisp")

> Actually, while not an incorrect response, cbarry's answer is overly complex.
> Just doing:

> (load "/path/to/my/file.lisp")

> is entirely satisfactory.  Nothing is gained by putting #p in front of
> the string except obfuscation.  LOAD already coerces its argument to a
> pathname when it gets it, and is happy to accept a string as an argument,
> so suplying a pathname instead of a string just clutters the caller's
> program, and to no good end.

It actually crossed my mind to leave out the #p, and I myself leave it
out when using LOAD in the interpreter (but not in code I intend to
save) because it saves typing, but it's important that newbies learn
the difference between what

* (type-of "home:foo.lisp")
(SIMPLE-BASE-STRING 13)

and

* (type-of #p"home:foo.lisp")
PATHNAME

are. If you can remember a few months back to Erik kinda flaming me
for "since when is a SIMPLE-BASE-STRING a PATHNAME???" Not all of the
pathname functions do the (IMO) intuitive thing with a
SIMPLE-BASE-STRING, and until he starts to really dig into the
HyperSpec he might be safer using a #p.

Christopher



Wed, 08 Aug 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. 2 Basic questions from a new user

2. New to Tcl/Tk and some basic questions

3. New To TCL, Basic Question

4. New User Question

5. Q: new user questions

6. Question on Clarion 5 and Internet (i am new user)

7. New Clarion User. I have a graphics question

8. Questions from new cw2.0 user

9. New forth user question

10. Screen load order? -- New user question

11. New User Question

12. new user questions

 

 
Powered by phpBB® Forum Software