Avoid newbie record redundancy?

Andrew Lentvorski <>
Sat May 27 14:12:41 CEST 2006


This is almost certainly a newbie question.  I have the following code:

match_queue(MasterQueue) ->
    receive
	{msgPeerMaster,
	 #rcdPeerMaster{returnSocket=Socket, masterIP=MasterIP, masterPort=MasterPort}} ->
	    QItem = #rcdPeerMaster{returnSocket=Socket, masterIP=MasterIP, masterPort=MasterPort},
	    match_queue(queue:in(QItem, MasterQueue));
	_ ->
	    ?elog("HELP!~n", [])
    end.

Is it possible to still do the match on rcdPeerMaster while not
unpacking and then repacking everything?  That seems like a lot of
needlessly duplicated code.

Thanks,
-a



More information about the erlang-questions mailing list