Slang: Suppressing 'static' declarations
sr at evolgo.de
Sat Jan 14 00:23:05 UTC 2006
On 13.01.2006 21:56, I wrote:
> A workaround:
> - define the static Plugin's variables as before, but with another name
> as the extern ones (rename the vars in one of these sets), and then
> - assign the extern to the static ones and vice versa via
> self cCode: 'pluginVar = externVar;'
> self cCode: 'externVar = pluginVar;'
> self cCode: 'ptrToExternVar = &externVar;'
> Then the hacked code is small and you are able to use Slang vars.
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"
self cCode: 'externalVar = aValue' "arg aValue has to be of same type
Concrete examples are
Mpeg3Plugin>>mpeg3tValueOf: (getter), and
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