guile-srfi-123

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

commit 8909b6a2b07c2b46ca4dc89ed76e2cc02b6d4b15
parent ae35bfdd2018a234ba89378d94fea9ab2517dea2
Author: Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
Date:   Sun, 16 Aug 2015 20:28:58 +0200

Mention define-record-type not being a definition.

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

diff --git a/srfi-123.html b/srfi-123.html @@ -111,6 +111,7 @@ class="antispam">nospam</span>srfi.schemers.org</a></code>. To subscribe to the <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 <code>set!</code> and <code>define-record-type</code> exports of the library conflict with the ones in <code>(scheme base)</code>, so either have to be renamed, or more typically, the ones 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> and <code>set!</code>.</p> +<p>The <code>define-record-type</code> exported by this library expands to a record type definition followed with a command, essentially eliminating the &quot;definition&quot; status of <code>define-record-type</code>. This means, for example, that you can't use it more than once (only at the end) within the internal definitions sequence of a body. It's a rare use-case, but if you need it, you can nest each additional <code>define-record-type</code> use in a further <code>(let () ...)</code>. It works fine in the top-level, since there definitions and commands can be interspersed.</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>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> diff --git a/srfi-123.md b/srfi-123.md @@ -259,6 +259,15 @@ more typically, the ones from `(scheme base)` excluded. Record types not defined with the `define-record-type` exported by this library won't work with `ref` and `set!`. +The `define-record-type` exported by this library expands to a record +type definition followed with a command, essentially eliminating the +"definition" status of `define-record-type`. This means, for example, +that you can't use it more than once (only at the end) within the +internal definitions sequence of a body. It's a rare use-case, but if +you need it, you can nest each additional `define-record-type` use in +a further `(let () ...)`. It works fine in the top-level, since there +definitions and commands can be interspersed. + Implementation --------------