Smalltalk super keyword implementation in Amber

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Smalltalk super keyword implementation in Amber

Mir S.
I was experimenting a bit and wondered into Amber's Javascript land. Calling 'self something' executes the method on anObject if it doesn't find it there method lookup goes up the inheritance chain to the superclass and the super of the superclass.

Where does this super happen in Amber?
Could one mess with it?

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk super keyword implementation in Amber

Herby Vojčík
Try to compile a super call and look what JS it produces and learn the rest from it.

Or did I again not understood what the question is about?

Herby

Mircea Samoilă wrote:
> I was experimenting a bit and wondered into Amber's Javascript land. Calling 'self something' executes the method on anObject if it doesn't find it there method lookup goes up the inheritance chain to the superclass and the super of the superclass.
>
> Where does this super happen in Amber?
> Could one mess with it?
>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk super keyword implementation in Amber

Mir S.
You got it! 
Your advice sheds some light on the problem:

//>>excludeStart("ctx", pragmas.excludeDebugContexts);
$ctx1.supercall = true, 
//>>excludeEnd("ctx");
$globals.WhateverClass.superclass.fn.prototype._initialize.apply($recv(self), []));
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
$ctx1.supercall = false;
//>>excludeEnd("ctx");;

I'll dig deeper.

Pe 18 sep 2015 la 00:42, Herby Vojčík <[hidden email]> a scris:

Try to compile a super call and look what JS it produces and learn the rest from it.

Or did I again not understood what the question is about?

Herby

Mircea Samoilă wrote:
I was experimenting a bit and wondered into Amber's Javascript land. Calling 'self something' executes the method on anObject if it doesn't find it there method lookup goes up the inheritance chain to the superclass and the super of the superclass.

Where does this super happen in Amber?
Could one mess with it?


--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk super keyword implementation in Amber

Mir S.
In reply to this post by Herby Vojčík
You got it! 
Your advice sheds some light on the problem:

//>>excludeStart("ctx", pragmas.excludeDebugContexts);
$ctx1.supercall = true, 
//>>excludeEnd("ctx");
$globals.WhateverClass.superclass.fn.prototype._initialize.apply($recv(self), []));
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
$ctx1.supercall = false;
//>>excludeEnd("ctx");;

I'll dig deeper.

Pe 18 sep 2015 la 00:42, Herby Vojčík <[hidden email]> a scris:

Try to compile a super call and look what JS it produces and learn the rest from it.

Or did I again not understood what the question is about?

Herby

Mircea Samoilă wrote:
I was experimenting a bit and wondered into Amber's Javascript land. Calling 'self something' executes the method on anObject if it doesn't find it there method lookup goes up the inheritance chain to the superclass and the super of the superclass.

Where does this super happen in Amber?
Could one mess with it?


--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.