Skip to content
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

Add compatibility for view #238

Merged
merged 6 commits into from
Jun 28, 2016
Merged

Conversation

ranjanan
Copy link
Contributor

@ranjanan ranjanan commented Jun 27, 2016

Test added, README modified. Fixes #235 .

@ranjanan ranjanan mentioned this pull request Jun 27, 2016
@@ -1276,6 +1276,12 @@ else
end
end

if isdefined(Base, :view)
nothing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should reverse the branch condition and delete this....


# Add test for Base.view
let a = rand(10,10)
@test view(a, 1, :) == slice(a, 1, :)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this trigger a depwarn on 0.5? Maybe construct a view and compare it with getindex and check that mutating the view aliases the original one.


# Add test for Base.view
let a = rand(10,10)
@test Array(view(a, :, 1)) == a[:,1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Array shouldn't be necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, it seems to work without that.

@@ -194,6 +194,8 @@ Currently, the `@compat` macro supports the following syntaxes:

* `write(::IO, ::Ptr, len)` is now `unsafe_write` [#14766](https://github.com/JuliaLang/julia/pull/14766).

* `slice` is now `view`: do `import Compat.view` and then use `view` normally without the `@compat` macro.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reference the julia PR - I think it was by @simonbyrne if that helps find it faster

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this: JuliaLang/julia#16972

@yuyichao
Copy link
Contributor

LGTM (need squash or squash on merge)

@ranjanan
Copy link
Contributor Author

@tkelman or someone, can we merge, and tag a new release please?

@TotalVerb TotalVerb merged commit 0a37517 into JuliaLang:master Jun 28, 2016
@ranjanan
Copy link
Contributor Author

@TotalVerb can you tag a new release please? There are packages that are dependent on this. Thanks!

@TotalVerb
Copy link
Contributor

TotalVerb commented Jun 28, 2016

I will once CI passes. Thanks for the contribution!

@TotalVerb
Copy link
Contributor

@tkelman I can't figure out how to tag a release. Could you handle this one?

@timholy
Copy link
Member

timholy commented Jun 28, 2016

dpsanders pushed a commit to dpsanders/Compat.jl that referenced this pull request Feb 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants