Consider the following record type definition (with meta-variables <field1> and <field2>):(define-record record-type(make-record <field1>)record?(<field2> accessor))In order to process this definition, the record system will have to somehow match the field names <field1> and <field2>. The procedural layers of SRFI 99 match <field1> and <field2> by symbol name, which I am going to call ‘non-hygienically’. This way of matching is clear from the description of SRFI 99 and also because a procedural system cannot do differently without any access to the underlying low-level macro facility). As SRFI 131 is built on top of SRFI 99 (and claims to be compatible), SRFI 131 record field names are also matched non-hygienically. In particular, if a child record type wants to reference a parent record type's field in its constructor, the parent record type's field name doesn't have to be exported as an identifier to the child. The child record type just have to know the symbol's name.
How is this related to being generative? SRFI 99 records are generative as well. And there is no need to hygienically shield child names for R7RS records because they are meanungless outside their define-record-type.
Marc
--
You received this message because you are subscribed to the Google Groups "scheme-reports-wg2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scheme-reports-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No, we deliberately changed this - we made define-record-type
generative, at which point it pretty much has to be hygienic.
Whether the identifiers have meaning or not in R7RS, they must
be distinct. How can we write macros that expand into record
types with multiple fields using hygienic renaming if we then strip
the hygiene?
--
Alex
On Sat, Jun 18, 2016 at 3:34 AM, John Cowan <co...@mercury.ccil.org> wrote:
> Marc Nieper-Wißkirchen scripsit:
>
>> How is this related to being generative? SRFI 99 records are generative as
>> well. And there is no need to hygienically shield child names for R7RS
>> records because they are meanungless outside their define-record-type.
>
> I agree. I've added this as unofficial erratum 26.
>
> --
> No saves, Antonio, loke es morirse en su lingua. Es komo kedarse soliko en el
> silensyo kada dya ke Dyo da, komoser sikileoso sin saver porke.
> --Marcel Cohen, 1985
>
> --
> You received this message because you are subscribed to the Google Groups "scheme-reports-wg2" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to scheme-reports-wg2+unsub...@googlegroups.com.
>> > an email to scheme-reports-wg2+unsub...@googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "scheme-reports-wg2" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to scheme-reports-wg2+unsub...@googlegroups.com.
if you want to do something like this, use a non-hygienic macro system.
>> Please don't add any erratum until we've come to a consensus.
>
> I've marked it PROPOSED.
And I've removed it. Even if you could convince me we
wanted to make this unhygienic, it's too big a change to make
as an erratum. Errata should only be mistakes which would
clearly be broken if not addressed, and require unanimous
agreement from the WG1 members.
If the WG2 members
need to make semantic changes at this late point in the
game, they need to maintain their own list of extensions or
incompatibilities to the small language.
Far from convinced, I think we made the correct decision
in WG1 and it's essential that the field accessors and names
remain hygienic. Discussion of records was one of the
longest topics, spanning multiple ballots and several proposals.
One thing we made clear in the list from early on was that
we were only considering the generative extension to SRFI 9,
because you could then use the syntactic API to implement
a procedural API. Thus, our `define-record-type' is not some
static, top-level class definition, but a way to introduce new
lexical types. To make these unhygienic is just not acceptable.
As my earlier post implies, it's not clear what the semantics of SRFI 99
are in this respect, since it says field names are identifiers and does
not mention their role as symbols.
define-record-type
syntax specified bydefine-record-type
syntax." For reasons mentioned
The field names are used in the constructor to match which
fields are initialized. I have to go out now, but if you can't think
of how hygiene could break here I'll provide a concrete example
later.
And I've removed it. Even if you could convince me we
wanted to make this unhygienic, it's too big a change to make
as an erratum. Errata should only be mistakes which would
clearly be broken if not addressed, and require unanimous
agreement from the WG1 members. If the WG2 members
need to make semantic changes at this late point in the
game, they need to maintain their own list of extensions or
incompatibilities to the small language.
To answer Marc's original question, I don't see the problem
with extending SRFI 131 to allow identifiers as field names.
If implementations don't agree on the semantics of R7RS-small records, it would make no difference to include such a thing in an erratum or not. Without agreement, as a macro writer I simply have to carefully choose names that are distinct as symbols and are distinct as identifiers, which is the least common denominator. So if, say, Chibi and Larceny (I haven't tested other implementations yet), remain contradictionary, it makes more sense to specify it as undefined behaviour, namely whether the names are matched as symbols or identifiers.
If field names are identifiers, they have to be exportable so that record types that extend the original record type are able to access them (they want to mention them in their constructor). So SRFI 131's define-record-type would have to bind all field names in the outer scope, which is in contrast to R7RS-small records (and SRFI 9 and SRFI 99 records).
If field names are identifiers, they have to be exportable so that record types that extend the original record type are able to access them (they want to mention them in their constructor). So SRFI 131's define-record-type would have to bind all field names in the outer scope, which is in contrast to R7RS-small records (and SRFI 9 and SRFI 99 records).
The R7RS (small) semantics must have been adopted without giving
any thought to the possibility of adding inheritance as in SRFI 99 and
SRFI 131. If WG2 wants extensible records (with inheritance) in R7RS
large, we will have to overturn this one-word detail of R7RS section 5.5.
I believe WG2 should and will add extensible records, reverting to the
field name semantics of SRFI 99 and 131 as it does so. That is why
Larceny's implementation of R7RS define-record-type will remain
compatible with those SRFIs for the time being, and incompatible
with that one word of R7RS section 5.5.
--Will
You received this message because you are subscribed to a topic in the Google Groups "scheme-reports-wg2" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scheme-reports-wg2/oKuhgwaM45w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scheme-reports-...@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to scheme-reports-wg2+unsub...@googlegroups.com.
> We could seek to clarify that by reading the rest of SRFI 99, by
> examining its reference implementation, and by considering its
> use in practice. As a last resort, we could question the author
> of SRFI 99, whose opinion would be at least as authoritative
> with respect to SRFI 99 as (say) the opinion held by one of the
> three editors of R7RS (small) with respect to that document.
Digression: I don't claim to be an authoritative interpreter of that
document, but I deny (on general principle) that the author of a document
is an authority on its meaning either. At most the author can say what
the authorial intent was, but authorial intent cannot supersede what
lawyers call the plain meaning of a document. I've been down this road
before with Doug Crockford and the JSON RFC. He found it very difficult
to accept that what he says now that he meant when he wrote that RFC
doesn't control its interpretation.