Suddenly thinking that I can actually just use type parameters but the type 
argument can also created lazily by being instantiations of parametred 
types..

Might actually be sufficient to have value scoped type instantiations.

On Sunday, June 18, 2023 at 1:38:33 PM UTC+2 atd...@gmail.com wrote:

> I have exposed the following problem in a bit more details here:
>
> https://gist.github.com/atdiar/6568964896231bfde734f6bddf9ff46c
>
> Basically, I need to modify the implementation of the method of a given 
> type depending on the encasing scope of the value its called on. (and not 
> just the value itself)
>
> the reason being that the value is a func type, not a struct type which I 
> could modify to add a reference to external scope/state.
>
>
> I could easily modify the implementation of the type if we had 
> generealized interfaces/ union types. That would solve it at compile time.
>
> But I would be happy just being able to assign a stable id to a func value 
> at runtime, as a non-pointer reference. (probably via a runtime pkg 
> function).
> I can do the latter now using fmt.Sprint on a function but there is no 
> guarantee of stability. It's simply that the GC is not a moving compactor 
> for instance which may allow it for now.
>
> Any idea?
>
> Can I fill an issue for the stableid idea or that's not somethign that's 
> actually possible?
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/a015a9a5-00fa-4d50-a457-6cca1b4369a6n%40googlegroups.com.

Reply via email to