Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,58 @@
|
|||
void
|
||||
show_sublist(list l)
|
||||
{
|
||||
integer i, v;
|
||||
|
||||
for (i, v in l) {
|
||||
o_space(sign(i));
|
||||
o_integer(v);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
show_list(list l)
|
||||
{
|
||||
integer i;
|
||||
list v;
|
||||
|
||||
for (i, v in l) {
|
||||
o_text(" [");
|
||||
show_sublist(v);
|
||||
o_text("]");
|
||||
}
|
||||
|
||||
o_byte('\n');
|
||||
}
|
||||
|
||||
list
|
||||
multiple_distinct(integer n, object o)
|
||||
{
|
||||
list l;
|
||||
|
||||
call_n(n, l_append, l, o);
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
integer
|
||||
main(void)
|
||||
{
|
||||
list l, z;
|
||||
|
||||
# create a list of integers - `3' will serve as initializer
|
||||
l = multiple_distinct(8, 3);
|
||||
|
||||
l_clear(l);
|
||||
|
||||
# create a list of distinct lists - `z' will serve as initializer
|
||||
l_append(z, 4);
|
||||
l = multiple_distinct(8, z);
|
||||
|
||||
# modify one of the sublists
|
||||
l_q_list(l, 3)[0] = 7;
|
||||
|
||||
# display the list of lists
|
||||
show_list(l);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue