chaperone-treelist
fixes and doc edits
#4982
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR has two bug fixes and several documentation edits related to
chaperone-treelist
.The bugs:
4530cd9 documented that#:ref
could be#f
, butcheck-chaperone-arguments
didn't actually allow it. This is fixed in ed70e7f.#:append2
had the wrong number of arguments (i.e. one of the state arguments was missing).I would be happy to split this PR up further if either of those fixes seem important enough to put into 8.13 at this late stage: I only wish I had discovered them sooner!
The other non-documentation change in this PR is that I made
#:ref
optional.Several things that I have not done (yet?):
At one point I considered whether#:state
should also be optional, but I decided against it: if there were really a use-case for chaperoning for which state was irrelevant, it would be better to provide an alternate function that wouldn't need the corresponding arguments and return values, either.must accept @racket[tl]
and produce resultschaperoned with the same procedures and properties as @racket[tl]
. The argumenttl
is without the layer of chaperoning added by this call tochaperone-treelist
, sotreelist-chaperone-state
and impersonator-property accesses on thattl
won't work. Perhaps pedantically, the argumenttl
might also be a derived treelist, rather than thetl
from the formal arguments tochaperone-treelist
. That also means the result treelist more precisely gets "the same procedures and properties" added by this call tochaperone-treelist
, or something like that. But I haven't yet figured out a concise way of writing (the important parts of) that.tl
andstate
are italicized as though by@var{}
, whereaspos
,v
,other
, andother-state
are not. They could easily all be italicized via_
, but it might be more correct to italicize none of them.When two chaperoned treelists are given to @racket[treelist-append] and @racket[append2-proc] is not used
, I'd like to say more about what happens whenappend2-proc
is used, but I'm still confirming that I understand the details I think I want to write.More generally I have some observations now that I've (finally) experimented with the improved treelist chaperoning a bit, but I probably won't finish writing those up tonight and, having found the bugs here, I didn't want to delay reporting them. (In brief, this still seems like a fine direction.)