mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-12 15:27:36 +02:00
Issue #10 - Add vector support to (write).
This commit is contained in:
parent
f4b8dbc8a1
commit
81d5a9e524
1 changed files with 10 additions and 0 deletions
10
runtime.c
10
runtime.c
|
@ -773,6 +773,16 @@ static object _Cyc_write(object x, FILE * port)
|
||||||
fprintf(port, "\"%s\"", ((string_type *) x)->str);
|
fprintf(port, "\"%s\"", ((string_type *) x)->str);
|
||||||
break;
|
break;
|
||||||
// TODO: what about a list? contents should be displayed per (write)
|
// TODO: what about a list? contents should be displayed per (write)
|
||||||
|
case vector_tag:
|
||||||
|
fprintf(port, "#(");
|
||||||
|
for (i = 0; i < ((vector) x)->num_elements; i++) {
|
||||||
|
if (i > 0) {
|
||||||
|
fprintf(port, " ");
|
||||||
|
}
|
||||||
|
_Cyc_write(((vector) x)->elements[i], port);
|
||||||
|
}
|
||||||
|
fprintf(port, ")");
|
||||||
|
break;
|
||||||
case pair_tag:
|
case pair_tag:
|
||||||
has_cycle = Cyc_has_cycle(x);
|
has_cycle = Cyc_has_cycle(x);
|
||||||
fprintf(port, "(");
|
fprintf(port, "(");
|
||||||
|
|
Loading…
Add table
Reference in a new issue