Curious to know what would you have done differently. I'm working on a programming language based on OCaml with Ruby-like syntax.
Curious to know what would you have done differently. I'm working on a programming language based on OCaml with Ruby-like syntax.
* |> rather than ^ for the pipe operator (more consistent with several other languages)
* [list| 1, 2, 3] rather than [list: 1, 2, 3] (just for better visual distinction, though the current syntax does look pretty clean and uncluttered)
* having a separate code block for methods of individual variants rather than interspersing them with data definitions (because i think it's important that the basic data definition be as uncluttered as possible)
if you'd like some syntax feedback on your language i'd be happy to take a peek :)
it's the separator aspect i was getting at with my proposal though - visually it's [ datatype | elements ] whereas the current one looks more like the colon is part of the first element - [(list : 1), 2, 3]
Frankly, I'm really trying, and I'm having a very hard time suffering from the "list: 1" confusion you claim. I admit, that's just me.
Also, `|` as a separator suggests a kind of symmetry. But the two sides are not symmetric at all. Whereas in English, `:` does not imply symmetry.