summaryrefslogtreecommitdiff
path: root/threads.js
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-10-08 16:59:55 +0200
committerjmoenig <jens@moenig.org>2013-10-08 16:59:55 +0200
commit4d5dad807b629486aa0c4cbe5725a5bc1a61487d (patch)
treeb0067238b5a3bdc7bda9f7a6614424482ef1d459 /threads.js
parent39ea1d542d72194b887efd57e2ccde7174b9d17c (diff)
downloadsnap-yow-4d5dad807b629486aa0c4cbe5725a5bc1a61487d.tar.gz
snap-yow-4d5dad807b629486aa0c4cbe5725a5bc1a61487d.zip
experimental MAP primitive reporter
in lists category, visible in dev mode for now
Diffstat (limited to 'threads.js')
-rw-r--r--threads.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/threads.js b/threads.js
index a705f28..ee28e59 100644
--- a/threads.js
+++ b/threads.js
@@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/
// Global stuff ////////////////////////////////////////////////////////
-modules.threads = '2013-October-04';
+modules.threads = '2013-October-08';
var ThreadManager;
var Process;
@@ -778,7 +778,7 @@ Process.prototype.evaluate = function (
runnable.isImplicitLambda = context.isImplicitLambda;
runnable.isCustomBlock = false;
- // assing parameters if any were passed
+ // assign parameters if any were passed
if (parms.length > 0) {
// assign formal parameters
@@ -1515,6 +1515,18 @@ Process.prototype.doWaitUntil = function (goalCondition) {
this.pushContext();
};
+Process.prototype.reportMap = function (reporter, list) {
+ if (this.context.inputs.length - 2 === list.length()) {
+ this.returnValueToParentContext(
+ new List(this.context.inputs.slice(2))
+ );
+ return;
+ }
+ var next = list.at(this.context.inputs.length - 1);
+ this.pushContext();
+ this.evaluate(reporter, new List([next]));
+};
+
// Process interpolated primitives
Process.prototype.doWait = function (secs) {