Re: draft-gregorio-uritemplate-02.txt

Manger, James H wrote:
> ยง3.4: Using a variable that is a list of strings in a template that
> expects a single string is undefined. The first 'join' example
> inserts (escaped) commas - but there is no explanation of where they
> came from.

The commas came from the variable: the value of 'data' is not a list, 
but a literal string "10,20,30".

                     +----------+--------------------+
                     | Name     | Value              |
                     +----------+--------------------+
                     | a        | foo                |
                     | b        | bar                |
                     | data     | 10,20,30           |
                     | points   | ["10","20", "30"]  |
                     | list0    | []                 |
                     | str0     |                    |
                     | reserved | :/?#[]@!$&'()*+,;= |
                     | u        | \u2654\u2655       |
                     | a_b      | baz                |
                     +----------+--------------------+

The table is ambiguous, some of these are to be interpreted as string 
values (including Unicode escaping), and two of them as lists using 
Python syntax, but the reader must intuit this by pure instinct.

Perhaps it would be clearer to quote all the strings, or add a column 
to the table indicating type, or just avoid Python syntax altogether:

     a        the string "foo"
     data     the string "10,20,30"
     points   a list containing the three strings "10", "20", and "30"
     list0    the empty list
     str0     the empty string
     u        the string consisting of U+2654 followed by U+2655

-- 
Michaeljohn Clement

Received on Wednesday, 28 November 2007 02:18:26 UTC