From: Jörg "F. Wittenberger" <[email protected]> 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 run-time? > > 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. cheers, felix _______________________________________________ Chicken-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/chicken-users
