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

Rename isimmutable trait to ismutable #34518

Closed
juliohm opened this issue Jan 26, 2020 · 8 comments
Closed

Rename isimmutable trait to ismutable #34518

juliohm opened this issue Jan 26, 2020 · 8 comments
Labels
good first issue Indicates a good issue for first-time contributors to Julia help wanted Indicates that a maintainer wants help on an issue or pull request

Comments

@juliohm
Copy link
Contributor

juliohm commented Jan 26, 2020

Based on recent discussions on slack, I noticed that the trait isimmutable is an exception to the rule compared to other is* traits in the language. For a concept foo we usually have isfoo as the trait, and !isfoo as the negation. However, with the concept mutable, we currently have is(not)mutable (a.k.a. isimmutable) implemented as the trait.

Would it be possible to deprecate isimmutable in favor of the more readable ismutable trait?

@Keno
Copy link
Member

Keno commented Jan 26, 2020

I'm in favor. This naming is left over from when immutables where introduced with the immutable keyword, so it made a lot of sense to use the same terminology. Now that the keyword is mutable, switching over the predicate makes sense too. Of course, we can't actually change it until 2.0.

@rapus95
Copy link
Contributor

rapus95 commented Jan 27, 2020

also, !isimmutable feels unnecessarily redundant as it holds multiple negations

@stevengj
Copy link
Member

See also the discussion in #18168.

@JeffBezanson
Copy link
Member

Agree. In fact we can add ismutable now and silently deprecate isimmutable.

@vtjnash
Copy link
Member

vtjnash commented Jan 27, 2020

I think the main reason for the existence of this name might be that they aren't necessarily exact opposites in the type domain (isimmutabletype). In particular, for Abstract and Union, we have that some of the instances might be mutable and others constant. (though also, we have now that AbstractArray.body.body.mutable === false which might be misleading in this example)

@JeffreySarnoff
Copy link
Contributor

isimmutabletype is not all there yet (#30210).
+1 to introducing ismutable.

@StefanKarpinski StefanKarpinski added help wanted Indicates that a maintainer wants help on an issue or pull request good first issue Indicates a good issue for first-time contributors to Julia labels Feb 1, 2020
@ravibitsgoa
Copy link
Contributor

It seems that this issue is closed now. Is it still open?
I am a beginner, looking for a "good first issue"! :)

@KristofferC
Copy link
Member

Yes seems to be fixed in #34518

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Indicates a good issue for first-time contributors to Julia help wanted Indicates that a maintainer wants help on an issue or pull request
Projects
None yet
Development

No branches or pull requests

10 participants