Changes between Version 2 and Version 3 of CompleteSequenceCowan


Ignore:
Timestamp:
08/27/10 09:16:38 (7 years ago)
Author:
cowan
Comment:

Added tables

Legend:

Unmodified
Added
Removed
Modified
  • CompleteSequenceCowan

    v2 v3  
    11The 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: 
    22 
    3 ||Type of procedure||Lists||Strings||Vectors|| 
    4 ||Basic constructor||`make-list` (SRFI 1)||`make-string`||`make-vector`|| 
    5 ||Variadic constructor||`list`||`string`||`vector`|| 
    6 ||Copy constructor||`copy-list` (SRFI 1)||`copy-string`||`copy-vector` (SRFI 43)|| 
    7 ||Basic predicate||`list?`||`string?`||`vector?`|| 
    8 ||Sequence length||`length`||`string-length`||`vector-length`|| 
    9 ||Element access?||`list-ref`||`string-ref`||`vector-ref`|| 
    10 ||Element mutator||`list-set!` (proposed)||`string-set!`||`vector-set!`|| 
    11 ||Map function||`map`||`string-map` (SRFI 13 extended)||`vector-map` (R6RS)|| 
    12 ||Map side effects||`for-each`||`string-for-each` (proposed)||`vector-for-each` (R6RS)|| 
    13 ||Convert to list||---||`string->list`||`vector->list`|| 
    14 ||Convert to string||`list->string`||---||`vector->string` (proposed)|| 
    15 ||Convert to vector||`list->vector`||`string->vector` (proposed)||---|| 
     3||Type of procedure||Lists||Strings||Vectors||Tables|| 
     4||Basic constructor||`make-list` (SRFI 1)||`make-string`||`make-vector`||`make-table`|| 
     5||Variadic constructor||`list`||`string`||`vector`||`table`|| 
     6||Copy constructor||`copy-list` (SRFI 1)||`copy-string`||`copy-vector` (SRFI 43)||`copy-table`|| 
     7||Basic predicate||`list?`||`string?`||`vector?`||`table?`|| 
     8||Sequence length||`length`||`string-length`||`vector-length`||`table-length`|| 
     9||Element access?||`list-ref`||`string-ref`||`vector-ref`||`table-ref`|| 
     10||Element mutator||`list-set!` (proposed)||`string-set!`||`vector-set!`||`table-set!`|| 
     11||Map function||`map`||`string-map` (SRFI 13 extended)||`vector-map` (R6RS)||`table-map`|| 
     12||Map side effects||`for-each`||`string-for-each` (proposed)||`vector-for-each` (R6RS)||`table-for-each`|| 
     13||Convert to list||---||`string->list`||`vector->list`||`table->list`|| 
     14||Convert to string||`list->string`||---||`vector->string` (proposed)||---|| 
     15||Convert to vector||`list->vector`||`string->vector` (proposed)||---||---|| 
     16||Convert to table||`list->table`||---||---||---|| 
    1617 
    1718In summary: 33 procedures, 23 in R5RS, 2 in R6RS, 2 in SRFI 1, 1 in SRFI 43, 1 in SRFI-13 but extended to take multiple strings, 4 novel but obvious. 
    1819 
    1920I further propose that the map and for-each groups should be specified to implicitly truncate all sequence arguments to the length of the shortest sequence. 
     21 
     22Update: I have added an additional row and column to this table that reflects the TablesCowan proposal.