nodrock / redtamarin

Automatically exported from code.google.com/p/redtamarin
Other
0 stars 1 forks source link

implement C.assert #56

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Standard C library
assert.h 

Original issue reported on code.google.com by zwetan on 25 Nov 2013 at 4:29

GoogleCodeExporter commented 8 years ago

Original comment by zwetan on 25 Nov 2013 at 4:35

GoogleCodeExporter commented 8 years ago
define only one function assert( expression:* )

should work kind of like a try/catch throw error when we get a stacktrace
eg. "macro shall insert diagnostics into programs"

left as "not implemented" for now

Original comment by zwetan on 17 Jan 2014 at 8:18

GoogleCodeExporter commented 8 years ago
Ideally we would like to support it but we are not sure yet how.

This header only define one function assert()

when used and called in C, it allows to assert than expression is valid

and if not, will return the expression used and the line number where it happen 
and then call abort().

We can not use the native assert() call "as is", but we could try to replicate 
its functionalities

eg. returning the AS3 line where the assert was not valid and the expression 
string

and instead of calling abort() maybe interrupt the code like a throw error ?

Original comment by zwetan on 18 Jan 2014 at 3:18