[nem-en] Feature request: Matching !null

vc vc at rsdn.ru
Sun Jul 23 22:52:47 CEST 2006


   Often it is necessary to filter not null elements. 
   Now it is necessary to do it as follows:
   
   def a = array["a", null, "b"];
   
   foreach (x in a)
     when (x != null)
       System.Console.WriteLine(x);
   
   
   It will be nice to extend pattern matching that it allows doing so:
   
   def a = array["a", null, "b"];
   
   foreach (x is !null in a)
     System.Console.WriteLine(x);
   
   Or:
   
   foreach (x is not null in a)
     System.Console.WriteLine(x);
   
   Vlad




More information about the devel-en mailing list