Tutorial by Examples

String macros are syntactic sugar for certain macro invocations. The parser expands syntax like mymacro"my string" into @mymacro_str "my string" which then, like any other macro call, gets substituted with whatever expression the @mymacro_str macro returns. Base Julia com...
Julia Symbol literals must be legal identifiers. This works: julia> :cat :cat But this does not: julia> :2cat ERROR: MethodError: no method matching *(::Int64, ::Base.#cat) Closest candidates are: *(::Any, ::Any, ::Any, ::Any...) at operators.jl:288 *{T<:Union{Int128,Int16,Int...
String macros do not come with built-in interpolation facilities. However, it is possible to manually implement this functionality. Note that it is not possible to embed without escaping string literals that have the same delimiter as the surrounding string macro; that is, although ""&quot...
0.6.0-dev In Julia v0.6 and later, command macros are supported in addition to regular string macros. A command macro invocation like mymacro`xyz` gets parsed as the macro call @mymacro_cmd "xyz" Note that this is similar to string macros, except with _cmd instead of _str. We typ...

Page 1 of 1