         }
     }
     
-    // should be future mixin
-    internal func complete(result:Try<T>) {
-        Queue.simpleFutures.sync {
-            if self.result != nil {
-                SimpleFuturesException.futureCompleted.raise()
-            }
-            self.result = result
-            for complete in self.saveCompletes {
-                complete(result)
-            }
-            self.saveCompletes.removeAll()
-        }
-    }
-    
     public func onComplete(complete:Try<T> -> Void) {
         self.onComplete(self.defaultExecutionContext, complete:complete)
     }

    
}

// ExecutionContext
public protocol ExecutionContext {
    
    func execute(task:Void->Void)
}

// QueueContext
public class QueueContext : ExecutionContext {
    
    public class var main : QueueContext {
        struct Static {
            static let instance = QueueContext(queue:Queue.main)
        }
        return Static.instance
    }
    
    public class var global: QueueContext {
        struct Static {
            static let instance : QueueContext = QueueContext(queue:Queue.global)
        }
        return Static.instance
    }
    
    let queue:Queue
    

}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// for comprehensions
public func forcomp<T,U>(f:Future<T>, g:Future<U>, #filter:(T,U) -> Bool, #apply:(T,U) -> Void) -> Void {
    return forcomp(f.defaultExecutionContext, f, g, filter:filter, apply:apply)
