docs: function applyStack(chain, stack) {
  			// console.log("apply stack ", stack)
  			var stacki = stack[0],
  				i = 0,
  				tmp,
  				topSheets = [];
  			while (stacki) {
  				tmp = [];
  				while (stacki && !stacki._deep_sheet_ && typeof stacki !== 'function') {
  					if (stacki._transformations)
  						topSheets = topSheets.concat(stacki._transformations);
  					tmp.unshift(stacki);
  					stacki = stack[++i];
  				}
  				if (tmp.length > 0) {
  					chain.done(function(entry) {
  						// console.log("apply stack will apply non sheets", tmp, " on ", entry.path, entry.value)
  						entry.value = compiler.upFromArgs(entry.value, tmp, {
  							excludeGrounds: true
  						});
  						return entry;
  					});
  				}
  				if (!stacki)
  					break;
  				var sheets = [];
  				while (stacki && (stacki._deep_sheet_ || typeof stacki === 'function')) {
  					sheets.push(stacki);
  					stacki = stack[++i];
  				}
  				chain.done(function(entry) {
  					var s = entry.value;
  					if (!s || !sheets.length)
  						return entry;
  					this.done(function(res) {
  						if (res)
  							if (res._deep_query_node_)
  								entry.value = res.value;
  							else
  								entry.value = res;
  						return entry;
  					})
  					sheets.unshift(entry);
  					return nodes.sheet.apply(nodes, sheets);
  				});
  				//.log("flatten applyStack done")
  			}
  			return topSheets;
  		}