It is definitely possible. You just need to use toplevel, which is a magic that 
Jeff doesn't want people to know about.

 -- John

On Sep 5, 2014, at 12:52 PM, Ben Arthur <bjarthu...@gmail.com> wrote:

> sorry to resurrect this old post, but what is the definitive answer to 
> whether it's possible to "@eval export ..."    sure would be handy.
> 
> On Monday, December 3, 2012 1:04:27 PM UTC-5, Stefan Karpinski wrote:
> I'm not sure if this is possible (Jeff will have to answer that), but I would 
> say that explicitly writing "export a, b, c, d" seems like the way to go.
> 
> 
> On Mon, Dec 3, 2012 at 12:51 PM, Avik Sengupta <avik.s...@gmail.com> wrote:
> I was wondering how to export functions whose names are defined using an 
> eval. The following simplified code produces a "syntax error: invalid export 
> statement" . How can I fix that?  Without the @eval export.... , the 
> functions are properly defined and accessible via the namespace. 
> 
> module X; 
> using Base; 
>  for name in (:a,:b,:c,:d); 
>        @eval global $name
>        @eval function ($name)()
>                return true
>        end 
>       @eval export ($name)  
> end               
> end
> 
> -- 
>  
>  
> 

Reply via email to