User Tools

Site Tools


at:tutorial:basic

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
at:tutorial:basic [2007/04/06 08:58] – add elisagat:tutorial:basic [2007/04/06 09:00] – * elisag
Line 278: Line 278:
 We have already introduce how to define tables. Let us now focus on how to manipulate them with the native methods provided by the table object. We have already introduce how to define tables. Let us now focus on how to manipulate them with the native methods provided by the table object.
 <code> <code>
 +>[1,2,3].filter: {|e| e != 2 }
 +>>[1, 3]
 +>[1,2,3].map: { |i| i + 1 }
 +>>[2, 3, 4]
 >def vowels := ["a", "e", "i", "o", "u"] >def vowels := ["a", "e", "i", "o", "u"]
 >>["a", "e", "i", "o", "u"] >>["a", "e", "i", "o", "u"]
Line 288: Line 292:
 >vowels >vowels
 >>["z", "e", "i", "o", "u"] >>["z", "e", "i", "o", "u"]
->vowels.isEmpty() 
->>false 
->[1,2,3].filter: {|e| e != 2 } 
->>[1, 3] 
->[1,2,3].map: { |i| i + 1 } 
->>[2, 3, 4] 
 >vowels.select(2,5).implode() >vowels.select(2,5).implode()
 >>"eio" >>"eio"
 +>vowels.isEmpty()
 +>>false
 </code> </code>
  
at/tutorial/basic.txt · Last modified: 2020/02/09 22:05 by elisag