[sv-bc] RE: [sv-ec] Package export proposal (2 alternatives)

From: Stuart Sutherland <stuart_at_.....>
Date: Mon Sep 25 2006 - 08:21:18 PDT
I favor alternative 1.  I think it makes code more self documenting, and
helps prevent a user having to search through multiple packages to figure
out where an actual declaration resides.  

As an aside, and as a suggestion, I hope tool vendors will provide some sort
of switch to report where all definitions were found once elaboration is
complete.  This would be similar to what some tools have done for when
multiple -v or -y source libraries are used.  Such reporting should not be a
requirement of the standard, but certainly would influence me, as a user, on
how much I like to use certain tools.

Is there a bug in one of the example comments?  In the first example of
package p3, I don't understand the comment:
  // p1::x and q are made available from p2. 

Since q is only defined in p3, it seems to me that q is only available from
p3, rather than p2.

Stu
~~~~~~~~~~~~~~~~~~~~~~~~~
Stuart Sutherland
stuart@sutherland-hdl.com
+1-503-692-0898
  

> -----Original Message-----
> From: owner-sv-ec@server.eda.org 
> [mailto:owner-sv-ec@server.eda.org] On Behalf Of Gordon Vreugdenhil
> Sent: Monday, September 25, 2006 7:45 AM
> To: SV_BC List; SV_EC List
> Subject: [sv-ec] Package export proposal (2 alternatives)
> 
> I've uploaded 2 variants of the package export proposal to Mantis
>     http://www.verilog.org/svdb/bug_view_page.php?bug_id=0001323
> 
> The proposals incorporate Brad's formatting and removal of the
> unnumbered paragraph headings.
> 
> The 2 alternatives differ in how named exports are handled.
> In particular, if you have:
>     export p1::x;
> Does the declaration of "x" in "p1" need to be visible via
> an import of "p1" or is it acceptable to have the export
> be legal as long as "p1::x" is visible via some export from
> another package that is imported?
> 
> The "alt1" proposal has the sentence:
>     The declaration being exported must be imported from the same
>     package_name used in the export.
> 
> The "alt2" proposal has the sentence:
>     The declaration is not required to be imported from the 
> package_name
>     of the export as long as some import has made the 
> declaration available.
> 
> The examples in "alt1" have been modified to reflect the tighter
> rule; the "alt2" proposal keeps the examples in the form of the
> earlier proposal.
> 
> 
> I am fine with either approach.  "alt2" is a bit more subtle in
> terms of how names flow and when an import is required.  "alt1"
> would be a bit more pedantic in some cases but makes the
> symmetry between import and export more explicit.
> 
> Gord.
> -- 
> --------------------------------------------------------------------
> Gordon Vreugdenhil                                503-685-0808
> Model Technology (Mentor Graphics)                gordonv@model.com
> 
> 
Received on Mon Sep 25 08:21:26 2006

This archive was generated by hypermail 2.1.8 : Mon Sep 25 2006 - 08:21:33 PDT