[e-lang] Bug (0.8.26h): multiple-pattern catch expansion is incorrect

Kevin Reid kpreid at attglobal.net
Thu Apr 29 17:57:11 EDT 2004

On Apr 29, 2004, at 17:41, Mark S. Miller wrote:
> At 02:23 PM 4/29/2004  Thursday, Kevin Reid wrote:
>> The expansion for multiple-catch-clause try-catch does not follow the
>> semantics of the kernel try-catch when the pattern match fails - it 
>> creates
>> a new exception instead of simply passing on/rethrowing the unmatched 
>> one.
>> Possible solutions:
>> 1. Replace e`throw("no match: " + @x)` with e`throw($x)`, though 
>> there will
>> still be an extra throw() in the stack trace.
>> 2. Allow an arbitrary number of catch clauses in Kernel-E.
>> 3. Somehow make match failure of all of the individual patterns in the
>> expansion cause failure of the try-catch expression's pattern.
>> 4. Expand each catch clause into a nested try-catch.
> #4 seems simplest to me. Do you see any problems with it?

No, but I haven't thought about it much yet. It was the last solution 
that occurred to me.

Kevin Reid

More information about the e-lang mailing list