any update on catchalls for harmony?
On Tue, Feb 3, 2009 at 12:05 PM, Yehuda Katz <wycats at gmail.com> wrote:
I'll reiterate my support for prop_missing. I'd be curious how you'd expected added/inherited hooks to work with ES.
Well - I admit I haven't give it too much thought - but thinking about it cursorily:
What if everytime the prototype property is modified - trigger a hook in the object whose prototype is being set, and and tigger a hook in the object that is being set as the prototype. This would be trivial to do within Object.create() (assuming this feature is desirable). It would be trickier to do if we wanted these hooks called upon manual update of the internal [[proto]] property.
dog.proto = new Animal(); Although it seems that there is no way in standard ecmascript to change an object's internal [[prototype]] property once it is set.
Hmm - and more importantly than that - what should happen here: new Animal();
A new object gets created, and its prototype is set (to Animal.prototype) - but does it make sense for hooks to be called in the new object (i.e. the hook would have to reside in Object.prototype ?)
Anyway - i'm not sure I have any good use cases for these hooks - so unless someone feels like this is a useful feature - I am ambivalent on the issue.
, Faisal Vali Radiation Oncology Loyola
Greetings. First of all, thank you for making this forum public - some of these discussions have been quite informative. (I wish some of the other standards' bodies would make their discussions/emails public
Well, let me get right to the topic.
Since catchalls/interceptors (method/prop_missing) and hooks (method/prop_added, object_inherited) are an important reason for the success (and natural syntax) of at least one of the more popular server-side-web-programming frameworks (specifically rails' implementation of ActiveRecord), I was wondering what the level of interest is in implementing such features in harmony.
I know Peter Michaux had a nice suggestion regarding catchalls in one of the posts late last year - but I haven't seen any followup or further mention of such features.
Although, I will say that I have partially filled that void by finding some comfort in the efforts devoted to trying to get lambda right for a possible macro system ;)
, Faisal Vali Radiation Oncology Loyola