[squeak-dev] Terse Guide for Squeak
juan at jvuletich.org
Fri Nov 26 20:05:43 UTC 2010
David T. Lewis wrote:
> Well, hopefully it will be useful for us recovering Fortran and
> C programmers ;-)
> Let me issue two follow up challenges, since I could not figure
> these out on my own:
> 1) It would be good to add a terse one-line expression that would show
> the use of block closures. What is the shortest meaningful expression
> that illustrates this?
They allow functional style code to work properly. For example:
fac := [ :n | n > 1 ifTrue: n * (fac value: n-1)] ifFalse: ].
fac value: 5. "120"
fib := [ :n | n < 2 ifTrue:  ifFalse: [(fib value: n-1) + (fib
fib value: 10. "89"
> 2) It would be nice if the pages in the help book could be set to
> behave like workspaces, with syntax formatting and workspace
> variables. Can anyone think of a way to do it?
More information about the Squeak-dev