On Wed, Jun 6, 2012 at 8:24 PM, Ryan Davis <ryand-ruby / zenspider.com> wrote=
:
>
> On Jun 6, 2012, at 15:54 , Peter Zotov wrote:
>
>> Instead of this:
>>
>> =A0if arg =3D=3D "a"
>> =A0 =A01
>> =A0elsif arg =3D=3D "b"
>> =A0 =A02
>> =A0end
>>
>> ... you can use:
>>
>> =A0{ "a" =3D> 1, "b" =3D> 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, e=
tc).

excellent suggestion.

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


>
>