Here is the Toit version of it: https://docs.google.com/document/d/1K-TYea7jbYfj2ecMUmr0T0zd...
And here the MicroPython: https://www.makerfabs.com/desfile/files/Get-Started-MicroPyt...
Here is the Toit version of it: https://docs.google.com/document/d/1K-TYea7jbYfj2ecMUmr0T0zd...
And here the MicroPython: https://www.makerfabs.com/desfile/files/Get-Started-MicroPyt...
remembered_ = List width/2: initial_value
half_height := height / 2
...
min_value := remembered_.reduce: | a b | min a b
These lines (with seemingly context-sensitive meanings for the / and : characters) feel less obvious to me than the examples on the home page.The `/` are also the same (division), but it's true that we also use `/` to introduce types. For example `x/int`.
I think Toit is relatively easy to learn, but there are definitely a few things that need explaining in the beginning.
We then experimented with different tokens, and `/` felt best.
[Yes, colons are nice as block introducers but don’t play nice with colons for type ascription, which is where we got Python’s asinine f(x: int, y: bool) -> str; don’t know why Rust went with that instead of ML’s uniform f(x: int, y bool): str.]
Also types are optional in Toit, so they are a bit like comments (though they are now checked so they are less like comments now). So they look a little like // comments.