RE: [sv-bc] Ballot issue 11/Mantis 2665 - are compilation unit imports re-exported

From: Francoise Martinolle <fm_at_.....>
Date: Mon May 11 2009 - 13:35:47 PDT
 
I also agree with Gordon. No action is required on this ballot comment,
except perhaps
adding a link to the mantis item to this email posting.

Francoise
    '
-----Original Message-----
From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of
Gordon Vreugdenhil
Sent: Monday, April 27, 2009 11:55 AM
To: SV_BC List
Subject: [sv-bc] Ballot issue 11/Mantis 2665 - are compilation unit
imports re-exported

The ballot issue uses the example:

    package P;
       integer r;
    endpackage

    import P::*; // P is imported in compilation unit scope

    module top;
       integer s = $unit::r; // 'r' refers to the declaration in package
P
                             // imported in compilation unit scope
    endmodule


The question is (essentially) whether imports into the compilation unit
are implicitly re-exported.

This question is directly related to Issue 10/Mantis 2664.  See me
comments on that item first.

I don't think that this is the correct view at all.  The compilation
unit is simply a lexical scope so all identifiers visible in that scope
are lexically resolved in a normal manner.  The $unit::r is simply a
naming mechanism to get at the scope (since it is otherwise anonymous).
The "::" syntax here is a bit misleading as it reinforces the view of
$unit as a package (which it is not).
It might have been an idea to use "." rather than "::" but that would
have suggested an even worse view -- that such references are
hierarchical (and might allow arbitrary forward references).
That is clearly not the intent; 3.12.1 has:
    The use of an explicit $unit:: prefix only provides for
    name disambiguation and does not add the ability to refer
    to later compilation unit items.


Gord.

--
--------------------------------------------------------------------
Gordon Vreugdenhil                                503-685-0808
Model Technology (Mentor Graphics)                gordonv@model.com


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon May 11 13:39:33 2009

This archive was generated by hypermail 2.1.8 : Mon May 11 2009 - 13:39:45 PDT