Changes in uspace/dist/src/sysel/demos/varargs.sy [23de644:a95310e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/dist/src/sysel/demos/varargs.sy
r23de644 ra95310e 33 33 -- with the attribute 'packed'. 34 34 -- 35 fun Print(args : string[], packed) is 35 -- Note that we need to pass 'n' just because the array type 36 -- does not implement the Length property yet. 37 -- 38 fun Print(n : int; args : string[], packed) is 36 39 var i : int; 37 var error : int;38 40 39 error = 0;40 41 i = 0; 41 while error == 0 do 42 -- This is definitely the wrong way to determine 43 -- array bounds, but until a better one is 44 -- implemented... 45 do 46 Builtin.WriteLine(args[i]); 47 except e : Error.OutOfBounds do 48 error = 1; 49 end 50 42 while i < n do 43 Builtin.WriteLine(args[i]); 51 44 i = i + 1; 52 45 end … … 54 47 55 48 fun Main() is 56 Print( "One", "Two", "Three", "Four", "Five");49 Print(5, "One", "Two", "Three", "Four", "Five"); 57 50 end 58 51 end
Note:
See TracChangeset
for help on using the changeset viewer.