roxen.lists.pike.general

Subject Author Date
Re: Pike 7.8.300 beta Henrik Grubbström (Lysator) @ <6341[at]lyskom[dot]lysator[dot]liu[dot]se> 17-06-2009
>Taking a first look at Pike 7.8.300, I found a flaw (in comparison to
>7.6.112) with XML DOM parser:
[...]
>I don't know if this effect is wanted in Pike 7.8 ?
>If yes, the DOM module is broken and might require some changes.
>If no, we might have a problem with the compiler in 7.8 :-(

Interesting problem:

  class A
  {
    int foo = 1;
  
    int a()
    {
      return foo;
    }
  }
  class B
  {
    static int foo = 2;	// Use static for compat with old pikes.
  
    int b()
    {
      return foo;
    }
  }
  class C
  {
    inherit A;
    inherit B;
  
    int c()
    {
      return foo;
    }
  }

In current Pike 7.8:

  C()->foo: UNDEFINED
  C()->a(): 1
  C()->b(): 2
  C()->c(): 2

In Pike 7.2, 7.4, 7.6 and old 7.7:

  C()->foo: 1
  C()->a(): 1
  C()->b(): 2
  C()->c(): 2

Note that both of the above behaviours are a bit strange; in the old
pikes the symbol "foo" represents two different variables when used
from inside the class C and when indexed from outside. In Pike 7.8
the protected (aka static) symbol "foo" from B hides the one from A.

>Greetings,
>Reinhard.