11/10/2008

As Homer would say "Mmmm Smalltalk, is there nothing it can't do?"

No sooner had I posted my vague 'pipe dream' about automatically creating methods, than Randal posted a comment, showing exactly how to do it. In case you aren't subscribed to the comments feed, this is what he wrote:

#(one two three four five) do: [:each | YourClass compile: (each asString , ' self flag: #toBeWritten') ].


Actually, he finished his code with a :-) . Out of curiosity, and powered by my new found belief that Smalltalk really can do anything, I opened a method finder to check whether :-) is a method. Sadly, and not surprisingly, it is invalid syntax. However, if I ever do find a way of implementing it, I shall get it to return an Anchor tag to this video.

No comments: