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

Stephan Rudlof sr at evolgo.de
Mon Dec 24 06:10:37 UTC 2001


Marcus Denker wrote:
> 
> On Fri, Dec 21, 2001 at 01:14:47PM -0800, John M McIntosh wrote:
...
> >
> > Ah, could you submit a change set for that I must have changed that a
> > few months ago. The problem is assert is also defined in the mac bsd
> > headers somewhere. The assert should really be changes to
> > SqueakAssert or something versus being deleted.
> 
> Ok.
> 

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?)

So far there wasn't any problem with assert, so what is it exactly (I don't
have a Mac)?
Then I've seen other plugin code with asserts (B3DRasterizerPlugin): why
isn't there the same problem?

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.

I like #assert: and 'assert()' to have simple debug checking and some
documentation about the conditions which have to hold: please don't change
its name on either side.


Greetings,

Stephan
-- 
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