On 23/03/2012 10:10 PM, Steven Blenkinsop wrote:
mentioned yet – which is the following case: [str/10]. What type is
this? Of course you could make it a fixed size vector of 10 strings, and
make [(str/10)] be a slice of fixed size string of 10 bytes, but I think
the ambiguity is worth considering before introducing it.
Ah, good catch. I guess, to disambiguate, we'd need fixed-size vec types
to be [int]/10 then. Which is good, because it acquires symmetry with
the literal form; but it's getting less and less appealing-looking.
Visual survey time:
disambiguated proposal: [int]/10 str/10
[1,2,3]/_ "hi"/_
(still, I think, my preference)
Other possibiltiies:
different suffixes for str vs. []: [int x 10] str/10
[int/10] str[10]
[int x 10] str[10]
[int * 10] str<10>
same suffix, some other choice: [int].10 str.10
[int]'10 str'10
[int]#10 str#10
[int]!10 str!10
[int]%10 str%10
[int]^10 str^10
[int]|10 str|10
[int]*10 str*10
... or prefixes: 10.[int] 10.str
10'[int] 10'str
10#[int] 10#str
10![int] 10!str
10%[int] 10%str
10^[int] 10^str
10|[int] 10|str
10*[int] 10*str
straight juxtaposition: [int] 10 str 10
[int] _ str _
10 [int] 10 str
trailing brackets: [int]<10> str<10>
[int]<_> str<_>
[int](10) str(10)
[int](_) str(_)
[int][10] str[10]
[int][_] str[_]
[int]{10} str{10}
[int]{_} str{_}
C-style numbers in square brackets: int[] str
int[10] str(10)
... or as prefixes (Go-style): []int str
[10]int (10)str
switch vec to a named tycon: vec[10]<int> str[10]
vec[_]<int> str[_]
vec<int> str
Keep in mind, any such syntax needs to handle:
- 'Slice' case for type, literal and pattern syntaxes
- 'Referent' explicit fixed-size case for same
- 'Referent' implicit fixed-size (counting elements) literals
Suggestions welcome. I still think the /N version offends my eyes the
least, but this whole page is a bit tragic to behold. Maybe the
trailing-() version is also .. tolerable?
-Graydon
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev