''illegal pattern'' when using records in case statement

Bengt Kleberg eleberg@REDACTED
Thu Feb 6 12:44:44 CET 2003

> X-Authentication-Warning: meg.it.uu.se: richardc owned process doing -bs
> Date: Thu, 6 Feb 2003 11:47:04 +0100 (MET)
> From: Richard Carlsson <richardc@REDACTED>
> X-Sender: richardc@REDACTED
> To: Bengt Kleberg <eleberg@REDACTED>
> cc: erlang-questions@REDACTED
> Subject: Re: ''illegal pattern'' when using records in case statement
> MIME-Version: 1.0

> What your attempted pattern wants to test (i guess) is that "in case Dp
> is *the 'working_dp' element of* the 'prswDomain'-record Domain ...",
> but that would be equivalent to:
> 	case Dp of
> 	    element(5, Domain) -> ...
> To be more formalistic about why that can't be made into a pattern:
> patterns describe the static skeleton of the data (counting pre-bound
> variables as static), and a pattern like this one would not be static.

i get it. i tried to have a case ''target'' that was the result of a
''function call''. atleast that is how i interpret your explanation. the
talk about patterns is still over my head :-(


More information about the erlang-questions mailing list