[<<][meta][>>][..]
Sat Jan 26 23:34:47 CET 2013

Loops

The only reason I need structured types is to abstract loops.  For
now, the `in' operator infers to a (S t) type, and produces a `p_car'
primitive in the output.

The p_car : (S t) -> t should now be generalized to any type of fold
operation.

Maybe the `for/fold' form is a good place to start.

(for/fold ((x (in xs)))

EDIT: The thing is, loops should probably be propagated to the
evaluator/compiler, so it can do what it needs to do.  The trouble is
that it introduces another hinge point..  How to make sure it doesn't
interfere with the rest?

To keep the concept clean, the best thing to do seems to be to not
expose recursion directly (i.e. use combinators).  This needs `map'
and `reduce'.

`reduce' is more useful (convolution, summing mixer, ...) so let's try
that first in the same "algebraic inspired" way I've been working
before, i.e. to try to identify how one component should work and then
to connect the dots.

Wow, that's starting out with a bad idea.  What is necessary is a
primitive way to do recursion, i.e. named let.  That would probably
lead to the simplest solution.

Nope. The simplest thing is that which is already used: a state
machine driver.  Something that takes a SISO system and iterates it
over an abstract data type.  This way the C mainloop can also be
abstracted in Scheme syntax.
  
[1] http://docs.racket-lang.org/guide/for.html#(part._for/fold)



[Reply][About]
[<<][meta][>>][..]