[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why generative?

This page is part of the web mail archives of SRFI 99 from before July 7th, 2015. The new archives for SRFI 99 contain all messages, not just those from before July 7th, 2015.



From: Thomas Bushnell BSG <tb@xxxxxxxxxx>
Subject: Re: why generative?
Date: Thu, 03 Sep 2009 12:28:08 -0700

> On Thu, 2009-09-03 at 09:19 -1000, Shiro Kawai wrote:
> > In most programming languages programmers do give unique names
> > to the different record types with same field specs.  I assume
> > we can ask that much of work to the programmer's side if she
> > wishes to have distinct types.
> 
> In most programming languages programmers also give unique names to
> different procedures.  Scheme is not like that, thank the stars.
> 
> You are assuming that the only value of records is to be like C structs.
> Feh!

That's a misunderstanding.  I meant programmers *could* give
distinct names to the types, especially globally defined ones,
even if they could have anonymous types.   I believe Scheme
programmers usually use globally defined procedures with
distinct names even if they can have anonymous functions.

The procedural layer gives you anonymous types.  Syntactic layers,
both srfi-99 and r6rs, do ask you to name the record type.

The default-generative make-rtd with opt-in nongenerative type
with uid, as defined in R6RS, mandates you to *name* the type
if you simply want to use locally-defined record types to group
values; failing to do so tax you allocation of fresh type
descriptors every time make-rtd is invoked.  Compare it with
anonymous procedures without closing local variables; you can
assume a decent implementation will lift the lambda and avoid
allocating fresh procedures every time.

But that problem is a kind of trade-off, as Will and I discussed.

I see the separate namespace more serious problem.

--shiro