chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] handling the undefined value


From: F. Wittenberger
Subject: [Chicken-users] handling the undefined value
Date: Wed, 17 Nov 2010 20:56:29 +0100

Hi Chickeners!

I ran into a rare "call of undefined value" -- somewhere in the middle
of several KLOC of code.

So how to debug that?  It turns out not to be an easy operation.  Hence
my idea here.

So far I see two basic approaches to handle the "undefined" behaviour of
standards: a) refuse to return any result (rarely in Scheme
implementations, since an 'if' without failure clause would have to
raise an exception if in tail position - from the top of my head I'm not
even sure whether or not this would still be compliant to any Scheme
standard; but its the default in strongly typed languages) b) return
some arbitrary value (be it a randomly chosen one or a distinguished
value like in chicken.

I'd welcome a warning message in case (a) -- instead of refusing to
compile the source.

Within the world of the latter situation, catching the reason of
reference to an undefined value can be quite hard, once the value has
been passed around for a while.

But while it would be bad to refuse to compile one-branch-if's in tail
position (and better return whatever value), I'd love to have an option
(at compile or runtime) to turn that particular value called "undefined
value" into an error iff it appears in any argument position.

And, as I'm about to fill up the wish list, I'd welcome a third info:
the source line info, where the call was tried.  Isn't it right there
available?

Best Regards

/Jörg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]