-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
@compat for (e.g.) Vector{Int}()? #105
Comments
see also JuliaLang/julia#11154, where the |
and the related julia-users thread |
In any event, I have been planning to add |
@garrison thanks. I might take a shot at it next week but I doubt my attempt will be as good as yours would be. I think the julia-users thread has run its course, and unfortunately (for me, anyway) there hasn't been a declaration. I'm still left wondering what the go-forward, preferred method of constructing an empty vector is / will be. If it's Vector{Int}(), then I can feel comfortable trying to get this into Compat. If, however, this is NOT the best way to do it, then I'd much rather try to get the preferred method in. I hope this rambling makes a little bit of sense. |
We should definitely have this in |
@StefanKarpinski thanks very much for your comment. If I'm interpreting it correctly, it means that (or, on second read, does it mean that |
No, I'm just saying that if you want to be maximally sure that you don't ever have to change your code, use In short, if you're ok with potentially changing your code in the future when you get deprecation warnings, then use whatever syntax you prefer. If you really want to avoid that, use |
Perfect. Thank you very much! |
Ok, just FYI, this is ... and I have absolutely no idea how to do this without |
You would write a macro, so that |
Thanks. I've never written a macro before. Perhaps this is a good opportunity to figure it out. |
See the existing |
Does this work for the array rewrite? (This is my first attempt at metaprogramming; my tests seem to work but there may be edge cases). I don't know where to put this, in any case.
|
(...anyone?) :) |
Thanks for doing this, and for bumping. If no one else gets to it first, I'll look at this tonight. (I also need it!) |
@kmsquire my pleasure, but please note:
:) |
Hi all - I'm sorry to be such a pain about this, but it's holding up a fairly big commit I have in LightGraphs. I could work around it by using |
Sorry, wasn't able to get to it the other night, but I can do so now. On Wed, Jul 1, 2015 at 3:19 PM, Seth Bromberger [email protected]
|
Rockin'. Thanks. |
Not sure this is working properly. I'm getting an error in nightly with
:
|
Is the error in Julia v0.4, or Julia v0.3? In Julia v0.4, the code I added should be a no-op, and your code works fine for me on an out-of-date (21 days old) master. I haven't tested on Julia v0.3 |
Fails on 0.4 on a 35-day-old master. On Jul 2, 2015, at 13:14, Kevin Squire [email protected] wrote: Is the error in Julia v0.4, or Julia v0.3? In Julia v0.4, the code I added — |
Can you repeat the commands below and show the output? $ julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "help()" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.4.0-dev+5307 (2015-06-10 22:36 UTC)
_/ |\__'_|_|_|\__'_| | Commit 5035c5c* (21 days old master)
|__/ | x86_64-apple-darwin14.3.0
julia> using LightGraphs
julia> using Compat
julia> type TarjanVisitor <: AbstractGraphVisitor
stack::Vector{Int}
lowlink::Vector{Int}
index::Vector{Int}
components::Vector{Vector{Int}}
end
julia> TarjanVisitor(n::Int) = TarjanVisitor(
@compat Vector{Int}(),
@compat Vector{Int}(),
zeros(Int, n),
@compat Vector{Vector{Int}}()
)
TarjanVisitor
julia> @compat TarjanVisitor(n::Int) = TarjanVisitor(
Vector{Int}(),
Vector{Int}(),
zeros(Int, n),
Vector{Vector{Int}}()
)
TarjanVisitor
julia> macroexpand(:(@compat TarjanVisitor(n::Int) = TarjanVisitor(
Vector{Int}(),
Vector{Int}(),
zeros(Int, n),
Vector{Vector{Int}}()
)))
:(TarjanVisitor(n::Int) = begin # none, line 1:
TarjanVisitor(Vector{Int}(),Vector{Int}(),zeros(Int,n),Vector{Vector{Int}}())
end) |
Sorry. The failure was on 0.4 nightly (Travis). On Jul 2, 2015, at 13:14, Kevin Squire [email protected] wrote: Is the error in Julia v0.4, or Julia v0.3? In Julia v0.4, the code I added — |
Okay. When you get the chance, can you point to the Travis output with problems, and/or provide explicit instructions on how to reproduce? Thanks! |
Can't get Travis atm but here's the github pr. It's the most recent failure: On Jul 2, 2015, at 13:27, Kevin Squire [email protected] wrote: Okay. When you get the chance, can you point to the Travis output with — |
@kmsquire rerunning Travis now... the build is here: https://travis-ci.org/JuliaGraphs/LightGraphs.jl/builds/69349027 It's weird because it looks like the PS: output from the above:
|
Moving the https://travis-ci.org/JuliaGraphs/LightGraphs.jl/jobs/69353258
(Also working on 0.3.) |
Also see the differences here:
|
Ok, thanks. Can you open up a separate issue with that output? It should be the same, but I'm not sure that this problem would be restricted to this particular change. |
Hi,
Currently in 0.3.x
Any way to get this working in 0.3?
The text was updated successfully, but these errors were encountered: