Is there an efficient way to associate a value with a parameterized type.For exa

The following post of @benoitrichard gave the solution:
I think what you need is a generated function then

@generated function logtable(::Type{G}) where {p, r, G <: GaloisField{p, r}}
lg = _logtable(p, r) # The actual computation
return :($lg)
end

That way the actual logtable will be comptued only once per type

2 Likes