chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-janitors] #1376: hide/block-global declaration doesn't hide


From: Chicken Trac
Subject: Re: [Chicken-janitors] #1376: hide/block-global declaration doesn't hide exports
Date: Sun, 28 May 2017 10:04:46 -0000

#1376: hide/block-global declaration doesn't hide exports
---------------------------------+---------------------
            Reporter:  megane    |      Owner:
                Type:  defect    |     Status:  new
            Priority:  minor     |  Milestone:  someday
           Component:  compiler  |    Version:  5.0
          Resolution:            |   Keywords:  modules
Estimated difficulty:  medium    |
---------------------------------+---------------------
Changes (by sjamaan):

 * priority:  major => minor
 * difficulty:   => medium
 * version:   => 5.0


Comment:

 Hide does not operate at the module level; it is a way to tell the
 compiler "you're free to inline this or drop the procedure altogether". It
 declares the procedure only needs to be visible from the current
 compilation unit.  It is more like C's {{{static}}} function declaration
 than a module construct.

 I guess the {{{hide}}} declaration sort of "conflicts" with a module
 export, because a module export declares that a procedure is a) visible
 outside the compilation unit and b) can be imported into a module's
 namespace. Basically, a procedure as hidden while at the same time trying
 to export it from a module is "nonsense".

 Finally, the {{{hide}}} declaration is not scoped, so it should really
 read {{{(declare (hide m1#foo m1#bar))}}} to have the "intended" effect.
 The hide declaration effectively ignores undefined variables.

 Having said all that, I think we should either error/warn about this
 situation or attempt to indeed do what you think it would do: hide the
 procedure instead of exporting it (but that would require changing
 declarations so they respect module scope).

 So unless you're interested in making a patch for this, I'm afraid it will
 probably be done sometime in the 5.2 or 5.3 release, or even later.

--
Ticket URL: <https://bugs.call-cc.org/ticket/1376#comment:1>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]