[erlang-questions] how to add a tuple to a list.

Roelof Wobben r.wobben@REDACTED
Thu Jan 29 20:04:09 CET 2015


Hello,

For a exercise I have to make a sort of database.

IM trying to make the write function which has to work like this :

Db1 = db:write(francesco, london, Db).
[{francesco,london}]

So i have to make a tuple of the data and add it in a list.

I thought I could do something like this :

write(Key, Data, Db) ->
   [ {key, data} | Db ]

but then I see some error messages.

Can someone give me a tip how to do this ?

Roelof




More information about the erlang-questions mailing list