//function calling object library experiment
//functions in an object liberal call eachother internally
var funcs = {
"+":function(node){
console.log("Calling function +");
return this["-"](node.name);
},
"-":function(node){
console.log("Calling function -");
return this["*"](node);
},
"*":function(string){
console.log("Calling function *");
return string.slice(0, 2);
}
};
/* var b = {name:"food"}
=> undefined
funcs["+"](b)
Calling function +
Calling function -
Calling function *
=> 'fo'*/