callable objects ?

Brendan Eich brendan at mozilla.org
Wed Apr 18 07:57:45 PDT 2012


The original post in this thread, from David Nolen, cited

https://gist.github.com/2346460

In general there are more callable objects under the sun than function 
objects, but if the only way to make one is to write a proxy (now a 
direct proxy), the tax is too high:

* Two object allocations not one.
* A priori set-up when you might need mutation of an existing object to 
become callable.

These may not motivate you, I'm not trying to sell anyone. We should 
discuss utility and trade-offs more, so thanks for posting.

David mentioned Dart's considering a callable protocol too. I found this:

http://groups.google.com/a/dartlang.org/group/misc/browse_frm/thread/6b4f18132adfaa78/c2cfd0daadba67f1?lnk=gst&q=callable#c2cfd0daadba67f1

but I'm not sure if it is the latest. Perhaps you know more?

/be

Andreas Rossberg wrote:
> I'm sorry, but can somebody explain what the real use case for all
> this would be? And why proxies do not already cover it? Do we really
> need to make _every_ object into half a (mutable?) function proxy now?
>
> /Andreas
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>


More information about the es-discuss mailing list