On 24 Sep 2009, at 3:00 pm, Michael Lenaghan wrote:

>> Now, I do see your argument for giving Scheme just a very low-level
>> data storage abstraction and letting things be built on top of it -
>> but that's an implementation technique, not a specification issue.
>
> Something like define-vector-type allows a Scheme implementation to do
> no worse than it would otherwise (ie, simply use a general vector) but
> potentially much better. That seems to be as much of an implementation
> technique as, say, fixnums vs bignums.

Not entirely. "fixnum vs. bignum" says important things about what
happens when your application encounters numbers more than 30 bits or
so (as many implementations are still 32-bit, minus a couple of tag
bits), which is an important issue for users. Not that the difference
between fixnunms and bignums should be exposed; what's at stake in our
discussions here is whether implementations can limit the numbers they
can natively represent to +/- 2^29 and still call themselves Scheme.

Now, a general fixed-width vector/struct type constructor (it's a good
idea if they're merged, so you can have vectors of structs some of
whose members are vectors, and so on) is a useful facility, but it
needn't be in the core of a language.

It might be in the core of an *implementation*, but that's an entirely
different matter.

Look at it this way - what I'd like is for the language core to
mandate strings, vectors, lists, and records a la srfi-9 (I think the
latter are a fundamental thing to have, since they can create new
types that don't answer to pair? or vector? or procedure? or anything
else etc). And I'd like things like srfi-4 to be available as an option.

Then an implementation may choose to provide define-vector-type, and
it may choose to make define-vector-type its basic underlying
representation for pairs and vectors and srfi-4 vectors, but that's up
to it. There's no reason to mandate it in a standard.

You're making a great case for basing an implementation on an
underlying data model! And a great case for providing a standard
interface to a generic vectory-data-structures model that would
provide a superset of the functionality of srfi-4! These are all great
things! But the former belongs in an implementation, and the latter
belongs in an SRFI, IMHO...

ABS

--
Alaric Snell-Pym
Work: http://www.snell-systems.co.uk/
Play: http://www.snell-pym.org.uk/alaric/
Blog: http://www.snell-pym.org.uk/archives/author/alaric/




_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to