47 karma · joined Nov 30, 2014 (11y ago) · 9 submissions
comment 3y ago · link · parent
I'm not sure I follow the question about infix notation and precedence, but: Trains of identifiers like `a b c d e f g` are always parsed as `b`, `d`, `f` being infix binary operators; their precedences are looked up at runtime to decide how that expression evaluates. Explicit function calls and indexing always bind more tightly, and operands in those trains can contain either; an expression like `a(arg) b c(arg1, arg2) d e[i] f g[j:k]` has the same binary operators as before. But operators are only single identifiers and don't contain function calls, so `a b (c)` is still the binary operator `b` with arguments `a` and `(c)`.
"Sets" are just dictionaries with set elements as the keys and null as every value. This makes sense because you want testing for set membership to be fast like locating a key in a dictionary and because, like in Python, iterating over a dictionary iterates over its keys.
We also already have `.+` for prepending a list element to a list and `+.` for appending. (These are the analogues of Scala's `+:` and `:+`.)
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
6.
Gab will become a Mastodon fork(gab.com ↗)
91 points · by betaveros · 7y ago · 305 comments
comment 9y ago · link · parent
I sorta cheated with an assembler (https://github.com/sl236/Piet) though.
comment 10y ago · link · parent
It takes quite a few more characters, but it was fun.
comment 11y ago · link · parent