elm-lang / elm-platform

Bundle of all core development tools for Elm
BSD 3-Clause "New" or "Revised" License
762 stars 125 forks source link

multiple lines via backslash #185

Closed Spenhouet closed 8 years ago

Spenhouet commented 8 years ago

I'm new to elm and therefor reading the elm introduction.

In the section < Core Language - If Expressions > there is this example:

over9000 powerLevel = \
|   if powerLevel > 9000 then "It's over 9000!!!" else "meh"

And the following description:

Using a backslash in the REPL lets us split things on to multiple lines.

I did try that but only got the following error:

-- SYNTAX PROBLEM -------------------------------------------- repl-temp-000.elm

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

3|   over9000 powerLevel = \
                         ^
Maybe <http://elm-lang.org/docs/syntax> can help you figure it out.

I'm getting the same error in your REPL online.

process-bot commented 8 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.

evancz commented 8 years ago

I think this question is better for http://elmlang.herokuapp.com/ or https://groups.google.com/forum/#!forum/elm-discuss. Maybe you have spaces before the definition, but I'd need more information to know. The folks on Slack and the mailing list are friendly and happy to help out. They can get you going, and if there's something wrong, they can help make an issue on the elm-repl repo