[squeak-dev] Re: Smalltalk and functional programming

Hannes Hirzel hannes.hirzel at gmail.com
Mon Aug 30 09:19:05 UTC 2010


On 8/30/10, Stéphane Rollandin <lecteur at zogotounga.net> wrote:
> Le 24/08/2010 20:07, Chris Cunnington a écrit :
>> Perhaps somebody would be willing to show a piece of code written in a
>> functional style?
>>
>> This was presented but then quickly dismissed: Smalltalk at: #square
>> put: [: x| x * x ]
>>
>>
>> Chris
>
> | f g h |
>
> f := Lambda m position: 100 @ 100.
> g := Lambda m color: Color red.
> h := Lambda m openInWorld.
>
> h <~ Morph new. "shows a Morph"
> h <= g <~ Morph new. "shows a red Morph".
> h <= g <= f <~ Morph new. "shows a red Morph at 100 @ 100".
>
>
> ... more about this at:
> http://www.zogotounga.net/comp/squeak/functionaltalk.htm
>
>
> Stef
>

Great illustration, Stéphane

What about opening a project 'FunctionalProgramming' in FunSqueak with
a few workspaces, some comments and code snippets like this.

--Hannes



More information about the Squeak-dev mailing list