Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Smalltalk, PLAI etc.

5 views
Skip to first unread message
Message has been deleted

hol...@arsystel.com

unread,
Aug 21, 2009, 6:42:44 AM8/21/09
to fli...@googlegroups.com
Hi!

I'd like to thank Jordi for his terrific presentation.
Actually I got a little inspired and played some time with Squeak.
It felt - on first impression (and I didn't get much further yet) - like
Oberon/A2 (http://www.oberon.ethz.ch/).

Does anyone know that system? How does it relate to Smalltalk?
At first sight they seem to have much in common - but first sight may be
misleading...

FWIW: There's a not too long article "Smalltalk for LISPers". Maybe
someone's interested:
http://www.exept.de:8080/doc/online/english/programming/stForLispers.html

Andy made an interesting (and for me surprisingly surprising) comment
about an exercise in PLAI: Why implement recursion if we have the Y
combinator?
He is, of course, right. So here we go (it's roughly exercise 8.2.3 in PLAI):

;; recursion with Y combinator ;-)
; application (see below)
(

; Y combinator
((fun (f)
((fun (h) (h h))
(fun (g) (f (fun (z) ((g g) z))))))

; actual "recursive" function - here the fibonacci numbers
(fun (f) (fun (x) (if0 x 0 (if0 (- x 1) 1 (+ (f (- x 1)) (f (- x 2))))))))

; applying 8 (thus the first opening paren above)
8)

This is much better (= more fun) than my implementation of recursion in
the presentation.

Jos: Hope you'll get better soon!

All: Enjoy your vacations!
Thomas


Reply all
Reply to author
Forward
0 new messages