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

Bengt Kleberg eleberg@REDACTED
Thu Feb 6 11:05:35 CET 2003


greetings,

i would like to do the following:

-record(prswDomain,
	{domain, working_if, protection_if, working_dp,
	 protection_dp}).

dpid_to_if(Dp, Domain) ->
    case Dp of
	Domain#prswDomain.working_dp ->
	    Domain#prswDomain.working_if;
	Domain#prswDomain.protection_dp ->
	    Domain#prswDomain.protection_if
    end.
		  

this fails during compilation with

prswCodeChange.erl:155: illegal pattern

i know the workaround, but why is this an illegal pattern?


bengt




More information about the erlang-questions mailing list