Does 'end' need to be separated by a space?

I accidentally attached 9 with end But it still running and giving me results, Is that fine or something wrong here? it should give me some error no?

  iex(15)> Enum.filter([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], fn(x) -> x >= 3 && x <= 9end) 
    [3, 4, 5, 6, 7, 8, 9]

if it was C like would you expect an error?

Enum.filter([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], fn(x) {x >= 3 && x <= 9})

Ah… Elixir is C?

Nope :slight_smile: was just providing an analogy. Elixir syntax is inspired by Ruby. In Ruby

def blah()10>9end 

is fine too

1 Like

The spacing rules for various tokens has changed throughout the development of Elixir. You could bring up making a newline or space required before end on the elixir-core mailing list.

1 Like