|
From: | Philip McGrath |
Subject: | Re: better error messages through assertions |
Date: | Fri, 1 Apr 2022 15:28:00 -0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 |
Hi, On 3/30/22 09:28, Andy Wingo wrote:
Too bad about all that other crap about checking whether the index is in range and the field is boxed or not, though :-/ Probably there is a better design... Andy
For the index-out-of-range part, when I saw `record-accessor`, I thought of it as similar to Racket's `make-struct-field-accessor`[1], which can check the index just once, when the accessor is created, rather than each time the accessor is used. That's (part of) what Racket's `struct` form expands to.
Would it be reasonable to use `record-accessor` in the implementation of SRFI 9?
-Philip[1]: https://docs.racket-lang.org/reference/creatingmorestructs.html#%28def._%28%28quote._~23~25kernel%29._make-struct-field-accessor%29%29
[Prev in Thread] | Current Thread | [Next in Thread] |