[sv-bc] comments on array literal section

From: Paul Graham <pgraham_at_.....>
Date: Tue Apr 19 2005 - 15:03:13 PDT
I'm looking at the p1800 draft 4, section 3.7 on Array
Literals.  A few comments:

1) The section begins:

    Array literals are syntactically similar to C
    initializers, but with the replicate operator ( {{}} )
    allowed.

But then it gives literals with the '{} syntax, which is not
similar to the C initializer syntax.  This raises questions
in the reader's mind, which are not resolved until section
8.13.  That's a long time to keep someone in suspense.  Why
not say that array literals (and struct literals) resemble C
initializers except that they include an apostrophe prefix.

Also, doesn't a replicate operator within an array or struct
literal also require the apostrophe prefix?  So this should
also be mentioned in the first sentence of this section.

2) If '{1, 2, 3} is considered a literal, then why isn't an
ordinary bitvector concatenation considered a literal?  In
fact, given the complexity of array and struct assignment
patterns, I don't think that section 3.7 is really the place
for them.  Is there some special reason for including array
and struct literals in chapter 3?  I also notice that the
syntax for array and struct literals isn't even given in
the syntax box at the top of chapter 3.

Paul
Received on Tue Apr 19 15:03:19 2005

This archive was generated by hypermail 2.1.8 : Tue Apr 19 2005 - 15:03:52 PDT