|
Question about style: msg#00254lang.smalltalk.squeak.beginners
Hi listees, I'm trying to find my Smalltalk accent, if you know what I mean. In a project I have a class that's a subclass of Dictionary. I created the following method to create a convenient way of accessing entries in the dictionary: doesNotUnderstand: aSelector "for unknown selectors, see if we can find an environment variable and return that" ^ self at: aSelector asString ifAbsent: [ super doesNotUnderstand: aSelector ] So my question is whether this is considered good style or not? It works quite well (except the doIt in a workspace pops up to say the selector is unknown). This sort of thing is done in Ruby often, and I did find some examples in various classes in my image. (Actually one example even defined the missing accessor on the fly - that's really showing off). Thanks, Steve
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Metaclass hierarchy - Explanation - Part 2, Oscar Nierstrasz |
|---|---|
| Next by Date: | RE: Question about style, Ramon Leon |
| Previous by Thread: | Metaclass hierarchy - Explanation - Part 2, Damien Cassou |
| Next by Thread: | RE: Question about style, Ramon Leon |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |