Re: [sv-bc] question on str.putc()

From: Surrendra Dudani <Surrendra.Dudani@synopsys.com>
Date: Fri Oct 15 2004 - 10:02:37 PDT
Hi Shalom,
I think the note str[j] = x is referring to
 task putc(int i, byte c)
and not to
task putc(int i, string s)
Although the rules of assignment are not explicitly specified in this section, it seems to me that a string cannot be assigned to a character of another string.
str[j] = x, when x is a string variable.

Surrendra

At 02:11 PM 10/15/2004 +0200, you wrote:
I apologize if this was already brought up.

3.7.2 putc() says that

str.putc(i,s) replaces the i'th character in str with the first character in s.

Then it says,

Note: str.putc(j,x) is semantically equivalent to str[j] = x.

My question, I would think that str[j] = x takes the LAST, not FIRST,
character if x is a string, as in the example

bit[1:4][7:0] h = "hello"; //assigns to h "ello"

Thanks,
Shalom

--
Shalom Bresticker                        Shalom.Bresticker @freescale.com
Design & Verification Methodology                    Tel: +972 9  9522268
Freescale Semiconductor Israel, Ltd.                 Fax: +972 9  9522890
POB 2208, Herzlia 46120, ISRAEL                     Cell: +972 50 5441478
 
[ ]Freescale Internal Use Only      [ ]Freescale Confidential Proprietary



**********************************************
Surrendra A. Dudani
Synopsys, Inc.
377 Simarano Drive, Suite 300
Marlboro, MA 01752

Tel:   508-263-8072
Fax:   508-263-8123
email: Surrendra.Dudani@synopsys.com 
********************************************** Received on Fri Oct 15 10:02:43 2004

This archive was generated by hypermail 2.1.8 : Fri Oct 15 2004 - 10:02:54 PDT