Bug or wrong usage of @static in 0.7RC2?


#1

The following code (part of ModiaMath.jl) fails on 0.7:

julia> @static if VERSION < v"0.7.0-DEV.2005"
             print(" \# ")
       else
             print(" # ")
       end
ERROR: syntax: invalid escape sequence

Any idea?


#2

This is not valid

"\#"

If you want to print the original, just use raw string

raw"\#"

It seems that in v0.6, \# just means #, didn’t figure out why this become invalid in v0.7.


#3

#4

Thanks!


#5

Just note a typo above. The r"\#" creates a regex expression. For a raw string, you need to enter raw"\#".


#6

Indeed, good catch.


#7

oops, thanks!