[racket] filtering syntax
On Jan 13, 2012, at 8:40 AM, Marijn wrote:
> My question is how one determines the
> dependencies from the above code. The result for the above would be
> something like:
>
> ((a)
> (b a)
> (c a b)
> (d c))
If model allows arbitrary Racket code on the right-hand side, you locally expand them into core, compute the free variables with a simple recursive pass over core syntax, and compute dependencies from there. The latter is approximate, however. If you allow
(model ([a] [b (lambda () a)] [c (+ a 2)]))
b is much less dependent on a than c. Indeed, it would be mistaken to deref a before you apply the function bound to b.
;; ---
If model allows a small language of expressions on the right-hand side, proceed as above but the specs should be clearer.
-- Matthias