[e-lang] scoping rules of when-catch

Mark S. Miller markm at cs.jhu.edu
Sun Jul 23 20:34:24 EDT 2006


Kevin Reid wrote:
> Another thing about 'when':
> 
> Given the sealed-throw rules, the expansion of when needs to be changed.
> 
> ? e`pragma.enable("easy-when"); pragma.disable("explicit-result- 
> guard"); when (a) -> { b } catch c { c }`
> [...]
> If a resolves to a broken reference, the result will be that  
> reference's problem, *sealed*, which is unnecessarily uninformative.
> 
> I don't have any specific ideas yet about how to fix the expansion  
> nicely.

I agree. And I'm also unsure how to fix this. This issue is now bug
https://sourceforge.net/tracker/index.php?func=detail&aid=1527509&group_id=75274&atid=551529


> Also, it seems to me that a user program likely might want to  
> distinguish between exceptions resulting from the reference breaking  
> and those resulting from failure of the when body; but again I don't  
> know what the right solution is.

Since it's just sugar, when the E programmer wants to make finer distinctions, 
he can program in the same terms that this expands into.

-- 
Text by me above is hereby placed in the public domain

     Cheers,
     --MarkM


More information about the e-lang mailing list