ChangeableList<'T> Type
A changeable list: the writable source of an adaptive list. Reads and writes are confined to the owner thread. See ChangeableSet<'T> for the view, transaction, and disposal contracts.
Positions are 0-based and refer to the list as of the previous operation of the same batch. A full replace (Set) inside a transaction is last-wins over the whole batch: it supersedes all other writes of the batch (docs/ALIST-DESIGN.md §3.3). Reads inside a transaction see the pre-transaction list, so positions inside a transaction refer to the pre-transaction list.
GetValue returns a transient view of the internal list, valid only
until the next write. CList.force materializes an immutable array
snapshot.
Constructors
| Constructor |
Description
|
|
|
Instance members
| Instance member |
Description
|
Full Usage:
this.Append
Parameters:
'T
|
Appends an element at the end of the list.
|
Full Usage:
this.Clear
|
Removes all elements. The delta carries descending removes. |
Full Usage:
this.Count
Returns: int
|
Gets the number of elements.
|
Full Usage:
this.InsertAt
Parameters:
int
value : 'T
|
Inserts an element before the element currently at
|
Full Usage:
this.IsEmpty
Returns: bool
|
Gets whether the list is empty.
|
Full Usage:
this[position]
Parameters:
int
Returns: 'T
|
Gets the element at the given position.
|
Full Usage:
this.PostAppend
Parameters:
'T
|
Posts an append. Safe from any thread: the operation is queued and
returns immediately. The owner thread applies the queued operations at
the next graph operation (reads and writes auto-drain) or at
Example
val view: obj
|
Full Usage:
this.PostClear
|
Posts a clear. Safe from any thread. See PostAppend for the application contract. Example
|
Full Usage:
this.PostInsertAt
Parameters:
int
value : 'T
|
Posts an insert before the element currently at the position. Safe from any thread. See PostAppend for the application contract; the position is validated when the batch applies and refers to the state built by the earlier ops of the batch.
Example
|
Full Usage:
this.PostPrepend
Parameters:
'T
|
Posts an insert at the start. Safe from any thread. See PostAppend for the application contract.
Example
|
Full Usage:
this.PostRemove
Parameters:
'T
|
Posts a remove of the first occurrence of the value. Safe from any thread. See PostAppend for the application contract; the scan runs when the batch applies.
Example
|
Full Usage:
this.PostRemoveAt
Parameters:
int
|
Posts a remove at the position. Safe from any thread. See PostAppend for the application contract; the position is validated when the batch applies.
Example
|
Full Usage:
this.PostSet
Parameters:
'T seq
|
Posts a full replace. Safe from any thread. See PostAppend for the application contract; a posted replace supersedes the other ops of the same pending batch (the transaction semantics of Set).
Example
|
Full Usage:
this.PostUpdateAt
Parameters:
int
value : 'T
|
Posts a replace at the position. Safe from any thread. See PostAppend for the application contract; the position is validated when the batch applies.
Example
|
Full Usage:
this.Prepend
Parameters:
'T
|
Inserts an element at the start of the list.
|
Full Usage:
this.Remove
Parameters:
'T
|
Removes the first occurrence of the value. No-op when absent. O(n) write-time scan.
|
Full Usage:
this.RemoveAt
Parameters:
int
|
Removes the element currently at
|
Full Usage:
this.Set
Parameters:
'T seq
|
Replaces the whole list (prefix/suffix-trim diff). Last-wins over the whole batch inside a transaction: it supersedes all other writes of the batch (docs/ALIST-DESIGN.md ยง3.3).
|
Full Usage:
this.TryGet
Parameters:
int
Returns: 'T voption
|
Gets the element at the given position, or
|
Full Usage:
this.UpdateAt
Parameters:
int
value : 'T
|
Replaces the element currently at
|
Mibo