みんなだいすきラムダ式.
function Lambda(argName, body) {
this.argName = argName;
this.body = body;
}
Lambda.prototype.eval = function (env) {
var argName = this.argName;
this.mosaic = this.mosaic || {}; | |
(function(mosaic) | |
{ | |
Object.defineProperty(mosaic, | |
"core", {value: function() | |
{ | |
this.Action = mosaic.core.Action; | |
this.wrap = mosaic.core.wrap; | |
this.fail = mosaic.core.fail; |
package | |
{ | |
import flash.display.Sprite; | |
import flash.events.MouseEvent; | |
import flash.text.TextField; | |
import flash.text.TextFieldType; | |
import flash.net.navigateToURL; | |
import flash.net.URLRequest; |
/* | |
* Simple JSON Parser | |
* http://www.json.org/index.html | |
*/ | |
var lq = require("loquat"); | |
var util = require("util"); | |
/* | |
* Parsers |
var f = function (a) { return a.toString() } | |
(function () { | |
console.log(f("test")) | |
})() |
1 1 | |
2 4 | |
3 9 | |
11 121 | |
22 484 | |
26 676 | |
101 10201 | |
111 12321 | |
121 14641 | |
202 40804 |
// 注意: アロー関数を排除できない | |
function ctor (Ctor) { | |
return function () { | |
if(typeof Ctor !== "function") { | |
throw new TypeError(typeof Ctor + " is not a function"); | |
} | |
var proto = Ctor.prototype; | |
if (proto === null || typeof proto !== "object") { | |
proto = Object.prototype; | |
} |
say -v Cellos aki no tah no ka ri ho no e o oh oh wa gah ko ro mo de tsu you ni nu reh tsu tsu | |
say -v Cellos ha ru su ghee te na tsu ki ni k ra ah shi ko ro mo ho su cho oh ame no ka goo yama | |
say -v Cellos a shi be ki no yama dory no oh oh no na gah na gah shi yo he toe ri ka mo ne m | |
say -v Cellos tah go no woo ra woo chi ee de mi rae eh bar foo ji no tah ka ne yu ki wa foo ri tsu tsu | |
say -v Cellos o coo yama momiji na coo shi ka ah no ko eh key coo toe ki zo aki ka na shi key | |
say -v Cellos ka sa sa ghee what a sell hash knee oak shi mo no shi ro ki o mi reh bar yo fu kae ni kae roo |
class Test { | |
static function main() { | |
trace("Haxe is great!"); | |
var nya : Foo = new Foo(function (x : String) : Void { | |
trace(x); | |
// btw | |
nya; | |
}); | |
nya.say(); | |
} |
/* | |
* Reference: | |
* http://wasabiz.hatenablog.com/entry/20110118/1295335821 | |
* http://code.activestate.com/recipes/496691/ | |
*/ | |
function TailRecursive(func) { | |
this.func = func; | |
this.isFirstCall = true; | |
this.continueKey = {}; |
みんなだいすきラムダ式.
function Lambda(argName, body) {
this.argName = argName;
this.body = body;
}
Lambda.prototype.eval = function (env) {
var argName = this.argName;