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)
|
Resolved in the latest draft (in personal repo): - Added a generative clause to be explicit about the generative case. - Encourage implementations to warn if neither a nongenerative nor a generative clause is used or if a nongenerative clause is used without a uid. Am Mi., 2. Nov. 2022 um 15:57 Uhr schrieb Marc Nieper-Wißkirchen <xxxxxx@nieper-wisskirchen.de>: > > In case someone is interested; below is a quick-and-dirty Emacs hack I > just wrote. > > Am Mi., 2. Nov. 2022 um 14:09 Uhr schrieb Marc Nieper-Wißkirchen > <xxxxxx@nieper-wisskirchen.de>: > > > But I see why you say that UID-less nongenerative records are also > > problematic. For quick-and-dirty programming and some backward > > compatibility, I like to leave them in the language (at least until I > > have told Emacs to generate UIDs for me), but at least we can > > encourage implementations to raise a continuable exception of type > > &warning whenever they expand a UID-less nongenerative record type. > > (defun scheme-insert-record-type-definition (record-name) > "Insert a record-type defintion for RECORD-NAME." > (interactive "sRecord name: ") > (insert "(define-record-type ") > (insert record-name) > (newline) > (indent-according-to-mode) > (insert "(nongenerative ") > (insert record-name) > (insert "-") > (insert (substring (with-output-to-string > (call-process "uuidgen" nil standard-output)) > 0 -1)) > (insert ")") > (newline) > (indent-according-to-mode) > (insert "(fields ") > (save-excursion > (insert "))") > (newline) > (indent-according-to-mode))) > > (add-hook 'scheme-mode-hook > (lambda () (local-set-key (kbd "C-c r") > #'scheme-insert-record-type-definition)))