[R6RS] Nongenerative record-type UIDs
dyb at cs.indiana.edu
dyb at cs.indiana.edu
Sun Nov 26 20:43:31 EST 2006
> Jaffer's suggestion in Ticket #73 of using record-type name + UID for
> identifying a nongenerative record type, and recommending that the
> library name be used for the UIDs strikes me as reasonable. Does
> anybody disagree?
Yes. I think it's a good idea to remove the suggestion that users pick
their UIDs from the UUID namespace so that the library name + record name
can be used by convention by people who wish to do so. I also have no
problem with programmers using library-name + record-name as a convention
for the UID, but I don't like making it a requirement.
Were it made a requirement, the proposed convention would force
programmers to assign "ownership" of each record type to a particular
library. Sometimes record types are shared by multiple libraries equally,
so giving ownership to one does not always makes sense. Even when the
owner is clear at one point during the development of an application, it
may change due to refactoring, resulting in the need to change UIDs more
frequently than necessary. More importantly, UIDs for an application's
published record types may also have to change due to changes in the
application's internal library structure or naming conventions.
Furthermore, the convention breaks down where local record definitions are
concerned, since multiple distinct local record definitions with the same
name may appear in the same library (even possibly in the same scope with
hygienic expansion). The convention also fails to generalize smoothly to
nongenerative record definitions where there is no appropirate library
name to use, such as in scripts or at the top level, if an implementation
allows top-level definitions. (While the report presumably won't require
a top level or specify its semantics, I think it's best if we don't choose
a convention we know doesn't generalize well to the top level.)
Jaffer also suggests eliminating generative record types and defaulting a
#f uid to the name of the library name in which the record definition
appears. This suffers from the problems listed above, plus it does not
generalize to the procedural interface. With the procedural interface,
it is generally impossible to determine which library name is meant, and
I doubt we'd want to restrict the procedural interface to creating only
nongenerative record types in any case.
On the other hand, I don't object to eliminating generative record
definitions (i.e., in the syntactic interface) with the implementation
required to choose an arbitrary UID at the time a record definition
is expanded.
As for using the specified UID + record-type as the "real" UID, I have no
strong opinion at this point, although I think it's probably not very
useful to do so.
Kent
More information about the R6RS
mailing list