I just picked up Erlang and I ran into a simple problem, but I have not been able to fix it or find anything about it. I'm trying to define a module that checks if an atom is in a given list. I entered the list through the Erlang shell like this:
veggies:veggieMember([cucumber,tomato,potato],tomato).
But I always get exception error: no function clause matching
Maybe I misunderstood the basics, but here is the module code I'm trying to do:
-module(veggies).
-export([veggieMember/2]).
veggieMember(veggieList,query)->
case lists:member(query, veggieList) of
true->veggieList;
false->[query|veggieList]
end.