4 ms·
In my language Magpie, function calls can have which ever appearance makes the most sense for the operation: prefix(arg) // for function-like thing
by munificent 14y ago
In my language Magpie, function calls can have which ever appearance makes the most sense for the operation:
prefix(arg) // for function-like things
arg postfix // for "getters"
arg infix(otherarg) // for method-like things
It's purely a syntactic distinction. Semantically, methods are always multimethods and are not tied to any receiver class. You can freely define new methods that dispatch on existing classes.
I find it works really well, though it brings in some unanticipated complexity. You'll really want multimethods or some form of argument-based polymorphism. Also, scoping get a bit more confusing if you want "overriding" to work like you expect across modules.
See: http://magpie-lang.org/multimethods.html http://magpie-lang.org/multimethods.html
- skrebbel 14y agoMagpie is so lovely, i want to give it flowers. Do you think it'll ever reach something near production equality, or will it "always" be a "toy"?