We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I stumbled upon this in 0.6.0 -- so maybe this has been changed in the mean time. Or maybe it's not weird at all, but it surprised me...
Basically, the following error came unexpectedly (I used it in actual syntax, the outer quoting is just for demonstration):
julia> :(simd ? :@simd : :@identity) ERROR: syntax: space not allowed after ":" used for quoting
This can be fixed by using
julia> :(simd ? :(@simd) : :@identity) :(if simd $(Expr(:quote, :(@simd))) else $(Expr(:quote, :(@identity))) end)
I compared some other things, and the first one of these is definitely weird, too, but explains the above error:
julia> :(:@simd + 2) :($(Expr(:quote, :(@simd +2)))) julia> :(:simd + 2) :(:simd + 2) julia> :(:(@simd) + 2) :($(Expr(:quote, :(@simd))) + 2)
It seems that the @ makes the parsing of the following elements greedier?
@
Julia Version 0.6.0 Commit 9036443 (2017-06-19 13:05 UTC) Platform Info: OS: Linux (x86_64-pc-linux-gnu) CPU: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz WORD_SIZE: 64 BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell) LAPACK: libopenblas64_ LIBM: libopenlibm LLVM: libLLVM-3.9.1 (ORCJIT, skylake)
The text was updated successfully, but these errors were encountered:
Your first statement is parsing as
(simd ? :(@simd : :@identity))
Which is why you need to specify the parens around :(@simd)
:(@simd)
Sorry, something went wrong.
No branches or pull requests
I stumbled upon this in 0.6.0 -- so maybe this has been changed in the mean time. Or maybe it's not weird at all, but it surprised me...
Basically, the following error came unexpectedly (I used it in actual syntax, the outer quoting is just for demonstration):
This can be fixed by using
I compared some other things, and the first one of these is definitely weird, too, but explains the above error:
It seems that the
@
makes the parsing of the following elements greedier?Julia Version 0.6.0
Commit 9036443 (2017-06-19 13:05 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.9.1 (ORCJIT, skylake)
The text was updated successfully, but these errors were encountered: