-
Notifications
You must be signed in to change notification settings - Fork 10
Named Operators
I'm not especially happy with the current crop of JavaScript-esque operators. Especially &&
and ||
and !
. I think Ruby's and
, or
and not
are much more elegant. But how do we fit them into PogoScript? After all, any word that appears in a form is taken to be part of the name of a function or variable.
This won't work as it does in Ruby:
a and b
Because variables can contain spaces:
show details and has access
Instead operators work, which can't be part of identifiers:
show details && has access
But we should try something else, named operators, not-unlike Haskell's infix operator:
show details @and has access
Of course we can try a number of symbols to get it right:
show details %and has access
show details $and has access
show details #and has access
According to the documentation, you can have Closure Compiler add the sourceMappingURL to the bottom of the script with something like this:
--output_wrapper "%output%
//# sourceMappingURL=output.js.map"
being added to your call. Not that you cannot use "\n" here, and you need a newline literal. On a Linux shell this works just fine (if you're inside of quotes when you press enter, the command doesn't get executed).