Getting double semi as sequencer harvested.

Igor Stasenko siguctua at gmail.com
Tue Sep 4 06:03:14 UTC 2007


On 03/09/07, Andreas Raab <andreas.raab at gmx.de> wrote:
> Igor Stasenko wrote:
> > In my asm-generator i found a good use of traits - like an extension
> > mechanism which can be applied to any class to override some basic
> > behavior. In my case, by adding a trait to some class,  i'm overriding
> > methods which used for compiling instance side methods, so i can
> > replace and/or extent parser or compiler features only for particular
> > class(es)  without modifying parser/compiler globally.
> > Also, i don't need to change inheritance chain in classes, where i
> > adding traits.
>
> Sounds interesting. Care to share it?
>

It's still not finished.

Trait declaration:

Trait named: #AsmCompilerSupport
	uses: {}
	category: 'Asm-Generator'

And then in some class i simply changing class declaration like following:

Object subclass: #AsmCodeGenerator
	uses: AsmCompilerSupport
	instanceVariableNames: 'machine methods'
	classVariableNames: 'MethodLocations'
	poolDictionaries: ''
	category: 'Asm-Generator'


> Cheers,
>    - Andreas
>
>


-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list