Re: [Scheme-reports] define-record-type queries Andre van Tonder (05 May 2011 14:23 UTC)
Re: [Scheme-reports] define-record-type queries Aaron W. Hsu (05 May 2011 15:22 UTC)
Re: [Scheme-reports] define-record-type queries Andre van Tonder (05 May 2011 15:53 UTC)
Re: [Scheme-reports] define-record-type queries Aaron W. Hsu (05 May 2011 15:25 UTC)

Re: [Scheme-reports] define-record-type queries Andre van Tonder 05 May 2011 14:23 UTC

On Thu, 5 May 2011, leppie wrote:

> Hi
>
> Sorry in advance, if this has been discussed already.
>
> DEFINE-RECORD-TYPE as in the small language does not support
> inheritance. I assume inheritable records will be part of the larger
> language.
>
> The question is how this will be implemented:
> - Will DEFINE-RECORD-TYPE be extended in the large language? (If so, how?)
> - Will there be a new syntax, ie DEFINE-SUPER-RECORD-TYPE that accepts
> the base record type as a parameter?
> - Will the record types be compatible (or rather should it be) with each other?
>
> Secondly is the name part of the record. The draft says:
>
> <name> is bound to a representation of the record type
> itself, possibly as a syntactic form.
>
> I think this needs to be completely unambiguous as it will break portability.

Yes, and I think it is also important to know if the symbolic value of the name
matters.  It is possible to make two definitions with the same symbolic name
representing two different identifiers.  This happens a lot in macro-generated
code.  For example

   (define-syntax mydefs
     (syntax-rules ()
       ((_ x)
        (begin
          (define-record-type y ........)   ; e.g., internal auxiliary type
          (define-record-type x ........))))

   (let ()
     (mydefs y))

The expansion of the LET body will now introduce two record types, both of which
have type-name y symbolically (but as identifiers they differ).  Will this
be a problem?

The same goes for the field names.  Are they compared as identifiers or as
symbols?  Again, macro-generated code might generate two field names that
are the same symbol but different identifiers.  Would this be a problem?

Andre

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports