lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It was thus said that the Great Soni L. once stated:
> On 13/06/16 01:30 AM, Sean Conner wrote:
> >It was thus said that the Great Soni L. once stated:
> >>Doesn't seem like this would work
> >>
> >>local soniex2 = reqpath"io.github.soniex2"
> >>local a = soniex2.a()
> >>local bpath = soniex2.b
> >>local c = bpath.c()
> >>local b = bpath()
> >>-- ??? what happens here?
> >   Did you try it?  What should happen there?
> Didn't try it, but based on the code, it should act like this:
> 
> local b = bpath()                          --> local b = t1() --> 
> require("io.github.soniex2") -- oops! should be "io.github.soniex2.b"

  Well, the code presented only covers the original question.  Two, I
wouldn't use this as I prefer *not* to be too clever in requiring modules.  

  In any case, you have some code that mostly works.  How would you fix it? 
What's the goal?  And is the implementation difficulties worth it?

  -spc