efcasado / weaverl

Erlang meets AOP
MIT License
2 stars 2 forks source link

Ability to weave dynamic function calls #5

Open efcasado opened 10 years ago

efcasado commented 10 years ago

Dynamic function calls are function calls where the exact function to be executed is only known at run-time.

The following are some examples of dynamic function calls:

M:F("Hello, World!~n"),
apply(M, F, ["Hello, World!~n"]).

At run-time, M and F might be set to io and format, respectively.

efcasado commented 10 years ago

This will be implemented as a run-time check.

The generated code will be something similar to

case is_weaveable(M, F, A, Aspects) of
    true ->
        weave(M, F, ["Hello, World!~n"], Aspects);
    false ->
        M:F("Hello, World!~n")
end