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 function Compat.LinAlg.checksquare #175

Merged
merged 1 commit into from
Feb 24, 2016

Conversation

andreasnoack
Copy link
Member

Fixes #168

@yuyichao
Copy link
Contributor

Shouldn't this be better handled by a unexported Compat.checksquare or Compat.LinAlg.checksquare function?

@andreasnoack
Copy link
Member Author

Maybe. What are the trade-offs?

@yuyichao
Copy link
Contributor

An actual name is much more reliable than rewriting the ast with a macro and should be the preferred way.

@yuyichao
Copy link
Contributor

The down side is of course that you can't just remove the @compat when dropping support for old julia version and need to replace Compat or Compat.LinAlg by Base.LinAlg instead.

@andreasnoack
Copy link
Member Author

I can see that, but it is compelling that you can just use latest syntax + @compat. Do you see any specific vulnerabilities with the rewrite function I've written?

@yuyichao
Copy link
Contributor

The fact that you need to patch using (and missing import and importall)? In general, I think we only use @compat to bridge syntax changes and while there are changes that are tricky to classify, a renaming like this is certainly not one of those.

@andreasnoack andreasnoack changed the title Add checksquare rewrite rule. Add compatibility function Compat.LinAlg.checksquare Feb 24, 2016
@@ -859,4 +859,14 @@ else # if VERSION < v"0.5.0-dev+1182"

end

module LinAlg
if VERSION < v"0.5.0-dev+2022"
checksquare(x) = Base.LinAlg.chksquare(x)
Copy link
Contributor

Choose a reason for hiding this comment

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

These can be const checksquare = Base.LinAlg.chksquare and const checksquare = Base.LinAlg.checksquare (or import Base.LinAlg.checksquare).

@andreasnoack
Copy link
Member Author

@yuyichao Thanks for the comments. I've updated the PR.

@yuyichao
Copy link
Contributor

LGTM. =)

andreasnoack added a commit that referenced this pull request Feb 24, 2016
Add compatibility function Compat.LinAlg.checksquare
@andreasnoack andreasnoack merged commit edec13d into master Feb 24, 2016
@andreasnoack andreasnoack deleted the anj/checksquare branch February 24, 2016 03:30
martinholters pushed a commit to martinholters/Compat.jl that referenced this pull request Jul 13, 2016
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.

2 participants