Russ Abbott (5.10.2005 8:42):
My question was what's the difference between

    proc {IsMember X Xs}
       case Xs of H|T then
          choice X=H [] {IsMember X T} end
       else
          fail
       end
    end

and

    proc {IsMember X Xs}
       case Xs of H|T then
          choice X=H [] {IsMember X T} end
       end
    end

In the first there is an 'else fail'. In the second there is nothing. But it fails under the same circumstances, i.e., when Xs is nil. Is there really a need for an explicit fail?

The default "else" body of the case statement throws the "missing else clause" exception, not "fail".

Cheers,
Filip
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to