-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
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
Remove Base.vect override #293
Conversation
That extension was included to ensure that the |
No, I don't think so: julia> typeof([Variable(2), Variable(2)])
Array{Variable,1} To be fair, julia> typeof([rand(2), rand(2)])
Array{Array{Float64,1},1} isn't an hcat either, is it? |
On this branch, we have julia> [Variable(2), Variable(2)]
2-element Array{Variable,1}:
Variable of
size: (2, 1)
sign: NoSign()
vexity: AffineVexity()
Variable of
size: (2, 1)
sign: NoSign()
vexity: AffineVexity()
julia> [Variable(2) Variable(2)]
AbstractExpr with
head: hcat
size: (2, 2)
sign: NoSign()
vexity: AffineVexity()
julia> [Variable(2); Variable(2)]
AbstractExpr with
head: transpose
size: (4, 1)
sign: NoSign()
vexity: AffineVexity() This behavior seems to match how usual vectors behave (e.g. substituting julia> [Variable(2,3) Variable(2,3)]
AbstractExpr with
head: hcat
size: (2, 6)
sign: NoSign()
vexity: AffineVexity()
julia> [Variable(2,3); Variable(2,3)]
AbstractExpr with
head: transpose
size: (4, 3)
sign: NoSign()
vexity: AffineVexity()
julia> [Variable(2,3), Variable(2,3)]
2-element Array{Variable,1}:
Variable of
size: (2, 3)
sign: NoSign()
vexity: AffineVexity()
Variable of
size: (2, 3)
sign: NoSign()
vexity: AffineVexity() So we do have |
If my understanding is right, I think the proposed changed here is analogous to JuliaLang/julia#8599 in Base, which seems to have introduced But I think I am missing some context, because I'd think the resolution in #145 would have been to match base behavior if that had been an acceptable option at that time. Perhaps now it is an acceptable change? Or maybe those reasons that kept it from being a solution to #145 are still present. |
It seems like this change also fixes #282 (see #282 (comment)). |
Tbh I don't really know what the right thing to do here is, but your explanation with regards to the change in Base is compelling. Let's go for it and see what happens. |
Okay, exciting! |
Fixes #223.
I'm not sure if this change is OK or not. On the one hand, the tests pass. On the other hand, it must be here for a reason; maybe this change will break some obscure edge case. In the latter case though, it would be nice if we had a test to show we need this override (or even better, find a different resolution to such an edge case without overriding
Base.vect
).I thought I'd make the pull request to open a discussion at least.
P.S. sorry for the barrage of pull requests; no rush to address these, I'm just trying to work through the issue backlog a bit.