try without catch

Gunilla Arendt gunilla@REDACTED
Wed Nov 16 10:39:57 CET 2005


Actually, the reference manual says:

"The of, catch and after sections, are all optional in the try 
expression, as long as there is at least a catch or an after section"

Also, I get "syntax error before: 'end'" when I try to compile a try 
without catch and after?

/ Gunilla

Ulf Wiger (AL/EAB) wrote:
>  
> Nick Linker wrote:
> 
>>Maybe I didn't understant the idea, but if you intend to add "catch"
>>later, why don't write
>>
>>case Expr of
>>    Result -> Action
>>end.
> 
> 
> Yes, of course, but part of the reason was to see whether
> it worked as described in the manual. ;-)
> 
> The 'of', 'catch' and 'after' parts of the try statement
> are all optional, so
> 
> try Expr of 
>    Result -> Action
> end
> 
> should have been allowed (and it was - by the compiler).
> 
> /Uffe
> 
> 




More information about the erlang-questions mailing list