[sv-bc] Result type of string indexing?


Subject: [sv-bc] Result type of string indexing?
From: Rishiyur S. Nikhil (nikhil@bluespec.com)
Date: Tue Feb 10 2004 - 09:11:40 PST


In Section 3.7, para 4, it says:

     "Variables of type string can be indexed from 0 to N-1 ..."

Is the intended result type "int"?

Sec 3.7.3 says that str.getc() has type int, and that

     "x = str.getc(j) is identical to x = str[j]"

but that is not the same thing as saying

     "str.getc(j) is identical to str[j]"

since the assignment may be doing a coercion, i.e.,
str[j] could return a string, a byte, an int, ...

Should string indexing be added as a row in Table 3-2?

Nikhil



This archive was generated by hypermail 2b28 : Tue Feb 10 2004 - 09:18:57 PST