Fri Feb 22 16:58:30 CET 2013

Output feedback

To make it fit in the current approach, the output feedback needs a
trick - some kind of lazy evaluation.  The semantics seems to have
this trick built-in..

Focus on
1. Having a processor object (leap of faith)
2. Iterating it over a stream

It needs to be opened up a little bit to make sure there is access to
the update method.  This can't be hidden..

So, the update fuction is exposed.  Now, is it possible to reuse the
node injection code for lazy streams? 

(define (make-feedback-prim make-state-nodes
  (lambda (sem state-names update in-nodes)
        ((nb-state  (length state-names))
         (si-nodes  (make-state-nodes state-names))
         (exprs     (values-list
                     (apply (ai-function-proc update)
                            (append si-nodes in-nodes))))
         (so-nodes  (take exprs nb-state))
         (out       (drop exprs nb-state)))
      (register-state-nodes! si-nodes so-nodes)
      (apply values out))))

No, the trouble is that we need multiple executions of the body code.
So this function should do the iteration and feedback.

Once the update part is exposed, it's not all that hard.  Just call it
in a loop.