Another interesting aspect of OCaml syntax:
[1,2,3] is equivalent to [(1,2,3)]. A list of integers is [1;2;3].
This is one of those cases where familiarity with the syntax of other languages can actually make life harder! [1,2,3] doesn't look wrong and is syntactically valid.
Related Posts
One interesting aspect of collecting coins in a platformer like mario: it makes the level stateful.
You can see if you've been somewhere before based on whether there are coins present.
I'm changing method definition syntax in my language:
// old
fun (this: Int) inc(): Int { this + 1 }
// new
method inc(this: Int): Int { this + 1 }
The original syntax was inspired by Go, but the new syntax is more grep-friendly and perhaps more readable. Not sure about the verbosity though. Thoughts?
I'm experimenting with syntax in examples. I don't really like Rust's `assert(inc(1) == 2)` syntax, I find it a little distracting.
I'm trying `inc(1) //-> 2`. The comment is rendered differently, and there's nothing before the sample code. What do you think?