[erlang-questions] Gotta be an easier way...

Mike Oxford moxford@REDACTED
Mon Jun 13 23:34:26 CEST 2011

Updating nested records; keep all record (and sub-record!) information
intact but change one value.

A generic logon-type message, with nested records, this type of structure.

        v1_rec_header (header)
             v1_rec_route [] (route)


Note how many times I have to fully qualify the record path to get the
sub-records to take the correct values even though I'm only changing
one value since every nested records seems to need to have a fully
qualified path.  Ugh.

Shortening variable names, or writing accessor macros for everything
are possibilities ... but is there a better way I'm missing?  (Don't
use nested records is a poor response.)

Note that....


will give you

#v1_rec_route{value1 = correct,route_entries = [foo]}

but will not return the entire thing.

Anyone have a better way...?



More information about the erlang-questions mailing list