[PROPOSAL] "use" keyword

Andrea Giammarchi andrea.giammarchi at gmail.com
Fri Jul 25 14:29:31 PDT 2014


that's the nonsense I am talking about. In php "use" is defined at function
definition time, it's not something you can attach later on.

In JS you can use .call and .apply passing any context to any different
function, unless already bound to another context, so you have already way
more power than PHP methods or generic callbacks, with or without "use"

If you talk about variables as outer scope variables, then I don't
udnerstand how you create functions that rely on abstract values around
them without knowing what are these values about ... what does it mean
sharing variables?

There's a lot of mixed and in my opinion unclear content that has not much
to do with "use" or PHP and rather what you are trying to achieve
concretely which is still a mystery to me.

Then, trying to understand what brought you here, I've realized here (
https://github.com/Lcfvs/XEncoder.js/blob/master/XEncoder.js#L49 ) you
might want to clear-up a little bit, and a part of this thread, how context
and scope work in JavaScript, maybe you have all answers already, you just
don't see them ;-)

Best Regards








On Fri, Jul 25, 2014 at 2:13 PM, Michaël Rouges <michael.rouges at gmail.com>
wrote:

> @Andrea :
>
> There is no real equivalent in PHP.
>
> I only used the "use" keyword as example to suggest, in your mind, an
> ability to share vars with a foreign function
> without to touch the foreign function arguments. ;)
>
>
>
> Michaël Rouges - https://github.com/Lcfvs - @Lcfvs
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140725/060bb9fb/attachment.html>


More information about the es-discuss mailing list