(index ("define-a-record" 0) ("make-TYPE" 141) ("TYPE-FIELD-ref" 213) ("TYPE-FIELD" 685) ("TYPE-tag" 814) ("cell-ref" 960) ("@" 1132) ("alter!" 1224) ("call-with-transaction" 1516) ("call-with-transaction/values" 1516) ("define-ac-record" 2225) ("make-TYPE" 2514) ("TYPE-FIELD-ref" 2602) ("TYPE-FIELD" 2872) ("TYPE-FIELD-set!" 3290) ("with-current-transaction" 3736))
(def (sig (syntax "define-a-record" (id define-a-record))) (p "Like define-record, defines procedures according to the following pattern."))
(def (sig (procedure "(make-TYPE FIELDS ...) -> AREC" (id make-TYPE))))
(def (sig (procedure "(TYPE-FIELD-ref AREC TNX) => REF" (id TYPE-FIELD-ref))) (p "Return a reference for use with CELL-REF (alias \"@\") and ALTER!.") (p "Note: Try to use this accessor just once per object+field.  Multiple calls (within a lightweight transaction) will produce independent references.  (If these become inconsistent, the commit will fail nevertheless.)  Only those references used to " (tt "(set! (@ REF) val)") " will return the in-transaction value."))
(def (sig (procedure "(TYPE-FIELD AREC)" (id TYPE-FIELD))) (p "Return the FIELD value visible without transactions in effect."))
(def (sig (procedure "(TYPE-tag AREC)" (id TYPE-tag))) (p "Purely for debugging.  Mayb e removed. Return the internal version tag of the slot."))
(def (sig (procedure "(cell-ref REF)" (id cell-ref))) (p "Retrieve the in-transaction value from the " (tt "REF") "erence (and add it to the transactions dependencies)."))
(def (sig (procedure "(@ REF)" (id @))) (p "Alias to cell-ref.  With generalized setter."))
(def (sig (procedure "(alter! REF val)" (id alter!))) (p "Alter a " (tt "REF") "erence (produced by the " (tt "type") "-" (tt "field") "-ref accessors to hold the new value " (tt "val") ".  This also adds the cell to the dependencies of the transaction associated with the " (tt "REF") "."))
(def (sig (procedure "(call-with-transaction PROC)" (id call-with-transaction)) (procedure "(call-with-transaction/values PROC)" (id call-with-transaction/values))) (p "Call PROC with one argument, a fresh (lightweight) transaction. PROC may be called multiple times in case of a conflict. (See hopefully-current for the difference to heavy transactions).") (p "Returns whatever PROC returns.  Use " (tt "call-with-transaction") " for multiple value returns " (tt "call-with-transaction/values") " returns all values.") (p "Note: One " (tt "should not") " pass the transaction argument around among threads or capture it.  Most (if not all) resulting conditions should be handled.  But it is no good idea."))
(def (sig (syntax "define-ac-record" (id define-ac-record))) (p "Like " (tt "define-a-record") ".") (p (tt "define-ac-record") " is provided for maximum compatibility with " (tt "define-record") ".  Just changing the record definition should make code aware of the current transaction."))
(def (sig (procedure "(make-TYPE FIELDS..) -> ACREC" (id make-TYPE))) (p "Accessors:"))
(def (sig (procedure "(TYPE-FIELD-ref ACREC TNX) => REF" (id TYPE-FIELD-ref))) (p "Return a reference to the in-transaction value of " (tt "field") " in " (tt "ACREC") " for use with CELL-REF (alias \"@\") and ALTER!.  See sibling definition in " (tt "hopefully") "."))
(def (sig (procedure "(TYPE-FIELD ACREC)" (id TYPE-FIELD))) (p "Return the value of " (tt "field") " in ACREC.  Returns the in-transaction value with respect to the " (tt "current-transaction") " or the outside value if there is no " (tt "current-transaction") " in the " (tt "current-thread") ".") (p "Note: this is roughly an order of magnitude slower than the corresponding accessor from " (tt "define-a-record")))
(def (sig (procedure "(TYPE-FIELD-set! ACREC val) -> undefined" (id TYPE-FIELD-set!))) (p "Set the value of " (tt "field") " to " (tt "val") ".  Changes the in-transaction value respect to the " (tt "current-transaction") " or the outside value if there is no " (tt "current-transaction") " in the " (tt "current-thread") ".") (p "Note: this is roughly an order of magnitude slower than the corresponding accessor from " (tt "define-a-record")))
(def (sig (procedure "(with-current-transaction THUNK)" (id with-current-transaction))) (p "Establish a new " (tt "current-transaction") " and call " (tt "THUNK") ". After thunk completed, commit the current transaction. If that failes, THUNK is called again.") (p "Returns whatever THUNK returns."))
