https://github.com/one-more-minute/Requires.jl

On Tue, Aug 4, 2015 at 1:26 PM, Felipe Jiménez <[email protected]>
wrote:

> I've written a function, fwhm, that goes fast without plotting anything
> (which is the usual usage).
> But if one optional argument is dodraw = true, it draws a figure to
> visualize its doings.
> To draw the figure it uses the package Gadfly. But "using Gadfly" takes
> time to execute (the first time), and most of the sessions it is not needed
> because by default dodraw = false.
> Since I cannot do "using Gadfly" inside a function, I cannot do something
> like this:
>
> function fwhm(xk, yk; dodraw::Bool=false)
>   # ...
>
>   if dodraw
>     using Gadfly
>     plot(x=xk, y=yk)  # etc.
>   end
>
>   # ...
> end
>
> I don't want to add overhead time to every session I use the module where
> fwhm is, because most of the times dodraw = false and I just need a fast
> result without figures.
> Any idea?
> Thank you in advance.
>

Reply via email to