Ignore:
Timestamp:
2010-04-04T22:32:39Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0a72efc
Parents:
73060801 (diff), 23de644 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge from lp:~jsvoboda/helenos/sysel.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/dist/src/sysel/demos/varargs.sy

    r73060801 recb6ac32  
    3333        -- with the attribute 'packed'.
    3434        --
    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
     35        fun Print(args : string[], packed) is
    3936                var i : int;
     37                var error : int;
    4038
     39                error = 0;
    4140                i = 0;
    42                 while i < n do
    43                         Builtin.WriteLine(args[i]);
     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
    4451                        i = i + 1;
    4552                end
     
    4754
    4855        fun Main() is
    49                 Print(5, "One", "Two", "Three", "Four", "Five");
     56                Print("One", "Two", "Three", "Four", "Five");
    5057        end
    5158end
Note: See TracChangeset for help on using the changeset viewer.