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

[Scheme-reports] Sequence to sequence conversion

The R5RS has the following sequence to sequence conversion procedures:

   list->string, and string->list
   list->vector, and vector->list

The R7RS is adding bytevector sequences, but it does not add the conversion procedures:

   list->bytevector, and bytevector->list

What is the rationale for this inconsistency?

Moreover, the R7RS is adding only the first set of these conversion procedures:

   vector->string, and string->vector
   bytevector->string, and string->bytevector  (not in R7RS)
   vector->bytevector, and bytevector->vector  (not in R7RS)

yet for consistency they should be added.  Why is the conversion between vectors and strings priviledged by the standard?

Personnaly, I think these conversion procedures should not be added to the standard because for consistency, any sequence types added by an implementation of Scheme (or future standard) would require N^2 conversion procedures.  Only the conversions to and from lists should be specified, and a "sufficiently intelligent compiler" can handle compositions such as

   (list->string (vector->list v))

like the proposed (vector->string v), if performance is an issue.


Scheme-reports mailing list