Closed KlausTrainer closed 11 years ago
This is doesn't working, because you have space in the name of module: Yo muthafucka
You need take a name of module without space or using an atom syntax, like: :"Yo muthafucka"
The example from this site looks like to be wrong.
This works:
iex(1)> defmodule Yomuthafucka do
...(1)> IO.puts "Definin tha function ghetto"
...(1)> def ghetto do
...(1)> IO.puts "Yo muthafucka Ghetto"
...(1)> end
...(1)> IO.puts "Function ghetto defined"
...(1)> end
And for the future, I think it is MUCH better to use official guide: http://elixir-lang.org/
Yeah, exactly. The website linked on the issue was generated automatically and changed some of the words, rendering an invalid syntax.
When I try to execute the first code example from the website in an interactive shell, I get a syntax error. I have no clue about what could possibly cause that syntax error. Could it be possible that this is a bug in the parser that crept in quite recently, and nobody but I noticed? I'm just guessing because I find it quite unlikely that this problem has been existing for a longer time, as somebody else would probably have noticed earlier then. I'm using the newest Elixir from the master branch. I haven't tried any other Elixir so far.
Below is the code with the stacktrace I get: