Argument unpacking?

@lnicodon alnicodon at gmail.com
Thu Nov 9 14:45:15 PST 2006


On 11/9/06, P T Withington <ptw at pobox.com> wrote:
>
> On 2006-11-09, at 16:29 EST, Brendan Eich wrote:
>
> > It would also be helpful for bootstrapping if new and apply could
> > be composed; this came up when I wrote Narcissus.  Suggestions?
>
> Make new a class method rather than a keyword?  (I know, too
> controversial.  But that is the Lisp answer.)


Well, some workaround do exists within the current language

http://groups.google.com/group/netscape.public.mozilla.jseng/msg/48395a68e716c9d0

they just won't scale to some host objects, (and, yes, they incur some
memory overhead, even though a constant one).
So while I like the lisp way, it will unfortunately not accomodate those
alien objects.

The thing I most miss about apply is that I cannot have 'spread args':
>
> foo.apply(bar, bletch, crud, rest) === foo.apply(bar, [bletch,
> crud].concat(rest))


Is

foo.call(bar, bletch, crud, rest)

an answer, or did I miss the point ?

Cheers,

Alexis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.mozilla.org/pipermail/es-discuss/attachments/20061109/a4802308/attachment.html 


More information about the Es4-discuss mailing list