Re: [sv-bc] Result type of string indexing?


Subject: Re: [sv-bc] Result type of string indexing?
From: Arturo Salz (Arturo.Salz@synopsys.com)
Date: Tue Feb 10 2004 - 10:20:15 PST


Nikhil,

I agree with your comments. I have two suggestions.

1) To the paragraph below:
    "Variables of type string can be indexed from 0 to N-1 ..."
Add
    "Reading one element of a string yields a byte"

2) Change the paragraph below:
    
    "str.getc(j) is identical to str[j]"
To
    "str.getc(j) is semantically equivalent to str[j]"

  Arturo

----- Original Message -----
From: "Rishiyur S. Nikhil" <nikhil@bluespec.com>
To: "Sv-Bc" <sv-bc@eda.org>
Sent: Tuesday, February 10, 2004 9:11 AM
Subject: [sv-bc] Result type of string indexing?

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 - 10:22:25 PST