commit eae6a71f765f4c9a7044e6440d973522f6a99543
parent 834694767041ea36eaa2f3363a61b88e57cc5c8f
Author: Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
Date: Thu, 3 Sep 2015 13:19:23 +0200
Call the implementation "sample" not "reference".
Diffstat:
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/srfi-123.html b/srfi-123.html
@@ -74,7 +74,7 @@ struct ;=> #(a (x y #u8(4 2 3)) c)</code></pre>
</ul>
<p>Alists are difficult to support due to the lack of a reliable <code>alist?</code> predicate. (It's ambiguous in that every alist is also a list, and any list may coincidentally have the structure of an alist.) It was considered to support non-integer keyed alists as a special case, but this would lead to silent code breakage when a programmer forgot about the API inconsistency and exchanged a non-integer key for an integer key in existing code. It was also considered to drop list support in favor of alist support, but that idea discarded as well because the hypothetical <code>alist-set!</code> is an exceedingly rare operation. (Prepending an entry to the front, possibly hiding another entry with the same key, is more common.)</p>
<h2 id="integration-with-srfi-105">Integration with SRFI-105</h2>
-<p>The <code>ref*</code> procedure is a good candidate for SRFI-105's <code>$bracket-apply$</code>. Indeed the reference implementation exports <code>$bracket-apply$</code> as a synonym to <code>ref*</code>. In code that already uses SRFI-105 heavily, a programmer may additionally define <code>:=</code> as a synonym to <code>set!</code>, and then use the following syntax: <code>{object[field] := value}</code>.</p>
+<p>The <code>ref*</code> procedure is a good candidate for SRFI-105's <code>$bracket-apply$</code>. Indeed the sample implementation exports <code>$bracket-apply$</code> as a synonym to <code>ref*</code>. In code that already uses SRFI-105 heavily, a programmer may additionally define <code>:=</code> as a synonym to <code>set!</code>, and then use the following syntax: <code>{object[field] := value}</code>.</p>
<pre><code>#!curly-infix
(import (rename (only (scheme base) set!) (set! :=)))
(define vec (vector 0 1 2 3))
@@ -122,11 +122,11 @@ vec ;=> #(3 1 2)</code></pre>
<p><strong>Warning:</strong> This procedure is strictly meant for when defining a new disjoint type which isn't already handled by <code>ref</code>. In practice, this means it should only be used with newly defined opaque record types, or types defined with some implementation-specific method which, unlike <code>define-record-type</code>, doesn't automatically register a getter and setter for the type. If any two type predicates registered with the system both return true for any Scheme object, the behavior is undefined. (A custom getter or setter may, however, dispatch to different actions based on some property of the given object, based on the <code>field</code> argument, or based on anything else.)</p>
<p>It is conceivable that this method will become deprecated after a system has been invented which ties together the definition of a new opaque record type with the definitions of its getter and setter. This is considered outside the scope of this SRFI.</p>
<h2 id="considerations-when-using-as-a-library">Considerations when using as a library</h2>
-<p>The intent of this SRFI is to encourage Scheme systems to extend their standard library in accordance with the above specification. On the meanwhile, the reference implementation can be used as a separate library, but certain considerations apply.</p>
+<p>The intent of this SRFI is to encourage Scheme systems to extend their standard library in accordance with the above specification. On the meanwhile, the sample implementation can be used as a separate library, but certain considerations apply.</p>
<p>The <code>define-record-type</code> export of the library conflicts with the one in <code>(scheme base)</code>, so either has to be renamed, or more typically, the one from <code>(scheme base)</code> excluded.</p>
<p>Record types not defined with the <code>define-record-type</code> exported by this library won't work with <code>ref</code>, <code>ref*</code>, or their setters.</p>
<h2 id="implementation">Implementation</h2>
-<p>A reference implementation as a library is found in the version control repository of this SRFI.</p>
+<p>A sample implementation as a library is found in the version control repository of this SRFI.</p>
<p>It might be desirable for Scheme systems to offer a more efficient <code>type-of</code> procedure than the one used in this implementation, which in the worst case consumes linear time with regard to the number of types (including every record type) within the system, albeit with a very small constant factor: one call to each type predicate.</p>
<h2 id="acknowledgments">Acknowledgments</h2>
<p>Thanks to Jorgen Schäfer for inspiring me to write this SRFI and making the initial suggestion for the <code>ref</code> procedure and ternary <code>set!</code> syntax, as well as providing continuous input.</p>
diff --git a/srfi-123.md b/srfi-123.md
@@ -160,7 +160,7 @@ Integration with SRFI-105
-------------------------
The `ref*` procedure is a good candidate for SRFI-105's
-`$bracket-apply$`. Indeed the reference implementation exports
+`$bracket-apply$`. Indeed the sample implementation exports
`$bracket-apply$` as a synonym to `ref*`. In code that already uses
SRFI-105 heavily, a programmer may additionally define `:=` as a
synonym to `set!`, and then use the following syntax:
@@ -281,7 +281,7 @@ Considerations when using as a library
The intent of this SRFI is to encourage Scheme systems to extend their
standard library in accordance with the above specification. On the
-meanwhile, the reference implementation can be used as a separate
+meanwhile, the sample implementation can be used as a separate
library, but certain considerations apply.
The `define-record-type` export of the library conflicts with the one
@@ -295,8 +295,8 @@ this library won't work with `ref`, `ref*`, or their setters.
Implementation
--------------
-A reference implementation as a library is found in the version
-control repository of this SRFI.
+A sample implementation as a library is found in the version control
+repository of this SRFI.
It might be desirable for Scheme systems to offer a more efficient
`type-of` procedure than the one used in this implementation, which in