Satoshi Murakami
Satoshi Murakami
Watch also for top level `return`s which were guaranteed to work without `--bare`.
I'm all for this if we can find a simple, clever implementation. Some consideration off the top of my head: - There is no one clear way to implement it:...
> only changing it on values that have the overloading method How? Sample code and compilation would be great.
> ``` > Array.prototype["@
> figures out if `arr` is an array at runtime For what? Your compilation figures out `1
> Precedence could be resolved by parsing operators with the highest precedence first ... You mean, using JS operators'? What about custom operators?
> You could look into languages like haskell to see how they handle infix function precedence Haskell allows you to pick a precedence. http://www.haskell.org/onlinereport/decls.html (4.4.2 Fixity Declarations) > `"use overloading"`?...
> simply replacing every occurrence of operators under that declaration would be easy Here's a proof of concept: https://gist.github.com/982183 ``` $ cat 60.co $op = (op, left, rite) -> switch...
> though I assume that ... Yup, it's just a quick example. You can tweak away the gist for your need (and reach to a more elegant solution along the...
> `a + b ++ c d` to `a + b["++"](c[""](d))` That's actually pretty close to what we already have: ``` $ coco -bpe 'a + b\++ c\ d' a...