diff options
author | alon@honor <none@none> | 2010-08-30 20:03:47 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-08-30 20:03:47 -0700 |
commit | 100294df68fd63c1a80b81264cb98d772e7e09fc (patch) | |
tree | 0ba564d48cbde5e74d3ab1653bcaabbb3d2ee8c8 /src | |
parent | fdf699d366187c91ffe3471a5f508e24bea22190 (diff) |
enzymatic2 tweaks
Diffstat (limited to 'src')
-rw-r--r-- | src/enzymatic2.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/enzymatic2.js b/src/enzymatic2.js index 25d98088..fb929d25 100644 --- a/src/enzymatic2.js +++ b/src/enzymatic2.js @@ -2,12 +2,13 @@ * A 2nd implementation of an 'enzymatic programming' paradigm. */ -Zyme2 = function(reqs) { +Zyme2 = function(reqs, func) { //! List of items that we want. Each element in this list is //! a list of features, we want elements that have them all. //! We will only call this Zyme if we find *all* of the items //! it wants. this.reqs = reqs; + this.process = func; }; Substrate2 = function(name_) { @@ -90,7 +91,7 @@ Substrate2.prototype = { processAction: function(zyme, items) { items.forEach(this.removeItem, this); - var splat = splitter(zyme.process(items), function(item) { + var splat = splitter(items.length > 1 ? zyme.process(items) : zyme.process(items[0]), function(item) { return item.__result__ || item.__finalResult__; }); splat.leftIn.forEach(this.addItem, this); |