[erlang-questions] case not equal to

Roelof Wobben r.wobben@REDACTED
Sat Jan 31 09:56:35 CET 2015


Thanks.

Finnally solved this one.

Now delete and match and this exercise is done.

Roelof


Gordon Guthrie schreef op 31-1-2015 om 9:46:
> R
>
> In your mind replace ‘;’ with ‘OR’ and ‘,’ with ‘AND’ and ‘.’ with STOP
>
>> read(Key, [Head | List]) ->
>>   case element(1, Head) of
>>     Key -> {ok, element(2, Head)} OR
>>     _ -> read(Key, List) STOP
>>   end
>
> There should be nothing at the end of the second clause not a ‘.’ (STOP)
> There should be a ‘,’ (AND) or a ‘.’ (STOP) if it is the end of the function.
>
> G
>
>> Le 31 janv. 2015 à 08:43, Roelof Wobben <r.wobben@REDACTED> a écrit :
>>
>> Hello,
>>
>> I have now this :
>>
>> read(Key, [Head | List]) ->
>>   case element(1, Head) of
>>     Key -> {ok, element(2, Head)};
>>     _ -> read(Key, List).
>>   end
>>
>>
>> The second clause must be thay element(1,Head) is not equal to Key,
>>
>> How do I take care of this.
>>
>> This gives this error message ; db.erl:20: syntax error before: '.'
>>
>> and !Key gives the same error message.
>>
>> Roelof
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>




More information about the erlang-questions mailing list