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
I think it would make sense to parse ⟨ and ⟩ as valid bracket syntax, like we currently do {} and [] with its own AST representation (maybe Expr(:angle, ...)?), so that this can be used inside macros for DSLs. The reason, I was initially a bit hesitant about just treating these as brackets is that I thought it would be very cool to support bras and kets as syntax on their own. But with | already being a very common infix operator, I wasn't able to come up with an intuitive parsing rule for when | starts a ket vs. when it denotes the infix or, so I think supporting these only as matching brackets makes the most sense here. Since this is quite common notation in mathematics and physics, I believe it could be of great use in DSLs for linear algebra, quantum computing or statistics. I think it would also be worth considering lowering this syntax to a function call, maybe even overloading the two- and three-argument methods as LinearAlgebra.dot, but this can be a separate discussion.
I know, this has been discussed in #25565 and #8934, but there never really was a follow-up.
The text was updated successfully, but these errors were encountered:
I think we should add parsing for all of these, with their own expression heads. That way macros can start using them right away, and if we want to add associated functions later we can, but in the meantime it should be totally harmless.
I think it would make sense to parse
⟨
and⟩
as valid bracket syntax, like we currently do{}
and[]
with its own AST representation (maybeExpr(:angle, ...)
?), so that this can be used inside macros for DSLs. The reason, I was initially a bit hesitant about just treating these as brackets is that I thought it would be very cool to support bras and kets as syntax on their own. But with|
already being a very common infix operator, I wasn't able to come up with an intuitive parsing rule for when|
starts a ket vs. when it denotes the infix or, so I think supporting these only as matching brackets makes the most sense here. Since this is quite common notation in mathematics and physics, I believe it could be of great use in DSLs for linear algebra, quantum computing or statistics. I think it would also be worth considering lowering this syntax to a function call, maybe even overloading the two- and three-argument methods asLinearAlgebra.dot
, but this can be a separate discussion.I know, this has been discussed in #25565 and #8934, but there never really was a follow-up.
The text was updated successfully, but these errors were encountered: