Re: Add lists:find/2,3
Serge Aleynikov <[email protected]>
| Newsgroups | gmane.comp.lang.erlang.patches |
|---|---|
| Message-ID | <CANt451mn-KRBdyGTwQ1Pt72A=jsSEWPdgD7vcX5Ut4zmXrJ8Bg@mail.gmail.com> |
Sorry, a couple of typos in my previous example:
> update_table(Table,
>
> Key,
>
> FieldName,
>
> Value) ->
> Attrs = mnesia:table_info(Table, attributes),
> {ok, Pos} = index_of(FieldName, Attrs),
> R = mnesia:dirty_read(Table, Key),
> R1 = setelement(Pos, R, Value),
> ok = mnesia:dirty_write(Table, R1).
>
_______________________________________________
erlang-patches mailing list
[email protected]
http://erlang.org/mailman/listinfo/erlang-patches