[erlang-questions] refactoring a very large record

Tim Watson watson.timothy@REDACTED
Thu Oct 20 15:23:54 CEST 2011


On 20 October 2011 13:37, Joel Reymont <joelr1@REDACTED> wrote:

> I have a record with about 80 fields.
>
> I'm in dialyzer hell because this record is in a header file and used all
> over the place.
>
> I would like to make this record opaque and completely encapsulate it in a
> single file.
>
> Should I export getters and setters for each field?
>

No idea about the rest of these questions, but look at
https://github.com/esl/parse_trans/blob/master/src/exprecs.erl to automate
generating accessor functions if you decide you need them.


>
> Would these be inlined by the compiler?
>
> Is ETS a suitable replacement for a record of this size?
>
>        Thanks, Joel
>
> --------------------------------------------------------------------------
> - for hire: mac osx device driver ninja, kernel extensions and usb drivers
> ---------------------+------------+---------------------------------------
> http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
> ---------------------+------------+---------------------------------------
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111020/652aa75b/attachment.htm>


More information about the erlang-questions mailing list