[erlang-questions] syntax errror on :

Garrett Smith g@REDACTED
Sat Aug 8 20:30:41 CEST 2015


So it's me who needs to read more carefully - touche!

Your syntax error is in terminating two clauses with commas - commas
separate expressions. Delete them.

Out of curiosity, what's wrong with the bad match error? Who's saying you
need to map that to some string?

On Sat, Aug 8, 2015 at 1:27 PM, Roelof Wobben <r.wobben@REDACTED> wrote:

> Op 8-8-2015 om 20:24 schreef Garrett Smith:
>
> This is actually Joe's way:
>
> On Sat, Aug 8, 2015 at 1:19 PM, Roelof Wobben <r.wobben@REDACTED> wrote:
>
>> char_to_shape(Char) ->
>>>       case Char of
>>>           $R -> get_dimension(rectangle);
>>>           $T -> triangle;
>>>           $E -> ellipse;
>>>           $r -> rectangle;
>>>           $t -> triangle;
>>>           $e -> ellipse
>>>     end.
>>
>>
> I think your immediate problem is just reading a bit more carefully. Oh,
> and try not to use the list as a compiler :)
>
>
> That was Joe first way.
>
> Later he explained thet try catch because the exercise needs to give error
> messages.
>
> Roelof
>
>
>
> ------------------------------
> [image: Avast logo] <https://www.avast.com/antivirus>
>
> Dit e-mailbericht is gecontroleerd op virussen met Avast
> antivirussoftware.
> www.avast.com <https://www.avast.com/antivirus>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150808/00da0df5/attachment.htm>


More information about the erlang-questions mailing list