[Top][All Lists]

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

Re: A couple of questions about goops method parameters

From: Panicz Maciej Godek
Subject: Re: A couple of questions about goops method parameters
Date: Fri, 5 Sep 2014 22:37:49 +0200

2014-09-05 22:18 GMT+02:00 Taylan Ulrich Bayirli/Kammer
> Panicz Maciej Godek <address@hidden> writes:
>> [...] I think that it is a big problem of Scheme, that it does not
>> have any noncontroversial and commonly accepted way for creating named
>> tuples.
> Does SRFI-9 not count because it creates tuple *types* and doesn't
> support immediate creation of tuples of an "anonymous type"?  (Could be
> an interesting feature, though not sure how useful in the end.)  Or do
> you just not consider SRFI-9 to be commonly accepted?  AFAIK it's pretty
> widely implemented, and for the record(!) it's been standardized as a
> part of R7RS-small.

There are a few issues here. The fact that it is impossible to create
anonymous type is one thing. Another is that each record type
introduces accessor bindings to a global namespace. In case of Elm,
one could write
mario = { x = 0, y = 0, dx = 0, dy = 0 }
and then access the fields with the dot notation, i.e. mario.x

There are other representations (like basket list or assoc list) that
avoid that problem, but they generate other ones -- namely, that the
access times get linear, and in case of assoc lists there is a huge
overhead of data, and in case of basket lists one needs to pass around
additional information regarding the names of subsequent fields.

And the sole fact that there are other reasonable represetations leads
to the conclusion that none is commonly accepted.

(Actually I think the nicest solution I've seen was in Erlang, but
unfortunately it wouldn't go well with Scheme)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]