pike.git / CHANGES

version» Context lines:

pike.git/CHANGES:4:   New language features   ---------------------      o Added a way to access the local, and not the overloaded,    implementation of a symbol.       As an example, given the classes:    | class Test    | {    | int a( ) { return 1; } -  | int b( ) { return local::a(); } +  | int b( ) { return local::a(); } // New +  | int c( ) { return a(); }    | }    |    | class Test2    | {    | int a() { return 42; }    | }       Both Test()->b() and Test2()->b() will return 1, but Test2()->a() -  will return 42. +  and Test2()->c() will return 42.         o Added new syntax that can be used to return the current object as if    it was a class it is inheriting       The syntax is X::this, where X is the inherited class.       The returned object will not include any symbols not available in    the class X, but your overloaded methods (and other identifiers)    will be the ones returned when the object is indexed.
pike.git/CHANGES:37:       | inherit ::this_program       The syntax refers to the previous definition of the current class    in the inherited class, and is typically used with inherit like:       | inherit Foo;    |    | // Override the Bar inherited from Foo.    | class Bar { -  | // Bar is based on the implementation of Bar in Foo. +  | // The new Bar is based on the implementation of Bar in Foo.    | inherit ::this_program;    | // ...    | }    -  + o Added new syntax for referring to and naming inherits. +  +  | inherit "foo.pike"; +  | inherit "foo/bar/baz.pike" : "foo/bar"; +  | // ... +  | "foo.pike"::foo(); +  | "foo/bar"::baz(); +  + o Lookup of named inherits now also looks in indirect inherits. +  +  | class A { int fun() {} } +  | class B { inherit A; } +  | class C { +  | inherit B; +  | // ... +  | // The function fun may here be referred to as any of: +  | B::A::fun(); +  | B::fun(); +  | A::fun(); // New. +    o Implemented the variant keyword.       The keyword was present before, but did not actually do anything    useful.       This is used to do function overloading based on the argument types.       As an example:    | class Test1 { int b(); }    | class Test2 { int a(); }