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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.