Pattern matching vs. ETS lookups

Tony Rogvall <>
Tue Feb 17 10:37:35 CET 2004


On Tuesday, Feb 17, 2004, at 09:30 Europe/Stockholm, Vance Shipley 
wrote:

>
>
> I tried to make a clauses version of the 65K test however
> it's been compiling for over an hour now so I think we can
> conclude that that model isn't workable.
>
I am also trying that, but like you said, it is STILL compiling?????
What on earth is going on in the compiler???
The structure of the code is extremely simple it should be a matter
of seconds to compile, basically read it and write it (someone :-)

My version just looks like:

...
handle_call(<<FunctionID:16, Body/binary>>, _From, State) ->
   case FunctionID of
     0 -> {reply,{lzajpvnqkvo,zaviohpnsfgewpcrzqzed},State};
     1 -> {reply,{pibpulozsusmmypocy,qfuwgkkvejzjlbtkdgebew},State};
     2 -> 
{reply,{aipvkpmsyjizeynqdpnnqpt,lhmtwwrawienmegfaamcsxd},State};
     3 -> {reply,{hqccfokzabnbtvyw,tshigwfuunhmnototydp},State};
     4 -> {reply,{vhcsnibefbubf,cqazgqwcgvrmyfggvk},State};
     5 -> {reply,{qcefxjnojnrake,evcfxizafalknzjkfhcbkjom},State};
     6 -> {reply,{liuvmdamtisxpqgdqoav,omqtrgaxealzjdllggegrw},State};
     7 -> {reply,{dgvhztimzjoc,xxszgkqxcuupw},State};
     8 -> {reply,{rvsywvgltmmmnnyt,hrazckuvs},State};
...
     65534 -> {reply,{blkkrhio,vaxzhrmipoxrvljrfrualfcw},State};
     65535 -> {reply,{lehgpela,hjjqvkdpuzj},State};
     _ -> {reply, undefined, State}
end.

/Tony




More information about the erlang-questions mailing list