Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Learning LISP

Name: Anonymous 2011-03-03 7:56

I've been making my way through SICP, I've reached a point where I feel I have to start experimenting with a Lisp compiler. I'm on a Mac so I downloaded LispWorks, I'm too lazy to figure out how this IDE works.

Can someone point me in the direction of a simple command line compiler/interpreter that will work with the SICP?

Name: Anonymous 2011-03-03 23:45

>>39
Because they optimize for performance. There's no problem with changing the optimization settings and recompiling. That's what I did for SBCL and ClozureCL. (SBCL actually comes with arglist and sourcelocs at least)

Name: Anonymous 2011-03-03 23:52

>>41
But you've to reinvent the wheel and create wrappers around lambda and defun just to save source code.

Name: Anonymous 2011-03-03 23:55

>>42
Only if I really want to do it portably without relying on implementation-specific features, however with almost all major CL implementations support it in some form or another, so I wouldn't have to do anything that drastic.

Name: Anonymous 2011-03-03 23:58

>>41
describe-object provides arglist, but to extract it you need something like:

(defun get-description (obj)
  (with-output-to-string (s)
    (describe-object obj s)
    s))

(defun extract-regex (regex string)
  (car (all-matches-as-strings regex string)))

(defun get-function-lambda-list (fun)
  (read-from-string
   (extract-regex
    "\\(.*"
    (extract-regex
     "The function's arguments are: .*"
     (substitute #\Space #\Newline (get-description fun))))))

Name: Anonymous 2011-03-04 0:11

>>44
describe-object parsing is less portable than

CL-USER> (defun test-function (&rest abc &aux (whatever '(1 2 3))) `(,abc ,whatever))
TEST-FUNCTION
CL-USER> (sb-introspect:function-lambda-list #'test-function)
(&REST ABC &AUX (WHATEVER '(1 2 3)))
CL-USER> (swank-backend:arglist #'test-function)
(&REST ABC &AUX (WHATEVER '(1 2 3)))
CL-USER> (function-lambda-expression #'(lambda (a b c) (+ a b c)))
NIL
T
(LAMBDA (A B C))

If you're using Emacs+SLIME, you may have noticed that you have arglists, source code access for implementation and your own source code and many other nice features, this is because the SLIME backed: SWANK already implements all these debugging features for a wide variety of implementations through a compatibility layer.

There's also the whole wrapper approach if you don't want to rely on implementation, but I don't see why I shouldn't do that when implementations provide a lot of very nice debugging features which are meant just for this sort of thing.

Name: Anonymous 2011-03-04 1:58

>>34
No.
>>35
Yes.
>>37
No.
>>39
Opinions.
>>40
No.
>>45
I love you please post more.

Name: Anonymous 2011-03-04 3:46

TOO LISP; DIDN'T READ

Name: Anonymous 2011-03-04 4:22

>>47
TOO TOO FAG;DIDN'T CARE DIDN'T

Name: Anonymous 2011-03-04 4:23

>>48
I accidentally a too.

Name: Anonymous 2011-03-04 4:26

>>49
I accidentally $NOUN.
Back to /faggot/ with you.

Name: Anonymous 2011-03-04 4:59

>>50
YHB-
mailto:noko
IHBT

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List