Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ken committed Aug 1, 2015
1 parent 4431e66 commit c4b2ae6
Show file tree
Hide file tree
Showing 46 changed files with 1,221 additions and 26 deletions.
31 changes: 31 additions & 0 deletions js/.module-cache/02cbb5f37ec4140bcebe73e497e2c73602f8e931.js
@@ -0,0 +1,31 @@
'use strict';

var ___ = require('./worldtimestream.js');

___.world = ___(function(t) {

var ___a = ___();
var ___b = ___();

___.world = ___a.compute(function() {
___.world = ___.log(t(), 'a', ___a.t());

});
___.world = ___b.compute(function() {
___.world = ___.log(t(), 'b', ___b.t());
});

___.world = ___a.compute(function(x) {
___.world = ___b.appear(x * 5);
});

___.world = ___a.appear(0);
var f = function() {
___.world = ___a.appear(___a.t() + 1);

};

t.computeInterval(f, 1000);
//var timer = setInterval(f, 1000);
//
});
33 changes: 33 additions & 0 deletions js/.module-cache/04947c009533785a3723e8e87793ed703ae64a0d.js
@@ -0,0 +1,33 @@
'use strict';

var ___ = require('./worldtimestream.js');

___.world = ___(function(t) {

var ___a = ___();
var ___b = ___();

___.world = ___a.compute(function() {
___.world = ___.log(t(), 'a', ___a.t());

});
___.world = ___b.compute(function() {
___.world = ___.log(t(), 'b', ___b.t());
});

___.world = ___a.compute(function(x) {
___.world = ___b.appear(x * 5);
});

var f0 = function() {
___.world = ___.log('test start');
___.world = ___a.appear(0);
};
var f = function() {
___.world = ___a.appear(___a.t() + 1);
};

___.world = t.computeTimeout(f0, 0);
___.world = t.computeInterval(f, 1000);

});
128 changes: 128 additions & 0 deletions js/.module-cache/116f04ab4c659f8145629abd003f9ec7869b295b.js
@@ -0,0 +1,128 @@
(function() {
'use strict';

var extendMethod = function(object, methodName, method) {
if (typeof Object.defineProperty !== 'function') {
object[methodName] = method;
} else {
Object.defineProperty(object, methodName, {
configurable: false,
enumerable: false,
value: method
});
}
};

extendMethod(Object.prototype, 'argumentNames', function() {
var names = this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1]
.replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g, '')
.replace(/\s+/g, '').split(',');
return names.length === 1 && !names[0] ? [] : names;
});

var dynamicKey;
var instance = false;

var worldtimestream = function(cbF) {
if (typeof cbF === "function") {
return function() {
if (instance === false) {
dynamicKey = cbF.argumentNames()[0];
if (typeof dynamicKey === "undefined") {
dynamicKey = 't'; //fallback you must use t()
}

var o = Date.now;
o.computeInterval = function() {
var arg = arguments;
var f = function() {
console.info.apply(console, arg);
};
return f;
};
o.computeTimeout = function() {
var arg = arguments;
var f = function() {
console.info.apply(console, arg);
};
return f;
};

cbF(o);
instance = true;
} else {
throw "ERROR: This code runs in your single universe.";
}
};
} else {
var computingF = [];

var value = {};
var state;

Object.defineProperties(value,
{
val: //value.val
{
get:function() {
return state;
},
set:function(x) {
state = x;
computingF.map(
function(f) {
f(x);
});
return;
}
}
});

var o = {
compute:function(f) {
var f1 = function() {
computingF[computingF.length] = f; //push f
};
return f1;
},
appear:function(a) {
var f1 = function() {
value.val = a;
};
return f1;
}
};
o[dynamicKey] = function() {
return value.val;
};

return o;
}
};

Object.defineProperties(worldtimestream,
{
world: //our physical world
{
set:function(f) {
f();
}
}
});

worldtimestream.log = function() {
var arg = arguments;
var f = function() {
console.info.apply(console, arg);
};
return f;
};

var root = this;
if (typeof module !== 'undefined' && module.exports) {
module.exports = worldtimestream;
} else {
root.___ = worldtimestream;
}

}.bind(this))();
34 changes: 34 additions & 0 deletions js/.module-cache/199580447f880de7becbe78b8d0af69a47f0b7e2.js
@@ -0,0 +1,34 @@
'use strict';

