You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently symbol literals in patterns don't really count as literals, but rather as a binding inside a QuoteNode, which could be a gotcha. e.g.
@macromethodm(:sym1) 0@macromethodm(:sym2) 1# Intended: Different methods for specific symbols.@m(:sym1) ==0@m(:sym2) ==1# Actual: Both are the same method, so second overwrites first.@m(:sym1) ==1@m(:sym2) ==1# Since@macromethodmtruth(:x) [x]
@mtruth(:a) == [:a]
# You have to:@macromethodm1(:L{:sym1}) 0@macromethodm1(:L{:sym2}) 1# or:@macromethodm2(:E{:(:sym1)}) 0@macromethodm2(:E{:(:sym2)}) 1@m1(:sym1) ==@m2(:sym1) ==0@m1(:sym2) ==@m2(:sym2) ==1
This behaviour may be useful for capturing whole nested expressions (@mtruth(:(x+y)) == [:(x+y)]) and changing it would make it inconsistent with capturing with nested expressions (@letds :(x+y) = :(:(1+2)) (x,y)), but I don't know if these cases are common enough to keep this. Hmm.... Oh well, at least if Julia's 12139 happens this won't be a problem anymore!
I am gonna keep this one around until I do an overall update for Julia 0.5, but if you're a lost soul that somehow came across this and has opinions about it, feel free to share them!
The text was updated successfully, but these errors were encountered:
Wait, both this and #5 are breaking, aren't they? Then I need to do a major version for them.. Darn it, there goes my plan of syncing the package with the julia version! I thought myself so clever, but in the end hubris has caused my downfall* :(
Currently symbol literals in patterns don't really count as literals, but rather as a binding inside a
QuoteNode
, which could be a gotcha. e.g.This behaviour may be useful for capturing whole nested expressions (
@mtruth(:(x+y)) == [:(x+y)]
) and changing it would make it inconsistent with capturing with nested expressions (@letds :(x+y) = :(:(1+2)) (x,y)
), but I don't know if these cases are common enough to keep this. Hmm.... Oh well, at least if Julia's 12139 happens this won't be a problem anymore!I am gonna keep this one around until I do an overall update for Julia 0.5, but if you're a lost soul that somehow came across this and has opinions about it, feel free to share them!
The text was updated successfully, but these errors were encountered: