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
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
On 8/30/10, Stéphane Rollandin lecteur@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
squeak-dev@lists.squeakfoundation.org