Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions base/docs/basedocs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2899,7 +2899,7 @@ Base.setproperty!
swapproperty!(x, f::Symbol, v, order::Symbol=:not_atomic)

The syntax `@atomic a.b, _ = c, a.b` returns `(c, swapproperty!(a, :b, c, :sequentially_consistent))`,
where there must be one getfield expression common to both sides.
where there must be one `getproperty` expression common to both sides.

See also [`swapfield!`](@ref Core.swapfield!)
and [`setproperty!`](@ref Base.setproperty!).
Expand All @@ -2909,9 +2909,9 @@ Base.swapproperty!
"""
modifyproperty!(x, f::Symbol, op, v, order::Symbol=:not_atomic)

The syntax `@atomic max(a().b, c)` returns `modifyproperty!(a(), :b,
max, c, :sequentially_consistent))`, where the first argument must be a
`getfield` expression and is modified atomically.
The syntax `@atomic op(x.f, v)` (and its equivalent `@atomic x.f op v`) returns
`modifyproperty!(x, :f, op, v, :sequentially_consistent)`, where the first argument
must be a `getproperty` expression and is modified atomically.
Copy link
Member

Choose a reason for hiding this comment

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

swapproperty! also calls it a getfield expression

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you want to keep calling it getfield expression?

Copy link
Member

Choose a reason for hiding this comment

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

Either way, just as long as we are consistent

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, let's go with getproperty then. I think getproperty is more familiar with general users.


Invocation of `op(getproperty(x, f), v)` must return a value that can be stored in the field
`f` of the object `x` by default. In particular, unlike the default behavior of
Expand Down