On 08/05/2015 16:24, Marvin Humphrey wrote:
We use the Clownfish parcel to determine how types should be namespaced.
When the parcel is clownfish, String is spelled `String`. When the parcel is
lucy, String is spelled `clownfish.String`.
That's why `S_lazy_init_sig` needs to know the parcel of a method. In the
commit I mentioned, I removed the `parcel` field from `CFCSymbol` and
`S_lazy_init_sig` can't call `CFCMethod_get_parcel` anymore. That's why I
added the `invoker` parameter, so `S_lazy_init_sig` can call
`CFCClass_get_parcel` on the invoker class instead.
There are two things that are weird about the patch.
1. The sig is cached, but should arguably change based on the `invoker`
because that affects namespacing of types.
2. However, we'll only need the sig once: when the method is first declared.
And when that happens, the parcel of the CFCMethod will be exactly the
same as the parcel of the CFCClass invoker.
So, I would argue that `CFCGoMethod_get_sig` does not need to be passed an
`invoker`. Instead, its documentation should be clarified:
/** Retrieve the Go interface method signature. Types will be namespaced
* to the parcel in which the method is declared.
*/
Does that make sense?
Yes, but `CFCGoMethod_get_sig` needs to know the current parcel. We could pass
the parcel directly but I opted to pass the current class which also knows
about the parcel.
Nick