[erlang-questions] record type as variable

Ulf Wiger <>
Thu Aug 5 16:31:08 CEST 2010

>> On Wed, Aug 4, 2010 at 12:05 PM, Noel Bush <> wrote:
>>> Is there any way to specify the type of a record using a variable? I
>>> want to be able to do this sort of thing:
>>> create(Type, Name) ->
>>>    #Type{name = Name}.
> I'm trying to think of a use case for this.

I did something along those lines in my DIAMETER stack while
at Ericsson.


Not to say that it couldn't be solved in other ways.

Ulf W
Ulf Wiger
CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd

More information about the erlang-questions mailing list