Functional Squeak

Mats Nygren nygren at sics.se
Sat Jun 3 12:03:39 UTC 2000


Brian Sutton <smalltalk at vt.edu> wrote:
> Hi all!
> 
> Has anyone tried to write Smalltalk code in a very "functional" style
> (eliminating state changes as much as possible)?  What were your
> impressions?
> 
> Would immutable collections be a valuable addition to Squeak?  How about
> an even larger subset of the class library for Functional Squeaking?
> 
> What do you think?
> 
> Brian

I have, and I like it. As long as the compiler doesnt do anything with
the information no special immutable stuff is needed.

My aim instead is the use of higher order functions for generality and
elegance, a lot of this is possible with close to no implementation
effort. Look at the posting: "(1 to: self) inject: 1 into: #*", a small
step towards a functional style.
I have some postings in my mind on the subject. If requested I will
materialize them, right now I have other things on my mind. And so many
other things is moving within Squeak.

Sum total:
- I support a functional style within Squeak.
- I recommend starting with practice, that is by using well chosen
higherorder functional patterns and only later think about immutability
and uses of this by the compiler.
- I have some concrete ideas to share if requested, if not I'll wait
with this for a while.

/Mats Nygren





More information about the Squeak-dev mailing list