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
It would be great if @match worked with enums from EnumX and other similar namespaced items.
@match
julia> using EnumX, MLStyle julia> @enumx Fruit APPLE BANANA PEAR julia> fruit = Fruit.APPLE Fruit.APPLE = 0 julia> @match fruit begin Fruit.APPLE => 0 Fruit.BANANA => 1 Fruit.PEAR => 2 end ERROR: LoadError: PatternCompilationError(:(#= REPL[4]:2 =#), ErrorException("unknown pattern syntax :(Fruit.APPLE)")) Stacktrace: [1] gen_match(val::Symbol, tbl::Expr, __source__::LineNumberNode, __module__::Module) @ MLStyle.MatchImpl ~/.julia/packages/MLStyle/SLOsr/src/MatchImpl.jl:712 [2] var"@match"(__source__::LineNumberNode, __module__::Module, val::Any, tbl::Any) @ MLStyle.MatchImpl ~/.julia/packages/MLStyle/SLOsr/src/MatchImpl.jl:667 in expression starting at REPL[4]:1 caused by: unknown pattern syntax :(Fruit.APPLE) Stacktrace: [1] error(s::String) @ Base ./error.jl:35 [2] ex2tf(m::Module, ex::Expr) @ MLStyle.MatchImpl ~/.julia/packages/MLStyle/SLOsr/src/MatchImpl.jl:351 [3] gen_match(val::Symbol, tbl::Expr, __source__::LineNumberNode, __module__::Module) @ MLStyle.MatchImpl ~/.julia/packages/MLStyle/SLOsr/src/MatchImpl.jl:710 [4] var"@match"(__source__::LineNumberNode, __module__::Module, val::Any, tbl::Any) @ MLStyle.MatchImpl ~/.julia/packages/MLStyle/SLOsr/src/MatchImpl.jl:667
The text was updated successfully, but these errors were encountered:
Possibly if the case is head: Symbol ., could we just evaluate directly?
head: Symbol .
Sorry, something went wrong.
This is due to the issue discussed at #156
No branches or pull requests
It would be great if
@match
worked with enums from EnumX and other similar namespaced items.The text was updated successfully, but these errors were encountered: