PS: Re: Slang: Suppressing 'static' declarations
sr at evolgo.de
Sat Jan 14 00:28:55 UTC 2006
On 14.01.2006 01:23, I wrote:
> There is a *much* better possibility (has come into my mind inside a
> restaurant after writing down the stupid workaround above).
> What about writing accessor methods?
> self returnTypeC: 'int'. "or some other type"
> ^ self cCode: 'externalVar' "int in this case"
> setExternalVar: aValue
> self cCode: 'externalVar = aValue' "arg aValue has to be of same type
> as externalVar"
Such methods can be inlined, so don't be afraid of performance problems.
> Concrete examples are
> Mpeg3Plugin>>mpeg3tValueOf: (getter), and
> FilePlugin>>setMacFile:Type:AndCreator: (setter).
> Hope this helps,
Stephan Rudlof (sr at evolgo.de)
"Genius doesn't work on an assembly line basis.
You can't simply say, 'Today I will be brilliant.'"
-- Kirk, "The Ultimate Computer", stardate 4731.3
More information about the Squeak-dev