[Top][All Lists]

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

Re: [Chicken-users] handling the undefined value

From: Felix
Subject: Re: [Chicken-users] handling the undefined value
Date: Wed, 17 Nov 2010 23:53:48 +0100 (CET)

From: Jörg "F. Wittenberger" <address@hidden>
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.

Does it give a compile-time error or does this error happen at
> 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.

The scrutinizer could give a warning in this case.

> 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?

Usually not, sorry.


reply via email to

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