guile-srfi-123

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 0fac1fd125390c7277d33973770c6f391ef73526
parent 37bae24669eda60da908d107d3460b5184c8677c
Author: Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
Date:   Tue, 18 Aug 2015 17:54:06 +0200

Specify a setter for ref again.

I had forgotten removing it from the implementation, so no change there.

Diffstat:
Msrfi-123.html | 4++++
Msrfi-123.md | 6++++++
2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/srfi-123.html b/srfi-123.html @@ -89,6 +89,10 @@ struct ;=&gt; #(a (x y #u8(4 2 3)) c)</code></pre> ;does something else.</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>The <code>ref</code> procedure has an associated SRFI-17 setter.</p> +<pre><code>(define vec (vector 0 1 2)) +(set! (ref vec 0) 3) +vec ;=&gt; #(3 1 2)</code></pre> <ul> <li><code>(ref* object field field* ...)</code> (procedure)</li> <li><code>(~ object field field* ...)</code></li> diff --git a/srfi-123.md b/srfi-123.md @@ -199,6 +199,12 @@ to their respective `*-ref` procedures. For pairs, refer to `list-ref`. For records, symbols that correspond with the record type's field names are allowed. +The `ref` procedure has an associated SRFI-17 setter. + + (define vec (vector 0 1 2)) + (set! (ref vec 0) 3) + vec ;=> #(3 1 2) + - `(ref* object field field* ...)` (procedure) - `(~ object field field* ...)`