var $p, $ps, $pif, $ploop, $pswitch;

function chain(){
  var a = this.modify(
    this.proces( $p( $.get('/a') )),
    $p( $.get('/b') ));
  console.log(a);
}

function chainResult(){
  var a = null;
  $ps(this,function(p){
    p.add($.get('/a'));
    p.add($.get('/b'));
  })
  .then(function(p,r1,r2){
    a = this.modify(this.process(r1), r2);
    console.log(a);
  });
}
@@ -28,18 +28,33 @@
 $pswitch
+, promiseResult
 ;%0A
-
 %0Afunctio
@@ -215,17 +215,64 @@
 ;%0A  
-$ps(this,
+return promiseResult(this,%5B%0A    %7B %0A      push:%5B%0A        
 func
@@ -280,22 +280,28 @@
 ion(
-p
 )%7B%0A    
+  
-p.add(
+    return 
 $.ge
@@ -311,21 +311,49 @@
 /a')
-)
 ;%0A    
-p.add(
+    %7D,function()%7B%0A          return 
 $.ge
@@ -363,24 +363,39 @@
 /b')
-)
 ;%0A  
-%7D)%0A  .then(
+      %7D%0A      %5D%0A    %7D,%0A    
 func
@@ -403,18 +403,16 @@
 ion(
-p,
 r1,r2)%7B%0A
     
@@ -407,16 +407,18 @@
 r1,r2)%7B%0A
+  
     a = 
@@ -448,20 +448,21 @@
 s(r1
-), 
+,
 r2)
+)
 ;%0A    
+ 
+ 
 cons
@@ -475,13 +475,588 @@
 g(a);%0A  
-%7D
+  %7D%0A  %5D);%0A%7D%0A%0Afunction complexChain()%7B%0A  var a = this.modify(%0A      this.process( $.get('/a') ? $.get('/b') : $.get('/c') )%0A    );%0A%7D%0A%0Afunction complexChainResult()%7B%0A  var a;%0A  return promiseResult(this,%5B%0A    %7B%0A      push: %7B%0A        %22if%22: %7B%0A          async: function()%7B%0A            return $.get('/a');%0A          %7D%0A        %7D,%0A        %22then%22: %7B%0A          async: function()%7B%0A            return $.get('/b');%0A          %7D%0A        %7D,%0A        %22else%22: function()%7B%0A          return $.get('/c');%0A        %7D%0A      %7D%0A    %7D,%0A    function(r1)%7B%0A      a = this.modify(this.process(r1));%0A    %7D%0A  %5D
 );%0A%7D

work in progress