Qiyamah
November 6, 2019, 11:42pm
#1
Hi,
Here,https://docs.julialang.org/en/v1/manual/metaprogramming/#Generated-functions-1 ,
it says " generated function cannot call any method that was not defined prior to the definition of the generated function itself."
Is there a way to go beyond this? like including the later defined methods in the dispatch without using them in the generated expression.
Is this related to world age problem? And if so why Base.invokelast doesn’t work.
Thanks
Mason
November 6, 2019, 11:52pm
#2
This package: https://github.com/NHDaly/StagedFunctions.jl is trying to get around that restriction.
1 Like
Qiyamah
November 6, 2019, 11:57pm
#3
How is it trying to that? Do you know, GitHub page doesn’t have much info.
Thanks
jameson
November 12, 2019, 5:13am
#4
You write an abstract interpreter that itself is pure, but can return an total description of both the result and the methods needed to derive it.
Qiyamah
November 12, 2019, 5:44am
#5
so basically, what if I apply Core._apply_pure , it should solve my problem? Huh?
jameson
November 12, 2019, 6:08am
#6
That can never be right as that function isn’t valid to use (outside of the compiler itself), but I can’t speak to the quality of any particular implementation. I’m just saying what you would need to implement.
1 Like