Re: rnrs records: shadows previous definition of `dummy-1a78708d3c9406a3'
Amélie Devos <[email protected]> Sat, 23 May 2026 11:53:56 +0200
| Newsgroups | gmane.lisp.guile.devel |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--------------W4NRST9ejHLFZi1rMgXW0aAk
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
On 23/05/2026 3:21, Olivier Dion wrote:
> I have no idea why `dummy' is necessary here. I'm sure someone that
To keep things in a definition context, or whatever the technical term
is, I'd assume.
Going only by the code mentioned in the mail, It seems eliminatable
though. For example, instead of
(define dummy
(let ()
(register-record-type
(quote record-name)
record-name (make-record-constructor-descriptor
record-name #,parent-cd #,protocol))
'dummy))
(define predicate-name (record-predicate record-name))
I'd guess that following works too, avoiding 'dummy', by moving the
things into the definition of predicate-name:
(define predicate-name
(let ()
(register-record-type
(quote record-name)
record-name (make-record-constructor-descriptor
record-name #,parent-cd #,protocol))
(record-predicate record-name)))
This assumes that field-accessors and field-mutators don't refer to 'dummy'.
Best regards,
Amélie Devos
--------------W4NRST9ejHLFZi1rMgXW0aAk
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 23/05/2026 3:21, Olivier Dion wrote:<span
style="white-space: pre-wrap">
</span><span style="white-space: pre-wrap">
</span></div>
<blockquote type="cite" cite="mid:87ik8ex6mh.fsf@laura">
<pre class="moz-quote-pre" wrap="">I have no idea why `dummy' is necessary here. I'm sure someone that</pre>
</blockquote>
<p>To keep things in a definition context, or whatever the technical
term is, I'd assume.</p>
<p>Going only by the code mentioned in the mail, It seems
eliminatable though. For example, instead of</p>
<pre wrap="" class="moz-quote-pre"> (define dummy
(let ()
(register-record-type
(quote record-name)
record-name (make-record-constructor-descriptor
record-name #,parent-cd #,protocol))
'dummy))
(define predicate-name (record-predicate record-name))</pre>
<p>I'd guess that following works too, avoiding 'dummy', by moving
the things into the definition of predicate-name:</p>
<pre wrap="" class="moz-quote-pre">
(define predicate-name
(let ()
(register-record-type
(quote record-name)
record-name (make-record-constructor-descriptor
record-name #,parent-cd #,protocol))
(record-predicate record-name)))
This assumes that field-accessors and field-mutators don't refer to 'dummy'.</pre>
<p>Best regards,<br>
Amélie Devos</p>
</body>
</html>
--------------W4NRST9ejHLFZi1rMgXW0aAk--