Changeset 38aaacc2 in mainline for uspace/dist/src/sysel/demos/list.sy
- Timestamp:
- 2010-04-23T21:41:10Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f4f866c
- Parents:
- 074444f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/dist/src/sysel/demos/list.sy
r074444f r38aaacc2 30 30 class ListDemo is 31 31 fun Main() is 32 var list : List; 33 var i : Int; 32 var list : List/int; 34 33 35 list = new List ();34 list = new List/int(); 36 35 list.Init(); 37 36 38 -- We need autoboxing or generics to get rid of this mess. 39 i = new Int(); i.Value = 5; list.Append(i); 40 i = new Int(); i.Value = 6; list.Append(i); 41 i = new Int(); i.Value = 7; list.Append(i); 42 i = new Int(); i.Value = 8; list.Append(i); 37 list.Append(5); 38 list.Append(6); 39 list.Append(7); 40 list.Append(8); 43 41 44 var n : ListNode ;42 var n : ListNode/int; 45 43 46 44 n = list.First; 47 45 while n != nil do 48 Builtin.WriteLine( (n.value as Int).Value);46 Builtin.WriteLine(n.Value); 49 47 n = n.Next; 50 48 end
Note:
See TracChangeset
for help on using the changeset viewer.