[Nix-dev] Re: Proposal: tryCatch function

Eelco Dolstra e.dolstra at tudelft.nl
Tue Jan 6 10:36:20 CET 2009


Nicolas Pierron wrote:

> On Tue, Jan 6, 2009 at 10:06, Michael Raskin <7c6f434c at mail.ru> wrote:
>> Nicolas Pierron wrote:
>>> There throw should not throw an exception in the C++ code but it
>>> should just return a normal form.
>>>
>>> throw "foo": is a normal form
>>> (throw "foo") + "bar" : is not a normal form and it returns throw "foo".
>>>
>>> This remove the problem of the evaluation order I guess.
>> What should
>> (throw "foo") + (throw "bar")
>> return?
> 
> Usually, you start reading a string by the left-hand side, therefore,
> I would say: throw "foo".

Which was exactly what I meant with evaluation order :-)  The language semantics
don't specify in what order arguments are evaluated, so it might also be `throw
"bar"'.

Of course we could say that useful error messages are more important than a
"clean" semantics, but it's still a concern.

-- 
Eelco Dolstra | http://www.st.ewi.tudelft.nl/~dolstra/



More information about the nix-dev mailing list