[erlang-questions] Erlang record accessors (set/get)
Wed Aug 15 03:20:24 CEST 2012
It may seem a bit silly, but you could wrap element and setelement in macros that relate to the record name with short get/set names. That would probably make it simpler for those that are addicted to get/set.
On 08/14/2012 06:10 PM, Loïc Hoguin wrote:
> Val = element(#myrec.fieldname, Rec).
> Rec2 = setelement(#myrec.fieldname, Rec, NewVal).
> Or something approximating that.
> On 08/15/2012 03:04 AM, Zabrane Mickael wrote:
>> Hi guys,
>> We want to provide a simple API to one of our customers not very
>> familiar with Erlang.
>> This API involves records manipulations (set/get operations) and you
>> know what I mean.
>> Before re-writing the wheel, I'd like to know is someone already used
>> "recbird" before:
>> Any use case? Is it stable? Better alternatives?
>> Feedbacks welcome!
>> erlang-questions mailing list
More information about the erlang-questions