[erlang-questions] Field name to tuple element number at compile time

Sean Rasmussen <>
Wed Aug 27 18:07:09 CEST 2008


Hi Joel,

Not sure if it's more elegant, but - if I understand your intent - I would
have gone with:

mnesia:match_object(#inplay{amount=100,_='_'})

Regards,
Sean

Quoting Joel Reymont <>:

> On Aug 27, 2008, at 4:14 PM, Bengt Kleberg wrote:
>
>> Greetings,
>>
>> Do you mean like this:
>>
>> #foo.bar
>
>
> Yes, thanks to everyone who took the time to reply!
>
> I'm still looking for a more elegant way to write the following
>
> db:find({inplay, GID, ID1, '_'}, #inplay.amount))
>
> without incurring a penalty for building the match pattern at runtime,
> while _also_ saving on typing inplay twice. 
>
> --
> wagerlabs.com
>
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
>





More information about the erlang-questions mailing list