-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
#34518 - rename isimmutable to ismutable #34652
Changes from 2 commits
8faa424
6b76c59
a77d03a
ca4d104
a252f5e
eed8b67
28f7f9f
aba863f
dc724e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -190,3 +190,24 @@ MPFR.BigFloat(x::Real, prec::Int, rounding::RoundingMode) = BigFloat(x, rounding | |||||
end | ||||||
|
||||||
# END 1.3 deprecations | ||||||
|
||||||
# BEGIN 1.5 deprecations | ||||||
""" | ||||||
isimmutable(v) -> Bool | ||||||
|
||||||
Return `true` iff value `v` is immutable. See [Mutable Composite Types](@ref) | ||||||
for a discussion of immutability. Note that this function works on values, so if you give it | ||||||
a type, it will tell you that a value of `DataType` is mutable. | ||||||
|
||||||
# Examples | ||||||
```jldoctest | ||||||
julia> isimmutable(1) | ||||||
true | ||||||
|
||||||
julia> isimmutable([1,2]) | ||||||
false | ||||||
``` | ||||||
""" | ||||||
isimmutable(@nospecialize(x)) = (@_pure_meta; !typeof(x).mutable) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe this could now be implemented as
Suggested change
but perhaps not that important. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changed in eed8b67 |
||||||
|
||||||
# END 1.5 deprecations |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -642,6 +642,7 @@ export | |
isbits, | ||
isequal, | ||
isimmutable, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could move this export to where the function is defined in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. export moved to |
||
ismutable, | ||
isless, | ||
ifelse, | ||
objectid, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,6 +159,7 @@ Base.isdispatchtuple | |
|
||
```@docs | ||
Base.isimmutable | ||
Base.ismutable | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe switch the order and put There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. order switched in aba863f |
||
Base.isabstracttype | ||
Base.isprimitivetype | ||
Base.issingletontype | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I didn't mention this before, but perhaps it would be good to add
Then the last step for a truly awesome contribution would be to add
ismutable
to https://github.com/JuliaLang/Compat.jl.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warning message added in a77d03a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compat PR JuliaLang/Compat.jl#686