Russ Abbott wrote:
> 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?
Yes, definitely. It would make no sense for the case statement to implicitly
fail when no pattern is matched outside a constraint programming script, and
the semantics should be the same inside and outside scripts.
I think requiring the 'fail' to be explicit results in a clearer program,
anyway.
--
David Hopwood <[EMAIL PROTECTED]>
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users