For the curious -- I was wondering what the initial example:
hello = ^(name){ "Hello "+name }
repeat {times: 3} ^{
print hello {name: "John"}
}
... compiled to as JavaScript. Here's the output, which you can reproduce by calling "move.compile()": "use strict";
var Move, _MoveKWArgsT, Text, extend, create, print, repeat, after, JSON,
hello;
Move = __move.runtime, _MoveKWArgsT = Move._MoveKWArgsT, Text = Move.Text,
extend = Move.extend, create = Move.create, print = Move.print, repeat =
Move.repeat, after = Move.after, JSON = Move.JSON, require = Move.require;
return hello = function (name) {
name !== null && typeof name === "object" && name.__kw === _MoveKWArgsT
&& (arguments.keywords = name, name = name.name);
return "Hello " + name;
}(repeat({
times: 3,
__kw: _MoveKWArgsT
})(function () {
return print(hello({
name: "John",
__kw: _MoveKWArgsT
}));
}));
For comparison, here's what the same example in CoffeeScript: hello = (name) -> "Hello " + name
for i in [1..3]
print hello "John"
... compiles to as JavaScript (which you can reproduce in the "Try CoffeeScript" console): var hello, i;
hello = function(name) {
return "Hello " + name;
};
for (i = 1; i <= 3; i++) {
print(hello("John"));
}