Created
          November 28, 2010 21:32 
        
      - 
      
- 
        Save bga/719318 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | var a = [x*2 for each (x in [1,2,3])]; | |
| var a = [1,2,3].map(_("x -> 2*x")); | |
| var b = [x*2 for each (x in [1,2,3]) if (x>1)]; | |
| var a = [1,2,3].filter(_("x -> x > 1")).map(_("x -> 2*x")); | |
| var c = [x+y | |
| for each (x in [1,2,3]) | |
| for each (y in [10,20,30]) | |
| if (x>1) | |
| ]; | |
| var c = Array._zip({ | |
| x: [1,2,3].filter(_("x -> x > 1"), | |
| y: [10,20,30] | |
| }).map(_("v -> v.x + v.y") | |
| ; | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment