Sorry for off-topic! (if somebody has rights then please cut it into another one)
I meant that understanding macro means understanding code to which it is expanded.
macro goto(name::Symbol) return esc(Expr(:symbolicgoto, name)) end julia> @macroexpand @goto a :($(Expr(:symbolicgoto, :a)))
I mean that there is not “standard” syntax for
goto in Julia language and
@goto macro is expanded into something I am not able to understand in this moment. I just feel that it is similar to something like this:
# ! mighty lisp please translate this comment as label A if repeat # ! mighty lisp please translate this comment as go to label A end
BTW how to write equivalent code with these macros expanded?
julia> @macroexpand @label A :($(Expr(:symboliclabel, :A))) julia> begin i = 1 :($(Expr(:symboliclabel, :A))) # this doesn't work i += 1 if i<10 :($(Expr(:symbolicgoto, :a))) # this doesn't work end end