Pure win: Array.from and Array.of

Allen Wirfs-Brock allen at wirfs-brock.com
Sun Jul 10 11:02:16 PDT 2011


On Jul 10, 2011, at 10:32 AM, Allen Wirfs-Brock wrote:
> 
> Yes, if you actually need to pass Array.of as a function argument.  Of course if we have block lambdas you could just say:
> 
>      hof({|a|[a]})
> instead of
>      hof(Array.of)

actually the above aren't equivalent.  The block lambda form would have to be:

     hof({|...a|[...a]})

so it would loose the length way by 6 characters.

Allen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110710/9d178315/attachment.html>


More information about the es-discuss mailing list