Welcome! Please see the About page for a little more info on how this works.

0 votes
in core.logic by

Perhaps we can support simple function application in the following manner.

`
(defne substo [e new a out]
(['(var ~a) _ _ new])
(['(var ~y) _ _ '(var ~y)] (nom/hash a y))
(['(app ~rator ~rand) _ _ '(app ~rator-res ~rand-res)]

 (substo rator new a rator-res)
 (substo rand new a rand-res))

(['(lam ~(nom/tie c body)) _ _ '(lam ~(nom/tie c body-res))]

 (nom/hash c a) (nom/hash c new)
 (substo body new a body-res)))

`

If we have a seq in an unquote then we know we have an application. All function symbols are left alone, all arguments are considered to be fresh vars or locals.

1 Answer

0 votes
by
Reference: https://clojure.atlassian.net/browse/LOGIC-89 (reported by dnolen)
...