RE: [sv-bc] Importing a enum from a package don't import enum variable??

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Sat Mar 10 2007 - 11:06:13 PST
Arturo,

I think Adam meant that normally one should wildcard import the package
items. You are pointing out that there are cases where that does not
import all the items.

However, your solution does not solve those problems. 

You still cannot explicitly import an item (e.g., pack::item1) if the
same name is explicitly declared in the importing scope. Trying to do so
generates an error.

The same problem occurs if you explicitly try to import the same name
from different packages.

If you do use wildcard imports, then if the same name is declared in
more than one imported package, that name will not be imported. Then you
can use an explicit import to import the name from one of the packages,
but you have to choose one of them.

I think.

Shalom


> -----Original Message-----
> From: Arturo Salz [mailto:Arturo.Salz@synopsys.com]
> Sent: Friday, March 09, 2007 8:30 PM
> To: Adam Krolnik; Bresticker, Shalom; Sonjoy Mondal; sv-bc@eda.org
> Subject: RE: [sv-bc] Importing a enum from a package don't import enum
> variable??
> 
> Adam,
> 
> I agree that importing all items in the package is the safest scheme.
> Unfortunately, to do that, users must explicitly import every item
> using
> something like:
> 	import pack::item_1;
> 	import pack::item_2;
> 	...
> 	import pack::item_N;
> This is because the wildcard syntax does not guarantee that all items
> declared in the package will be imported; if any one of the package
> identifiers is declared in the importing scope (or explicitly imported
> from another package) the corresponding item is silently not imported.
> I've always felt that the wildcard mechanism is fragile, but not
> enough
> people in the committee agree with this. BTW, I recommend explicitly
> using the fully qualified name (including the package name) in the
> code.
> That may be more verbose but avoids any confusion.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Sat Mar 10 11:06:34 2007

This archive was generated by hypermail 2.1.8 : Sat Mar 10 2007 - 11:06:59 PST