|
mapping implemented in functions vs in structures: msg#00362lang.erlang.general
I want to map entity x1 on machine m1 to y1 on m2 ... I can see there are two choices and don't know which one is the more idiomatic way in erlang world: (1) functions m1_m2(x1) -> y1; m1_m2(x2) -> y2. m3_m6(a1) -> b1; m3_m6(a2) -> b2.... At run time, suppose A = m1, B = m2, X = x1. To get y1, I will need to form a string S ="m1_m2(x1)" and evaluate it. btw, how do I do this ? erl_eval:expr() looks complicated. (2) structures {{m1_m2, [{x1, y1}, {x2, y2}]}, {m3_m6, [{a1, b1}, {a2, b2}]} Given A, B, X in (1), finding y1 becomes a matter of parsing the structure. thanks, HP |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: invoking functions on a remote machine without erl running: 00362, Vladimir Sekissov |
|---|---|
| Next by Date: | Re: mapping implemented in functions vs in structures: 00362, Vladimir Sekissov |
| Previous by Thread: | ets:match(Continuation) usage question.i: 00362, Jeff Einhorn |
| Next by Thread: | Re: mapping implemented in functions vs in structures: 00362, Vladimir Sekissov |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |