Carp
Carp copied to clipboard
Crash when calling a stored function composition in global variable
To reproduce:
> (def g (comp Int.inc Int.inc))
> (g 10)
The problem here seems to be that the function should have its argument symbol replaced by the gensym value, but currently it doesn't.
(let [x (gensym)]
(list 'fn [x] (comp-internal x fns))))
instances of x should be replaced by gensym-foo
in the let body, but I think that's currently not happening.
Likely an evaluator regression from recent changes.
The bug does not happen here:
(defn g [x] ((comp Int.inc Int.inc) x))
So there's something with def
, it seems.