I\'m building a Smalltalk API to an XML-based web service. The XML service is so regular that, rather than write the methods by hand, I figured I\'d just override #doe
#doe
I would use block:
himaker := [:name | [:n | n timesRepeat: [Transcript show: 'Hi , ', name, '!']]] hibob = himaker value: 'bob'. hialice = himaker value: 'alice'. hialice value: 2
You can still make himaker a method
himaker: name ^[:n | n timesRepeat: [Transcript show: 'Hi, ', name, '!']]