Behavior>>#compiler directly refers EsCompiler

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

Behavior>>#compiler directly refers EsCompiler

gcotelli
Hi,
anybody knows why:

Behavior>>compiler
"Answer the compiler class to use for the receiver's methods. Override
this method if your class accepts code which does not use the standard
syntax."
^self environment classAt: #EsCompiler

is implemented that way instead of using #Compiler ?

I think is better to use the global (Compiler) instead of the class (EsCompiler) to allow changing easily the default compiler implementation for another one. I'm doing some experimentation and would be good to have this facility.

Regards,
Gabriel

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/M4NjUAvIsuIJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Behavior>>#compiler directly refers EsCompiler

Thomas Koschate-2
Gabriel, by allowing subclasses to override #compiler, it becomes possible to easily provide a customized compiler for a class or hierarchy of classes without affecting system behavior globally.  If you look at senders of #compiler, you can see where that can get interesting.  For your experimentation, I'd suggest that this is actually a better way to go about it, since you can try things for your test classes without breaking the whole environment.  Once you're happy with your new compiler, you can set the global Compiler in whatever way you want.  See EsCompiler class>>#initializeAfterLoad.

Tom

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/hTGP1P3f_2MJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Behavior>>#compiler directly refers EsCompiler

gcotelli
Hi Tom,
that's exactly what I'm doing. I'm now ready to change globally the compiler but changing the global doesn't work as expected because some tools sends compiler to the class and the implementation in Behavior always returns EsCompiler and not the global.

Gabriel

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/pMLkRgaotC0J.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.