~jsvoboda/helenos/sysel

« back to all changes in this revision

Viewing changes to uspace/dist/src/sysel/demos/list.sy

  • Committer: Jiri Svoboda
  • Date: 2010-06-09 19:01:08 UTC
  • Revision ID: jiri@wiwaxia-20100609190108-0q5s6iwfyy7481a8
Update SBI to rev. 291.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
-- Using the List class from the library.
30
30
class ListDemo is
31
 
        fun Main() is
 
31
        fun Main(), static is
32
32
                var list : List/int;
33
33
 
34
34
                list = new List/int();
38
38
                list.Append(7);
39
39
                list.Append(8);
40
40
 
41
 
                var n : ListNode/int;
 
41
                var e : IEnumerator/int;
42
42
 
43
 
                n = list.First;
44
 
                while n != nil do
45
 
                        Builtin.WriteLine(n.Data);
46
 
                        n = n.Next;
 
43
                e = list.GetEnumerator();
 
44
                while e.MoveNext() do
 
45
                        Builtin.WriteLine(e.Data);
47
46
                end
48
47
        end
49
48
end