<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix"><a class="moz-txt-link-abbreviated" href="mailto:e@bestmx.net">e@bestmx.net</a> schreef op 29-1-2015 om
      20:06:<br>
    </div>
    <blockquote cite="mid:54CA84BD.6090908@bestmx.net" type="cite">
      <blockquote type="cite">So i have to make a tuple of the data and
        add it in a list.
        <br>
        <br>
        I thought I could do something like this :
        <br>
        <br>
        write(Key, Data, Db) ->
        <br>
           [ {key, data} | Db ]
        <br>
        <br>
        but then I see some error messages.
        <br>
      </blockquote>
      <br>
      what messages?
      <br>
      <br>
      as far as i can _theorize_
      <br>
      the most probably your Db is not a list, and it should be.
      <br>
      _______________________________________________
      <br>
      erlang-questions mailing list
      <br>
      <a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
      <br>
      <a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
      <br>
      <br>
    </blockquote>
    <br>
    Here is my code so far : <br>
    <br>
    -module(db).<br>
    <br>
    -export([new/0, destroy/1]).<br>
    <br>
    new() -><br>
      [].<br>
    <br>
    destroy(Db) -><br>
      {ok}.<br>
    <br>
    write(Key, Element, Db) -><br>
       [ [{key, data}] | Db ] <br>
    <br>
    <br>
    and this the output of c(db).<br>
    <br>
    <input class="terminal-input">                                                                                                                                                                               
    <br>
    <div data-row="4" class="terminal-row">3> c(db).                                                                                                                                                                              </div>
    <div data-row="5" class="terminal-row">db.erl:12: syntax error before:                                                                                                                                                        </div>
    <div data-row="6" class="terminal-row">db.erl:8: Warning: variable 'Db' is unused                                                                                                                                             </div>
    error   <br>
    <br>
    Roelof<br>
    <br>
    <br>
  </body>
</html>