Generative and nongenerative record types Marc Nieper-Wißkirchen (30 Oct 2022 09:09 UTC)
Re: Generative and nongenerative record types John Cowan (30 Oct 2022 16:37 UTC)
Re: Generative and nongenerative record types Marc Nieper-Wißkirchen (30 Oct 2022 16:57 UTC)
Re: Generative and nongenerative record types John Cowan (30 Oct 2022 22:20 UTC)
Re: Generative and nongenerative record types Marc Nieper-Wißkirchen (31 Oct 2022 09:12 UTC)
Re: Generative and nongenerative record types Marc Feeley (31 Oct 2022 12:00 UTC)
Re: Generative and nongenerative record types Marc Nieper-Wißkirchen (31 Oct 2022 12:37 UTC)
Re: Generative and nongenerative record types Marc Feeley (31 Oct 2022 13:21 UTC)
Re: Generative and nongenerative record types Marc Nieper-Wißkirchen (02 Nov 2022 13:09 UTC)
Re: Generative and nongenerative record types Marc Nieper-Wißkirchen (02 Nov 2022 14:57 UTC)
Re: Generative and nongenerative record types Marc Nieper-Wißkirchen (03 Nov 2022 19:20 UTC)
Re: Generative and nongenerative record types Marc Nieper-Wißkirchen (08 Nov 2022 16:23 UTC)
Re: Generative and nongenerative record types Daphne Preston-Kendal (08 Nov 2022 16:24 UTC)
Re: Generative and nongenerative record types Marc Nieper-Wißkirchen (08 Nov 2022 16:29 UTC)

Re: Generative and nongenerative record types Marc Nieper-Wißkirchen 08 Nov 2022 16:22 UTC

Am So., 30. Okt. 2022 um 17:57 Uhr schrieb Marc Nieper-Wißkirchen
<xxxxxx@nieper-wisskirchen.de>:
>
> Am So., 30. Okt. 2022 um 17:37 Uhr schrieb John Cowan <xxxxxx@ccil.org>:
> >
> >
> >
> > On Sun, Oct 30, 2022 at 5:09 AM Marc Nieper-Wißkirchen <xxxxxx@nieper-wisskirchen.de> wrote:
> >
> >> 95% or more of the record-type definitions in practice are supposed to
> >> be nongenerative.
> >
> >
> > What is the evidence for this claim?  As far as I know, almost all record-type definitions are global, which means it makes no difference whether they are generative or non-generative.
>
> Global record-type definitions are effectively non-generative.
>
> Local record-type definitions are helpful if one wants to use lexical
> scoping.  If the type to be defined is only used locally in a
> procedure (which includes a macro transformer, for example), this can
> be good coding practice to prevent pollution of the (module-)global
> namespace.  If these local record-type definitions were generative,
> the "good coding practice" would lead to inefficient code.

PS Due to phasing, record definitions that are used in macro expanders
have to be defined locally (unless one writes a helper library). E.g.:

(define-syntax foo
  (lambda (stx)
    (define-record-type ast
      (nongenerative)
      ...)
    ...
    (syntax-case stx ()
      ...))

We don't want that every invocation of the foo macro creates a new record type.

The small language would be lacking here.