[ENH] Lispy list functions
agree at carltonfields.com
agree at carltonfields.com
Wed Sep 8 17:12:37 UTC 1999
> "listDo: is Smalltalk-like"
> c := OrderedCollection new. list listDo: [:a | c add: a]. c. "(3 2 1)"
> "But this is lispier"
> (1 to: 5) collect: [:i | list listHeadAndTailIn: [:h :t | list := t. h]]
Perhaps "Smalltalkier" would be:
Array streamContents: [:s | list listDo: [:a | s nextPut: i]].
More information about the Squeak-dev
mailing list
|