Looks like @lazymod turns the module load into a function call (in lowercase), so you need to do:
if dodraw gadfly().plot(...) gadfly().plot(...) ... where the first gadfly() call will load Gadfly and be slow, while the others will be fast. I suppose you could turn that into if dodraw gf = gadfly() gf.plot(...) ... to make it a little nicer. On Wednesday, 5 August 2015 23:53:30 UTC+1, Felipe Jiménez wrote: > > Thank you, Isaiah. > > Then I understand what I want is the "lazymode" feature, so if I do > > using Requires > @lazymod Gadfly > > then Gadfly will not be loaded until the first time it is needed. > > However, for "Requires" to know when it is needed, do I need to qualify > with prefix "Gadfly." all my calls to Gadfly functions? I.e. write my code > above as: > > function fwhm(xk, yk; dodraw::Bool=false) > # ... > > if dodraw > Gadfly.plot(x=xk, y=yk) > Gadfly.plot(x=x1,y=y1) > Gadfly.plot(x=x2,y=y2) # etc. > end > > # ... > end > > Thank you again. >