var ___ = require('./worldtimestream.js');

___.world = ___(function(t) {

var ___a = ___();
var ___b = ___();

___.world = ___a.compute(function() {
___.world = ___.log(t(), 'a', ___a.t());

});
___.world = ___b.compute(function() {
___.world = ___.log(t(), 'b', ___b.t());
});

___.world = ___a.compute(function(x) {
___.world = ___b.appear(x * 5);
});

var f0 = function() {
___.world = ___.log('test start');
___.world = ___a.appear(0);
};
___.world = t.computeTimeout(f0, 0);

var f = function() {
___.world = ___a.appear(___a.t() + 1);

};
___.world = t.computeInterval(f, 1000);

});
31 changes: 31 additions & 0 deletions js/.module-cache/4c7dc2c1a2b146c5b78c81c71d7c7293150afbaf.js
@@ -0,0 +1,31 @@
'use strict';

var ___ = require('./worldtimestream.js');

___.world = ___(function(t) {

var ___a = ___();
var ___b = ___();

___.world = ___a.compute(function() {
___.world = ___.log(t(), 'a', ___a.t());

});
___.world = ___b.compute(function() {
___.world = ___.log(t(), 'b', ___b.t());
});

___.world = ___a.compute(function(x) {
___.world = ___b.appear(x * 6);
});

___.world = ___a.appear(0);
var f = function() {
___.world = ___a.appear(___a.t() + 1);

};

t.computeInterval(f, 1000);
//var timer = setInterval(f, 1000);
//
});
36 changes: 36 additions & 0 deletions js/.module-cache/4ec2704ad4193294bf10d937f201e6c48921ce91.js
@@ -0,0 +1,36 @@
'use strict';

var ___ = require('./worldtimestream.js');

___.world = ___(function(t) {

var ___a = ___();
var ___b = ___();

___.world = ___a.compute(function() {
___.world = ___.log(t(), 'a', ___a.t());

});
___.world = ___b.compute(function() {
___.world = ___.log(t(), 'b', ___b.t());
});

___.world = ___a.compute(function(x) {
___.world = ___b.appear(x * 5);
});



var f0 = function() {
___.world = ___.log('test start');

___.world = ___a.appear(0);
var f = function() {
___.world = ___a.appear(___a.t() + 1);

};
};
___.world = t.computeTimeout(f0, 0);
___.world = t.computeInterval(f, 1000);

});
35 changes: 35 additions & 0 deletions js/.module-cache/82fff7c6cc4938b42655458c4592b79404b3b23d.js
@@ -0,0 +1,35 @@
'use strict';

var ___ = require('./worldtimestream.js');

___.world = ___(function(t) {

var ___a = ___();
var ___b = ___();

___.world = ___a.compute(function() {
___.world = ___.log(t(), 'a', ___a.t());

});
___.world = ___b.compute(function() {
___.world = ___.log(t(), 'b', ___b.t());
});

___.world = ___a.compute(function(x) {
___.world = ___b.appear(x * 5);
});

var f0 = function() {
___.world = ___.log('test start');

___.world = ___a.appear(0);
var f = function() {
___.world = ___a.appear(___a.t() + 1);

___.world = t.computeInterval(f, 1000);

};
};
___.world = t.computeTimeout(f0, 0);

});
35 changes: 35 additions & 0 deletions js/.module-cache/841937a060a9544d503d9bcf5d0fa091c6fb00ac.js
@@ -0,0 +1,35 @@
'use strict';

var ___ = require('./worldtimestream.js');

___.world = ___(function(t) {

var ___a = ___();
var ___b = ___();

___.world = ___a.compute(function() {
___.world = ___.log(t(), 'a', ___a.t());

});
___.world = ___b.compute(function() {
___.world = ___.log(t(), 'b', ___b.t());
});

___.world = ___a.compute(function(x) {
___.world = ___b.appear(x * 5);
});


var f0 = function() {
___.world = ___.log('test start');

___.world = ___a.appear(0);
var f = function() {
___.world = ___a.appear(___a.t() + 1);

};
};
___.world = t.computeTimeout(f0, 0);
___.world = t.computeInterval(f, 1000);

});

1 comment on commit c4b2ae6

@girls-ping-girls
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

Please sign in to comment.