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@sumeru.stanford.edu, http://sumeru.stanford.edu/tim Useful random insult:- Useful as a hip pocket on a T-shirt.