Tacking this at the end of your startup.jl gives an error:

function counter()
  n = 0
  @fn () -> n += 1
end

ERROR: no method start(Expr,)
 in include at boot.jl:238
 in include_from_node1 at loading.jl:114
 in process_options at client.jl:303
 in _start at client.jl:389
at /Users/pygy/tmp/startup.jl:98


On Tuesday, January 7, 2014 3:16:11 PM UTC+1, Mike Innes wrote:
>
> Anonymous functions in Julia currently have a lot of overhead. However, 
> I've come up with a temporary solution to this by writing a little macro 
> which speeds up anonymous function calls - all you have to do is wrap your 
> functions in @fn and they'll speed up, e.g.
>
> x -> x^2
>
> becomes 
>
> @fn x -> x^2
>
> or
>
> @fn function(x)
>   x^2
> end
>
> A quick benchmark shows that calling this wrapped function is about 15x 
> faster. The macro defined at line 74 of this gist, along with some other 
> useful utils:
>
> https://gist.github.com/one-more-minute/8299575
>
> Enjoy!
>

Reply via email to