On Wed, Jun 6, 2012 at 8:24 PM, Ryan Davis <[email protected]> wrote:
>
> On Jun 6, 2012, at 15:54 , Peter Zotov wrote:
>
>> Instead of this:
>>
>>  if arg == "a"
>>    1
>>  elsif arg == "b"
>>    2
>>  end
>>
>> ... you can use:
>>
>>  { "a" => 1, "b" => 2 }[arg]
>>
>> I leave the rest to your imagination.
>
> I think this is too limiting / not mind-expanding enough...
>
> I suggest looking at how smalltalk does branching (conditionals, loops, etc).

excellent suggestion.

Also consider how this could be done via delegation ala objective c style.


>
>

-- You received this message because you are subscribed to the Google Groups 
ruby-talk-google group. To post to this group, send email to 
[email protected]. To unsubscribe from this group, send email 
to [email protected]. For more options, visit this 
group at https://groups.google.com/d/forum/ruby-talk-google?hl=en

Reply via email to