Info on Smalltalk DSLs or Metaprogramming...

Rich Warren rwmlist at gmail.com
Tue Aug 22 19:22:36 UTC 2006


On Aug 22, 2006, at 2:36 AM, Bert Freudenberg wrote:

> Rich Warren schrieb:
>> Ruby's literal hashes are not great from a non-geek legibility  
>> viewpoint, but if you're making a DSL for coders, they're brilliant.
>
> Aren't Smalltalk dictionaries equally legible?
>
> {
>   'one' -> 1.
>   'two' -> 2.
>   'foo' -> 42.
> } as: Dictionary
>
> - Bert -
>

I'd argue Ruby (can be) a little more streamlined. If it's the last  
parameter, you don't need any brackets. And it doesn't need the as:  
Dictionary call.

However, thanks. I didn't know about this idiom, and I'll be sure to  
use it a lot.

-Rich- 



More information about the Squeak-dev mailing list