User Tools

Site Tools


at:tutorial:objects

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
at:tutorial:objects [2007/07/18 18:28] jorgeat:tutorial:objects [2007/07/19 07:59] – * tvcutsem
Line 168: Line 168:
 def Array := object: { def Array := object: {
   def elements := [];   def elements := [];
 +  def init(a) { elements := a; };
   def add(v) { elements := elements + [v]; self };   def add(v) { elements := elements + [v]; self };
   def collect: closure {   def collect: closure {
Line 188: Line 189:
 >> <object:14179973> >> <object:14179973>
 > c.each: { |v| system.print(v)} > c.each: { |v| system.print(v)}
-+234
-+
-4+
 >>nil >>nil
 </code> </code>
at/tutorial/objects.txt · Last modified: 2013/05/17 20:23 by tvcutsem