- To iterate through a collection of Employee objects to collect the name from each employee only requires the following code: aCollection collect: [:eachEmployee | each name ]
- To iterate through a collection of Employee objects and select all employees where last name is "Smith": aCollection select: [:eachEmployee | eachEmployee lastName = 'Smith']
Wednesday, December 10, 2008
I had forgotten how much I like Smalltalk
I've been working in Java for many year now and had not done any real work with Smalltalk until recently. We have a tool that we are now porting to Smalltalk and I just remembered why I did not like Java initially, everything seems much simpler in Smalltalk. Processing collections is much simpler in Smalltalk :
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment