This site is a static rendering of the Trac instance that was used by R7RS-WG1 for its work on R7RS-small (PDF), which was ratified in 2013. For more information, see Home.

Source for wiki CompleteSequenceCowan version 1

author

cowan

comment


    

ipnr

98.14.172.204

name

CompleteSequenceCowan

readonly

0

text

The WG1 charter says "Self consistency is an important objective, which may require adding new features."  Scheme has three sequence types: lists, strings, and vectors, but the support for them is not consistent.  Lists have the most support, strings and vectors have much less, and inconsistently so.  I propose providing the following procedures, some of which are R5RS, some R6RS, some in various SRFIs, and some new:

||Type of procedure||Lists||Strings||Vectors||
||Basic constructor||`make-list` (SRFI 1)||`make-string`||`make-vector`||
||Variadic constructor||`list`||`string`||`vector`||
||Copy constructor||`copy-list` (SRFI 1)||`copy-string`||`copy-vector` (SRFI 43)||
||Basic predicate||`list?`||`string?`||`vector?`||
||Sequence length||`length`||`string-length`||`vector-length`||
||Element access?||`list-ref`||`string-ref`||`vector-ref`||
||Element mutator||`list-set!` (proposed)||`string-set!`||`vector-set!`||
||Map function||`map`||`string-map` (proposed)||`vector-map` (SRFI 43)||
||Map side effects||`for-each`||`string-for-each` (proposed)||`vector-for-each` (SRFI 43)||
||Convert to list||---||`string->list`||`vector->list`||
||Convert to string||`list->string`||---||`vector->string` (proposed)||
||Convert to vector||`list->vector`||`string->vector` (proposed)||---||

In summary: 33 procedures, 23 in R5RS, 2 in SRFI 1, 3 in SRFI 43, 5 novel but obvious.

time

2010-05-03 01:26:15

version

1