Dear all,
I a trying to add dynamic documentation to fields of a “dictionary-like” type in GAP.jl, namely the type
struct GlobalsType
funcs::Dict{Symbol,Cuint}
end
There is only one global instance of this type, namely GAP.Globals
, and its getproperty
function is overloaded to return objects of a single type, namely MPtr
.
I am now trying to add dynamic documentation to those MPtr
objects by adding
Docs.getdoc(x::MPtr) = GAP_help( gap_to_julia( String, Globals.NameFunction( x ) ) )
The function returns the right string. However, if I try to do
help?> GAP.Globals.SymmetricGroup
I get the following error
help?> GAP.Globals.SymmetricGroup
ERROR: MethodError: no method matching Base.Docs.Binding(::GAP.GlobalsType, ::Symbol)
Closest candidates are:
Base.Docs.Binding(::Module, ::Symbol) at docs/bindings.jl:12
Theoretically, the function getdoc
would return the right documentation string, if it is called on GAP.Globals.SymmetricGroup
However, I think the error is due to the fact that Globals
is not a module. Since GAP changes its global names at runtime, I cannot make Globals
a module, as I have to ask GAP if the object exist.
Is there a way to dynamically add documentations for such field entries?
Best, and thanks a lot,
Sebastian