Open
Description
IIRC the way Mixtape is currently doing overlays breaks with dynamic function calls, and thus is not dynamically correct.
- Case function passed as arguemt
f(func, args...) = func(args...)
- Case function not inferrable
function f(x)
g = rand() < 0.5 ? sin : cos
g(x)
end
The way to fix this (I realized this morning) is to replace all f(args...)
with lookup_in_ctx(Ctx, f)(args...)
and then writing an inference rule that turns lookup_in_ctx(Ctx, f)
into the result of the overlay table. Ctx
should be the type and you shan't be allowed to make runtime decisions.
Metadata
Metadata
Assignees
Labels
No labels