Skip to content

Commit 76eed9f

Browse files
committed
Install <- as synonym for "store" for atomic ints
1 parent 20d69d3 commit 76eed9f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

M2/Macaulay2/m2/integers.m2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ scan({symbol +=, symbol -=, symbol &=, symbol |=, symbol ^^=},
116116

117117
store = method()
118118
store(AtomicInt, ZZ) := atomicStore
119+
(<- AtomicInt) := store
119120

120121
exchange = method()
121122
exchange(AtomicInt, ZZ) := atomicExchange

M2/Macaulay2/packages/Macaulay2Doc/doc_atomic.m2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ doc ///
190190
Key
191191
store
192192
(store, AtomicInt, ZZ)
193+
(symbol <-, AtomicInt)
193194
Headline
194195
store the value of an atomic integer
195196
Usage
@@ -205,6 +206,11 @@ doc ///
205206
x = new AtomicInt
206207
store(x, 5)
207208
x
209+
Text
210+
The @TO symbol <-@ operator may also be used.
211+
Example
212+
x <- 7
213+
x
208214
///
209215

210216
doc ///

0 commit comments

Comments
 (0)