On Wednesday, March 1, 2017 at 7:17:42 AM UTC+1, Ian Lance Taylor wrote: > > On Tue, Feb 28, 2017 at 12:44 PM, Basile Starynkevitch > <[email protected] <javascript:>> wrote: > > Can the packages defined in one plugin be visible from plugins loaded > > afterwards? I'm thinking of a dlopen with RTLD_GLOBAL flag in C > parlance. > > I'm not sure this really makes sense in a Go context. I'm not sure > how you would refer to those symbols. >
The scenario would be the following: a plugin *P1* defines the P1_foo () function. *P1* is loaded (and I would like the name to be visible afterwards, see below). We can assume that the loading program & process does not have any P1_foo in it. later, *another* plugin *P2* defines the P2_bar() function which calls P1_foo(), and I would like that to mean the P1_foo() function inside *P1*. It seems that this is not possible currently. (of course loading *P2* before loading *P1* should fail). I don't understand why would that not make any sense. Of course, once could play dirty tricks (somehow equivalent to what the plugin ELF machinery does internally) like using function variables (that is closures) systematically, for example having the main program define a map from string to functions and register inside that map at init time of the plugin. Cheers. -- Basile Starynkevitch -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
