Lambda vs. function
Maciej Stachowiak
mjs at apple.com
Tue Oct 28 12:18:52 PDT 2008
On Oct 27, 2008, at 11:28 PM, Breton Slivka wrote:
>>> I would argue it. You can either equivalently consider the fall
>>> through to
>>> be a jump, or say it behaves as if the code of case 2
>>
>> "as if the code of case 2 were duplicated into case 1"
>>
>> - Maciej
>
> I had a go at combining that concept with my object dispatcher
> concept, to try and come up with an example of a reasonable transform
> of a switch statement to a structure with equivalent function that
> uses (mostly) only lambdas and expressions.
The object dispatcher is a neat trick but not a correct transform of
switch, since switch compares with == rather than by converting to
string like property lookup does.
- Maciej
More information about the Es-discuss
mailing list