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

Vance Shipley <>
Thu Feb 6 17:39:51 CET 2003


Bengt,

I use this form:

dpid_to_if(Dp, Domain) when Domain#prswDomain.working_dp == Dp ->
	Domain#prswDomain.working_if;
dpid_to_if(Dp, Domain) when Domain#prswDomain.protection_dp == Dp ->
	Domain#prswDomain.protection_if.


   -Vance


eleberg> -record(prswDomain,
eleberg> 	{domain, working_if, protection_if, working_dp,
eleberg> 	 protection_dp}).
eleberg> 
eleberg> dpid_to_if(Dp, Domain) ->
eleberg>     case Dp of
eleberg> 	Domain#prswDomain.working_dp ->
eleberg> 	    Domain#prswDomain.working_if;
eleberg> 	Domain#prswDomain.protection_dp ->
eleberg> 	    Domain#prswDomain.protection_if
eleberg>     end.



More information about the erlang-questions mailing list