[erlang-questions] stuck at a exercise
Bengt Kleberg
bengt.kleberg@REDACTED
Mon Jan 26 15:10:39 CET 2015
You should export functions. In your case b_not/1
bengt
On 01/26/2015 03:09 PM, Roelof Wobben wrote:
> Hello,
>
> At a book im following with self-study I have to do this exercise :
>
> Write a module boolean.erlthat takes logical expressions and Boolean
> values (represented as the atoms trueand false) and returns their
> Boolean result. The functions
> you write should include b_not/1, b_and/2, b_or/2, and b_nand/2. You
> should not use
> the logical constructs and, or, and not, but instead use pattern
> matching to achieve your
> goal.
>
> So I tried the first clause and came with this :
>
> -module(boolean).
>
> -export([boolean/1]).
>
> b_not({true}) ->
> false.
>
> But as soon as I compile it I see these error messages :
>
> boolean.erl:3: function boolean/1 undefined
> boolean.erl:5: Warning: function b_not/1 is unused
>
> How to solve these ?
>
> Roelof
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
More information about the erlang-questions
mailing list