[Aldor-l] Exceptions in aldor

Christian Aistleitner tmgisi at gmx.at
Fri Mar 31 13:21:17 EST 2006


Hello,

> I don't think that RuntimeError should be used.

the whole runtime thing is a bit scary to me anyways, so I guess you are  
right. But I wanted to mention it for the sake of completeness -- and for  
the fact that I stumbled across it while implementing AldorUnit.

> Anyway, there is some work to be done to somehow bring some order in all  
> the exception stuff. For example there is no common ExceptionType that  
> all other exceptions inherit from.

<advertisement product="ExtIO library">
At last! :))
Look at my ExtIO Library.
http://www.risc.uni-linz.ac.at/software/aldor/project.php?id=ExtIO
According to the ChangeLog of ExtIO, ExceptionType exists in ExtIO at  
least since about a year ago. And (you can probably guess it)  
ExceptionType serves excatly the purpose of a common category for  
exceptions. However, extending the categories of LibAldor and LibAlgebra  
to this ExceptionType is rather frustrating, as the extension does not  
work as expected: LibAldor's and LibAlgebra's functions still throw the  
Exception _without_ the extension (Such much for post-facto extensions).
Therefore I did not bother to search for all exceptions in LibAldor and  
LibAlgebra to extend them. It was sufficient for me to use ExceptionType  
for my exceptions.
However, since we now have a (hopefully) complete list of exceptions I  
added the necessary code to extend all exceptions to ExceptionType in  
ExtIO. I will release the new version within the next few days.

But again, be aware, that such an extension does _not_ affect those  
exceptions thrown from LibAldor or LibAlgebra. It only affects those  
exceptions you throw in _your_ code.
So if you throw a SyntaxException in your code, it will have  
ExceptionType. The InputType functions of LibAldor's List will still throw  
SyntaxExceptions _not_ having ExceptionType.
</advertisement>

Kind regards,
Christian



More information about the Aldor-l mailing list