www.digitalmars.com         C & C++   DMDScript  

D - catch the assert

reply Kazuhiro Inaba <Kazuhiro_member pathlink.com> writes:
According to the reference document, assert() throws an exception and we can
catch it. So I tried to write code with this technique, but then i run into a
problem.

Thrown object's class seems to be std.assert.Assert, but since "assert" is a
reserved identifier, I cannot do:

import std.assert;

Is there any way to deal with this? Or, std.assert is only for internal use and
we should catch the exceptions from assert() with catch(Object o) {} ?

-- 
K.INABA( ki kmonos.net )
Nov 12 2003
parent reply "Walter" <walter digitalmars.com> writes:
"Kazuhiro Inaba" <Kazuhiro_member pathlink.com> wrote in message
news:botnq7$2uqv$1 digitaldaemon.com...
 According to the reference document, assert() throws an exception and we

 catch it. So I tried to write code with this technique, but then i run

 problem.

 Thrown object's class seems to be std.assert.Assert, but since "assert" is

 reserved identifier, I cannot do:

 import std.assert;

Yes, that's a bug I need to fix.
 Is there any way to deal with this? Or, std.assert is only for internal

 we should catch the exceptions from assert() with catch(Object o) {} ?

That will work for the moment.
Nov 14 2003
parent Kazuhiro Inaba <Kazuhiro_member pathlink.com> writes:
In article <bp389v$2ih5$2 digitaldaemon.com>, Walter says...
Yes, that's a bug I need to fix.

Thanks. I'll wait for it.
Nov 14 2003