diff --git a/Promise.js b/Promise.js index c23837f..6f7240d 100644 --- a/Promise.js +++ b/Promise.js @@ -35,10 +35,53 @@ var generator = require('./generator') //--------------------------------------------------------------------- -// XXX EXPERIMENTING... // packed format API... // +// This is separate from IterablePromise to enable low-level testing and +// experimentation. +// +// Packed format +// [ +// , +// +// [ +// , +// +// )>, +// +// .. +// ], +// +// )>, +// +// , .. ] )>, +// +// .. +// ] +// +// ::= +// +// | +// | )> +// | )> +// +// ::= +// [ , .. ] +// +// ::= +// +// | [ , .. ] +// | )> +// | , .. ] )> +// +// ::= +// +// | )> +// +// +// +// XXX revise bnf... // XXX should this be a container or just a set of function??? // ...for simplicity I'll keep it a stateless set of functions for // now, to avoid yet another layer of indirection -- IterablePromise... @@ -50,19 +93,6 @@ module.packed = // pack() // -> // - // ::= - // - // | - // - // ::= - // [ - // - // | - array - // | - // | , - // ... - // ] - // // NOTE: when all promises are expanded the packed array can be unpacked // by simply calling .flat() // NOTE: if 'types/Array' is imported this will support throwing STOP @@ -73,8 +103,6 @@ module.packed = // stop will stop the handlers not yet run and not the next // handlers in sequence. // - // XXX see if we should self-expand promises... - // XXX migrate these back into InteractivePromise... // XXX does this need onerror(..) ??? pack: function(list){ var that = this @@ -114,9 +142,6 @@ module.packed = // handle(, [, ]) // -> // - // XXX revise nested promise handling... - // ...something like simplify() -> ??? - // XXX STOP_PROMISED_HANDLERS -- TEST handle: function(packed, handler, onerror){ var that = this var handlers = [...arguments].slice(1) @@ -230,6 +255,8 @@ module.packed = } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // // itemResolved(, [, ]) // itemResolved(, )