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

Pages: 1-4041-

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 7:59

LispWorks if for Common Lisp.
You want Racket or MIT Scheme for SICP.
I would heavily recommend learning CL too, but SICP is Scheme, not CL.

Name: Anonymous 2011-03-03 8:04

Like >>2 said, LispWorks is for CL, and you want a Scheme.
I suggest MIT/GNU Scheme while reading SICP, then Racket or Chicken for actual coding. Racket is generally more noob-friendly.

Name: Anonymous 2011-03-03 8:11

>>3
Why Racket isn't suitable for going through SICP?

Name: Anonymous 2011-03-03 8:27

>>4
It is, but doing it just an R5RS Scheme is better, IMHO.
If you want to do it with Racket, http://planet.racket-lang.org/display.ss?package=sicp.plt&owner=neil

Name: Anonymous 2011-03-03 8:29

>>4
It is, you're just reading far too much into >>3's statements.

Name: Anonymous 2011-03-03 9:13

>>2
You want Racket or MIT Scheme
Macro in LISP.

(defmacro aif (cond then else)
  `(let ((it ,cond))
     (if it ,then ,else)))


"Macro" in Scheme/Racket.

#lang racket
(require racket/stxparam)
 
(define-syntax-parameter it (lambda (stx) (raise-syntax-error 'anaphora "missed context" stx)))
 
(define-syntax-rule (aif cond then else)
  (let ([temp cond])
    (syntax-parameterize ([it (make-rename-transformer #`temp)])
                         (if temp then else))))

Name: Anonymous 2011-03-03 9:14

>>7
This seems off-topic. I prefer CL, yet there's no harm in learning Scheme first.

Name: Anonymous 2011-03-03 9:15

>>3
Racket or Chicken for actual coding
Nobody does "actual coding" in Scheme. It's a useless academic language, like Haskell. Real lispers code in CL, Clojure and Arc, never scheme.

Name: Anonymous 2011-03-03 9:16

>>7,9
Please stop trolling!

Name: Anonymous 2011-03-03 9:17

>>8
AFAIK, learning Scheme leads to learning Haskell, which leads to loving Micro$oft, where Haskell and other static-typing retards work.

Name: Anonymous 2011-03-03 9:17

>>10
I'm not trolling.

Name: Anonymous 2011-03-03 9:20

Real lispers code ... in Arc
Maximum Trolling

Name: Anonymous 2011-03-03 9:20

>>11
I started with Scheme and I'm learning CL. ``Micro$oft'' hate is pointless. Don't act like a retard, just because you're a Lisper it doesn't mean you're smart. Stop trolling.
>>12
No, you are.

Name: Anonymous 2011-03-03 9:21

>>11
It depends if you're the type to love purity above everything else. I learned Common Lisp after Scheme (and reading SICP).

Essentially if you want more freedom you'll go with CL, if you want less freedom in exchange for more (type) safety, you'll go for ML/Haskell/etc. I actually knew ML before reading my SICP, although while it was much better than the other high-level languages that I knew, I never quite grown to like it as much as Lisp - not enough freedom.

Name: Anonymous 2011-03-03 9:30

>>14
Don't forget, it was Microsoft, who forced C++ in the first place. And their .NET has only static typed OOP languages. They are embodiment of Satan himself. No coincidence, that all their executives're jewish.

Name: Anonymous 2011-03-03 9:54

>>16
>>14
just because you're a Lisper it doesn't mean you're smart.

Name: Anonymous 2011-03-03 10:06

>>17
Enjoy your C# and C++

Name: Anonymous 2011-03-03 10:28

>>16,18
They see me trollin'

Name: Anonymous 2011-03-03 10:30

Name: Anonymous 2011-03-03 10:37

>>18
Enjoy your autism, and this is not even spam.

Name: Anonymous 2011-03-03 10:40

ITT: shitty trolling

Name: Anonymous 2011-03-03 10:52

>>21
"Autist" is the one, who identifies smartness with love for M$ and masturbates to sweaty Ballmer.

Name: Anonymous 2011-03-03 11:44

>>9
You left out newLISP!

Name: Anonymous 2011-03-03 11:55

>>24
newLisp
only dynamic scope
No!

Name: Anonymous 2011-03-03 12:01

I have no idea what the newLISP people are smoking, but I want some.

Name: Anonymous 2011-03-03 20:35

>>24
Agree. newLISP is so much better, than Racket. and it allows you to access source code of compiled functions.

Name: Anonymous 2011-03-03 21:01

>>27
You can do that for almost any Lisp with decent debugging support.

Name: Anonymous 2011-03-03 21:22

>>27
I, think, you, have, so much, commas.

Name: Anonymous 2011-03-03 21:35

>>28
>Lisp
>decent
HAHAHAHAHAHAHA

Name: Anonymous 2011-03-03 21:56

>>30
Back to the imageboards with you.

Name: Anonymous 2011-03-03 22:00

>>31

fuck you faggot also yhbt yhl hand fuck off and die motherfucking faggot eat shit and cdr

Name: Anonymous 2011-03-03 22:32

>>32
You sound upset, my advice still stands.

Name: Anonymous 2011-03-03 22:43

Lisp is a troll meme. Compare it to something like Python, Ruby, or Haskell and understand why it is a troll.

Name: Anonymous 2011-03-03 22:45

>>34
If someone is using it as a ``meme'', they're free to, but that has no bearing on the family of languages named Lisp.

Name: Anonymous 2011-03-03 22:56

>>33
fuck you faggot

Name: Anonymous 2011-03-03 23:03

Lisp fucking sucks ((((cocks)))), enjoy your ParEdit autism, faggots. My other car is an autistic faggot.

Name: Anonymous 2011-03-03 23:05

>>37
Why do you keep sounding so upset?

Name: Anonymous 2011-03-03 23:36

>>28
But other Lisps don't gurantee presence of source for every function or even arg-list info.

Name: Anonymous 2011-03-03 23:40

>>34
SICP and Scheme/Racket are trolling memes. LISP isn't.

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

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