At risk of being a bother:
- The
@puredocumentation focus on the problem of having generic functions being used inside the pure function (it does not mention that the pure function itself cannot be extended as you pointed out, for example). As generic methods are often used inside the pure function inBasewhich is the rationale used?- If the type of the arguments to the inner generic function is always the same, is it ok? (Additionally, the inner generic function has to follow the same
===rule you presented for the@purefunction?) - The inner generic function must not be extended at all (after the use in
@pure) risking undefined behaviour otherwise, or it can be extended for anything that will not change which is the selected method in the context of the@purefunction? - The problem is just that the inferred selected method will be fixed in the context of the outer
@purefunction (i.e., dynamic dispatch will not be dynamic anymore) and, if such staticity is desired, the inner generic function may be extended without causing any crashes? (i.e., the@purefunction will just display what would be the “wrong” result for the dynamic dispatch paradigm but otherwise no crashes?)
- If the type of the arguments to the inner generic function is always the same, is it ok? (Additionally, the inner generic function has to follow the same
- Can I just take these list items you pointed here and make a PR to Julia documentation? So next time this question appears we can just point to the docs?