Skip to content

Support for dynamic method overlays #2

Open
@vchuravy

Description

@vchuravy

IIRC the way Mixtape is currently doing overlays breaks with dynamic function calls, and thus is not dynamically correct.

  1. Case function passed as arguemt
f(func, args...) = func(args...)
  1. 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
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions