-
Website
http://20bits.com -
Original page
http://20bits.com/articles/erlang-an-introduction-to-records/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
Felix Purnama
3 comments · 1 points
-
hadley
2 comments · 1 points
-
adamheroku
2 comments · 3 points
-
twiss
2 comments · 1 points
-
maxima128
2 comments · 1 points
-
-
Popular Threads
Opts = #server_opts{port=80, ip="192.168.0.1"},
NewOpts = Opts#{port=7000}.
should look like this:
Opts = #server_opts{port=80, ip="192.168.0.1"},
NewOpts = Opts#server_opts{port=7000}.
> Perhaps a subset of the first, records are also used to keep track of configurable options.
Yes, records may be used for this. But sometimes proplists are better choice, take a look at http://www.erlang.org/doc/man/proplists.html:
> Property lists are useful for representing inherited properties, such as
> options passed to a function where a user may specify options overriding
> the default settings, object properties, annotations, etc.
I'm not sure if you're a real person or a spam bot, but by "a la PHP, Ruby, or Python" I meant as a first-order construct. I'll reword it so it's less ambiguous.
Good catch. And thanks for pointing to proplists, I didn't know about them.