[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Error Handling.



I would like to have a simplefied error handling mechanisim.

I am writing an interface program that picks out Cobol style
data from a file.  One of the field is a comment one into which
I want the users to be able to enter {s-expressions},
ie. arbitrary Lisp forms to be READ.

The problem is that if they have entered syntactically bad
expressions the whole interface aborts.

CLtL just says error handling is too hard.
To my mind even the Error function is weak, it should have an
explicit tag as well as a message.

However in the mean time would it be difficult to develop
a function like si:Error-Set (which is actually a universal
CATCHer) such that (Trap-Errors Form) would return Nil
and Forms results unless an error was signalled in Form,
else T and the Error parameters?

By the way my comments actually come in multiple 
lines and it seams tacky to have to Concatenate them
together to Read-From-String or With-Input-From-String.
Some sort of With-Input-From/Output-To-Function
would be neat, the function could return/be passed
chuncks of text.

Finally I note that si:String-To-Object is the
same as Read-From-String but faster (and with
missing parameters).  Why do two functions exist
with the same meaning?

Anthony