Subject: [clisp-list] just getting started

From: larry a price <[email-masked]>
Date: Thu, 31 May 2001 11:27:10 -0700 (PDT)

with both CL and clisp, i've got clisp installed and working with emacs
and i got the ansi spec in info format and have gotten a fair bit along
with it. 

I'm looking for pointers to documentation on the following:

1.numbered prompts 
When i see '#. Break [#]>' what does it mean? I've gotten the idea that
the number in brackets has to do with evaluation frames and increments
whenever there is an error, but i haven't found any docs that give a clear
explanation of what's going on and how i could gather useful information
out of that.

2.example dribble files
Does anyone have some clearly commented clisp sessions posted on the net?
I'd like to see examples of things like error recovery, reediting the
previous form and backing out the results of a well-intentioned but
misdirected expression. 

3.some questions about the language
lambda is implicit except when it's not, what's a good heuristic for
telling the difference?
A lot of forms seem to create other functions, or at least enter
themselves into some sort of global hierarchy where generic functions get
called on them as specific. The behavior of defstruct for example looks to
do a lot of things under the covers. can the interpreter be given a flag
to print out a trace of what's being altered where?

Thanks in Advance,
larry 

ps. is there a good mailing list for CL-newbies, c.l.l. seems a bit noisy
and rowdy for those seeking to learn...and this list is implementation
specific is it not?

Larry Price      |  "We have seen the truth.
[email-masked]  |   And the truth makes no sense." -chesterton
_______________________________________________________________

---

From: Sam Steingold <[email-masked]>
Date: 31 May 2001 14:55:25 -0400

welcome!
I suggest getting (and _reading_!) the Paul Graham's "ANSI CL" book - or
_any_ book on CL - you won't regret the investment!

> * In message <[email-masked]>
> * On the subject of "[clisp-list] just getting started"
> * Sent on Thu, 31 May 2001 11:27:10 -0700 (PDT)
> * Honorable larry a price <[email-masked]> writes:
>
> 1.numbered prompts 
> When i see '#. Break [#]>' what does it mean?

the first number is the number of the prompt (like "\#" in bash and %#
in csh), the second is the depth of the error nesting.

> 2.example dribble files

when CLISP is started it enters the so-called Read/Eval/Print loop: it
 - reads a form
 - evaluates it
 - prints the result

$ clisp -q -norc
 
[1]> (! 10)
3628800
[2]> (! 100)
93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
[3]> 123                               ; number evaluates to themselves
123
[4]> "abc"                             ; ditto for a string
"abc"
[5]> abc                               ; symbol --> value of the variable;
                                       ; no value --> debugger!
*** - EVAL: variable ABC has no value
1. Break [6]> help
 
Commands may be abbreviated as shown in the second column.
COMMAND        ABBR             DESCRIPTION
Help           :h (or ?)        this command list
Error          :e               Print the recent Error Message
Abort          :a               abort to the next recent input loop
Unwind         :uw              abort to the next recent input loop
Mode-1         :m1              inspect all the stack elements
Mode-2         :m2              inspect all the frames
Mode-3         :m3              inspect only lexical frames
Mode-4         :m4              inspect only EVAL and APPLY frames (default)
Mode-5         :m5              inspect only APPLY frames
Where          :w               inspect this frame
Up             :u               go up one frame, inspect it
Top            :t               go to top frame, inspect it
Down           :d               go down one frame, inspect it
Bottom         :b               go to bottom (most recent) frame, inspect it
Backtrace-1    :bt1             list all stack elements
Backtrace-2    :bt2             list all frames
Backtrace-3    :bt3             list all lexical frames
Backtrace-4    :bt4             list all EVAL and APPLY frames
Backtrace-5    :bt5             list all APPLY frames
Backtrace      :bt              list stack in current mode
Backtrace-l    :bl              list stack in current mode.
                                Limit of frames to print will be prompted for.
Frame-limit    :fl              set the frame-limit. This many frames will
                                be printed in a backtrace at most.
Break+         :br+             set breakpoint in EVAL frame
Break-         :br-             disable breakpoint in EVAL frame
Redo           :rd              re-evaluate form in EVAL frame
Return         :rt              leave EVAL frame, prescribing the return values
1. Break [6]> :a                ; get out of the debugger
 
[7]> 'abc                       ; single quote quotes (prevents evaluation)
ABC
[8]> *pathname-encoding*        ; take a value of a variable
#<ENCODING CHARSET:ISO-8859-1 :UNIX>
[9]> '*pathname-encoding*        ; quote a symbol
*PATHNAME-ENCODING*
[10]> help
 
Help (abbreviated :h) = this list
Use the usual editing capabilities.
(quit) or (exit) leaves CLISP.
[11]> (quit)

> 3.some questions about the language

you better ask these on news:comp.lang.lisp

> lambda is implicit except when it's not, what's a good heuristic for

what do you mean?!

> themselves into some sort of global hierarchy where generic functions
> get called on them as specific. The behavior of defstruct for example
> looks to do a lot of things under the covers. can the interpreter be
> given a flag to print out a trace of what's being altered where?

not really.
check out "trace", "step" and "macroexpand" though.

> ps. is there a good mailing list for CL-newbies, c.l.l. seems a bit
> noisy and rowdy for those seeking to learn...

still it is the place to ask questions.

> and this list is implementation specific is it not?

this list is specific to the CLISP implementation of ANSI Common Lisp.

-- 
Sam Steingold (http://www.podval.org/~sds)
Support Israel's right to defend herself! <http://www.i-charity.com/go/israel>
Read what the Arab leaders say to their people on <http://www.memri.org/>
The only thing worse than X Windows: (X Windows) - X

---

From: Paolo Amoroso <[email-masked]>
Date: Fri, 01 Jun 2001 10:50:52 +0200

> and rowdy for those seeking to learn...and this list is implementation

Actually, comp.lang.lisp is an excellent resource for novices.

Paolo
-- 
EncyCMUCLopedia * Extensive collection of CMU Common Lisp documentation
http://cvs2.cons.org:8000/cmucl/doc/EncyCMUCLopedia/