procedure main() ary := [2,3,5,7,11] write(inspect(ary)); ary := list(10, 1) write(inspect(ary)); ary := list(10) write(inspect(ary)); every i := 1 to *ary do ary[i] := i write(inspect(ary)); mat := make_matrix(4, 0.0); write(inspect(mat)) end procedure inspect(arg) result := "[ " every elt := !arg do if type(elt) == "list" then result ||:= inspect(elt) || ", " else result ||:= image(elt) || ", " return result || "]" end procedure make_matrix(n, x) L := list(n) every !L := list(n, x) return L end
Standard input is empty
[ 2, 3, 5, 7, 11, ] [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ] [ &null, &null, &null, &null, &null, &null, &null, &null, &null, &null, ] [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ] [ [ 0.0, 0.0, 0.0, 0.0, ], [ 0.0, 0.0, 0.0, 0.0, ], [ 0.0, 0.0, 0.0, 0.0, ], [ 0.0, 0.0, 0.0, 0.0, ], ]