Re: [sv-bc] Namespace issue w. struct/union member names?


Subject: Re: [sv-bc] Namespace issue w. struct/union member names?
From: Arturo Salz (Arturo.Salz@synopsys.com)
Date: Wed Oct 29 2003 - 14:46:18 PST


Steve,

In my response I assumed that Nikhil's question meant declaring a
variable x in the same scope as a struct declaration that includes a
member x (as you point out). I can see why someone might have
interpreted the question differently, but since declaring a variable
inside a struct is not possible, I never assumed that interpretation.
Thanks for the clarification. I think we are in full agreement.

    Arturo

----- Original Message -----
From: "Steven Sharp" <sharp@cadence.com>
To: <nikhil@bluespec.com>; <sv-bc@eda.org>; <Arturo.Salz@synopsys.COM>
Sent: Wednesday, October 29, 2003 2:25 PM
Subject: Re: [sv-bc] Namespace issue w. struct/union member names?

>- Can we have a struct member called 'x' in the same scope as
> something else named 'x' (say, a variable)?
>[Arturo] Yes.

Actually, if you consider a struct to be a scope, then this isn't
possible. You can't declare a variable inside a struct, you can
only declare struct members. And you can't declare two members
with the same name in the same struct (i.e. scope).

But you could declare a variable named x in the same scope as a
struct which had a member named x inside it.

This may have been clear already, but I wanted to avoid confusion.

Steven Sharp
sharp@cadence.com



This archive was generated by hypermail 2b28 : Wed Oct 29 2003 - 14:49:43 PST