Re: [sv-bc] explicit package exports

From: Brad Pierce <Brad.Pierce_at_.....>
Date: Wed Sep 13 2006 - 15:12:11 PDT
The keyword 'local' could be used for data hiding, as in 7.17.

-- Brad

-----Original Message-----
From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of
Steven Sharp
Sent: Wednesday, September 13, 2006 2:25 PM
To: sv-bc@eda.org
Subject: [sv-bc] explicit package exports

If we add some new syntax to control exporting symbols imported into a
package, it seems like we would want to leverage it to control exporting
symbols declared in the package also.  There may be some local symbols
that should not be visible outside the package.

The default must remain that everything in the package is exported, for
backward compatibility.  That is probably also the most commonly desired
case.  But it may be possible to keep implicitly exporting everything
declared in the package by default, while still allowing explicit
control of exporting declarations if desired.

I can see a couple of possible rules for doing this:

1. The default is only used if there are no explicit exports in the
   package.  As soon as any explicit exports are used, there are no
   implicit exports.  The only symbols exported are those that are
   explicitly exported.
   
2. The default is only used if there are no explicit exports of symbols
   local to the package.  If any symbols local to the package are
   explicitly exported, then those are the only ones exported.  So
   the default for imported symbols is that none are exported unless
   there is an explicit export for that package, in which case only the
   specified symbols are exported.  The default for local symbols is
   that all are exported unless there is an explicit export for that
   package, in which case only the specified symbols are exported.

Steven Sharp
sharp@cadence.com
Received on Wed Sep 13 15:12:21 2006

This archive was generated by hypermail 2.1.8 : Wed Sep 13 2006 - 15:12:26 PDT