A nice way to step into 2012

bearophile bearophileHUGS at lycos.com
Tue Dec 27 15:00:30 PST 2011


Timon Gehr:

> What about making => syntax available to named functions as well?
> 
> class C{
>      private int x;
>      int getX() => x;
> }
> 
> 
> void main(){
>      int[] arr;
>      bool isOdd(int x) => x&1;
>      writeln(arr.filter!isOdd());
> }

>From the Ada 2012 changes:
http://www.disca.upv.es/jorge/ae2010/slides/05-3_Language_Tech_Schonberg_Towards_Ada_2012.pdf

> To simplify the writing of pre/postconditions and predicates, allow parametrized expressions (aka function bodies in package specs):

function Cube (X : integer) is (X ** 3);

Bye,
bearophile


More information about the Digitalmars-d mailing list