assert or sqAssert? [was: Re: Source Forge Changes for 3.2.1]

Stephan Rudlof sr at evolgo.de
Thu Jan 10 00:59:58 UTC 2002


Marcus Denker wrote:
> 
> On Mon, Dec 24, 2001 at 07:10:37AM +0100, Stephan Rudlof wrote:
> > The current workaround is to have >>sqAssert: in the LargeIntergersPlugin.
> > I'm not happy with this.
> >
> > I just want to have an assert function, which does exactly what you expect
> > from such a function. The semantics should be the same for as ST #assert: as
> > C 'assert()'. And now there comes one compile problem and we have to change
> > code on the ST side. Furthermore I have to follow the rule: 'Don't use
> > #assert: in plugin code!'. (And when comes the next function name, which I
> > cannot use?)
> >
> ....
> > Possible solutions:
> > - If it is a macro defined elsewhere, you are probably able to #undef it in
> > your special platform specific code.
> > - On the other side: what about '#include <assert.h>' as standard for all
> > plugins? Then we don't have to define such a function for plugins in ST. And
> > the #assert: in ST matches the C 'assert()' well in semantics.
> >
> 
> Or: We could chane the SLANG Codegenerator to use a prefix (like "sq_") for
> every function it generates... (instead of generationg a function "assert()"
> it would generate "sq_assert()" for the "assert:" method)
> this would solve this kind of problem once and for all.

Good idea: *all* 'private' C functions of InterpreterPlugin subclasses could
have this prefix. We shouldn't use it for exported functions though, they
already have the module prefix, which should be sufficient.

We are continuing to emulate C++ namespaces here...

Wait: why not using a C++ compiler with
	namespace Squeak
instead?
;-)


Greetings,

Stephan


> 
>    Marcus
> 
> --
> Marcus Denker marcus at ira.uka.de

-- 
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 mailing list