pike.git / CHANGES

version» Context lines:

pike.git/CHANGES:82:    The built-in data types also have iterator classes with this    interface. They are found as Array.Iterator, Mapping.Iterator, etc    and can be used to iterate over these data types in some custom    fashion. This is especially useful for mappings and multisets,    which cannot be iterated over directly in any other way. For    example, to get some arbitrary index in a mapping m:       mixed any_index = Mapping.Iterator(m)->index();      o Automap +  To perform per-element operations on arrays, there is now a convenience +  syntax for map(), that can make code more readable in some situations. +  Summing up two arrays element by element using automap looks like this:    -  +  a[*] + b[*]; // the result has as many elements as the shortest array +  +  Multiplying all elements in a by a constant: +  +  a[*] * 4711; +  +  Make an array of what sprintf("%O", a[n]) returns for all elements in a: +  +  sprintf("%O", a[*]); +    o Implicit lambda.      o Access to hidden variables in surrounding scopes.    Include the names of the surrounding classes themselves in the lookup for    Foo::, to make it possible to adress hidden variables in the scopes of    surrounding classes, e.g:       class Foo {    int i;    void create (int i) {Foo::i = i;}