commit 9b8a0b1e3c0deaf1ee3baa5d258973ef27c2a19e
parent dcf86d5bb273202bec3de2fef0b6a040392ac331
Author: Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
Date: Mon, 7 Sep 2015 15:23:11 +0200
Fix ref specification for pairs.
Diffstat:
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/srfi-123.html b/srfi-123.html
@@ -97,7 +97,7 @@ struct ;=> #(a (x y #u8(4 2 3)) c)</code></pre>
<p>If <code>object</code> is not of a sparse type, then providing the <code>default</code> argument is an error.</p>
<pre><code>(ref '(0 1 2) 3 'default) ;error: list-ref: Too many arguments.</code></pre>
<p>Valid types for <code>object</code> are: bytevectors, hashtables, pairs, strings, vectors, non-opaque record types, and SRFI-4 vectors if present. Only hashtables are a sparse type. Implementations are encouraged to expand this list of types with any further types they support.</p>
-<p>Valid types for <code>field</code> depend on the type of <code>object</code>. For bytevectors, hashtables, strings, vectors, and SRFI-4 vectors, refer to their respective <code>*-ref</code> procedures. For pairs, refer to <code>list-ref</code>. For records, symbols that correspond with the record type's field names are allowed.</p>
+<p>Valid types for <code>field</code> depend on the type of <code>object</code>. For bytevectors, hashtables, strings, vectors, and SRFI-4 vectors, refer to their respective <code>*-ref</code> procedures. For pairs, the symbols <code>car</code> and <code>cdr</code> are accepted, as well as non-negative integers as with <code>list-ref</code>. For records, symbols that correspond with the record type's field names are allowed.</p>
<p>A conforming implementation must be prepared for SRFI-4 vector types and bytevectors not being disjoint types, and treat SRFI-4 vectors suitably and not as regular bytevectors.</p>
<p>The <code>ref</code> procedure has an associated SRFI-17 setter, although the one of <code>ref*</code> is strictly more powerful.</p>
<pre><code>(define vec (vector 0 1 2))
diff --git a/srfi-123.md b/srfi-123.md
@@ -213,7 +213,8 @@ expand this list of types with any further types they support.
Valid types for `field` depend on the type of `object`. For
bytevectors, hashtables, strings, vectors, and SRFI-4 vectors, refer
-to their respective `*-ref` procedures. For pairs, refer to
+to their respective `*-ref` procedures. For pairs, the symbols `car`
+and `cdr` are accepted, as well as non-negative integers as with
`list-ref`. For records, symbols that correspond with the record
type's field names are allowed.