elm-lang / elm-repl

A REPL for Elm
BSD 3-Clause "New" or "Revised" License
170 stars 34 forks source link

Clarification on multi line input in README #152

Open ohenecoker opened 7 years ago

ohenecoker commented 7 years ago

I am new to elm and currently exploring the elm syntax through the repl. Until recently, every time I attempted to write a multi line input in the repl I like this:

sqr num = \ num * num

I would get this error:

"The = operator is reserved for defining variables. Maybe you want == instead? Or maybe you are defining a variable, but there is whitespace before it?"

I'm on a mac running macOS 10.12.3 running Elm 0.18.0

This was pretty annoying because I thought I was following the README instructions and it didn't make sense that I was still getting this error. After digging through the web for I while, I found that all I needed was a space after the second line for example:

sqr num = \ | num * num

The second space before the body of the function is super critical and space before all other consecutive lines. For the sake of beginners who wouldn't know this off the bat, could someone please include that in the README? Newcomers would find it very helpful. Thanks

process-bot commented 7 years ago

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

kirikaza commented 7 years ago

It duplicates #147