Filip Konvička wrote:

Kevin Glynn wrote:

I attach an expanded patch that also adds a compiler switch
(warnshadow). The patch checks for shadowings in the local environment
and the top level environment (see warnredecl).  Documentation isn't
fixed yet.


That's good news!  But...

Unfortunately there are still a few wrinkles, e.g.:

  local X in try {Show h} finally {Show e} end end

gives that X is shadowed, due to the expansion of finally.  there
are probably a few cases like this.


To me that should be considered a bug in the expansion of finally! Do you think you can fix the expansion to avoid that clash? Expansion of language constructs should always use brand new identificators...


Yes, the problem seems to be at Unnester.oz:2418, but the code is not commented so I could not find a quick solution to this other than renaming the variable from X to say Unnester_oz_2418_Exception_Pattern ;-)

This variable contains the exception itself so that it can be re-raised after the finally block.

It should be possible to use

import
BootName(newNamed) at 'x-oz://boot/Name'

...

FX = fVar({BootName.newNamed 'X'} C)

functor
import
   RecordC(width: WidthC)
......

reports WidthC to be shadowed.


This is correct if WidthC is available in the base environment. Otherwise it's a bug.

However,  I think the option is great and will help a lot.  Lets get
rid of

  case S of suspended(S) then {Deref S} else S end

forever!


I agree. But it must at least be correct, otherwise it will be more irritating than useful! This thing looks much more useful than the detection of unused identifiers, which I personally find irritating...


Well, it is rather irritating, but sometimes it would help find some shadowing problems. Which should be history now :-)

It's also the only warning we get if we do something like:
local
  local
     SomeId
  in
     SomzId={Browse}
  end
in
  skip
end

Cheers,
Yves

_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to