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

Stephan Rudlof sr at evolgo.de
Thu Dec 27 20:12:55 UTC 2001


Tim Rowledge wrote:
> 
> It sounds to me that there are several varieties of 'assert()' that
> exist in C-land and a variety of ways of getting them into an
> executable. This suggests to me that we should sidstep the problem by
> using our own name (is there anything wrong with #sqAssert: ?)

#sqAssert: is a workaround:
We already have this nice ST #assert:, and I'd be happy to be allowed to use
the same name for a C assert() with a related semantics.
And it annoys me to be forced to avoid this name just since there is some
platform specific include problem.

> and
> defining it to sensibly suit the needs of the vm. I see from a cursory
> search on the web that there is at least a dichotomy between assert()s
> that simply write the line & function name out to a log and those that
> then abort you program. I'm not sure either is adequate for real uses;
> wouldn't it be more useful to have a flag for a fatal problem so you can
> choose whether you need to log or die?

This gives me an idea: we already have #primitiveFailed and could possibly
define #assert: to use it instead of a hardcore abort() (together with some
logging stating than an assert has failed). What do you think about this?

Greetings,

Stephan

> 
> tim
> 
> --
> Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
> Useful random insult:- Useful as a hip pocket on a T-shirt.

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