Hello,

In this SO question 
http://stackoverflow.com/questions/36191766/metaprogramming-within-docstring-with-eval/36209841#36209841

the following code

for (f, name) in ((:add, "addition"), (:sub, "subtraction"))
    @eval begin
        @doc """
        This is the function $($name)
        """
        function $f()
            ## FUNCTION BODY
        end
    end
end


works with Julia 0.4 but raises ERROR: LoadError: Invalid @var syntax 'This 
is the function '
with Julia 0.5

I noticed that it can be fixed for Julia 0.5 adding ->


for (f, name) in ((:add, "addition"), (:sub, "subtraction"))
    @eval begin
        @doc """
        This is the function $($name)
        """ ->
        function $f()
            ## FUNCTION BODY
        end
    end
end


What is exactly the goal of -> with @doc macro ?

Why is it necessary with Julia 0.5 and not with Julia 0.4 ?


Kind regards

Reply via email to