Промењена општа нотације листе у принт функцији
This commit is contained in:
parent
0bbdb0a68a
commit
b28b911ac3
18
print.c
18
print.c
|
@ -45,9 +45,21 @@ void printValue(object input)
|
||||||
else if (input.type == consObject)
|
else if (input.type == consObject)
|
||||||
{
|
{
|
||||||
printf("(");
|
printf("(");
|
||||||
printValue(CAR(input));
|
object *currentCell = &input;
|
||||||
printf(" . ");
|
while (TYPE(*currentCell) == consObject)
|
||||||
printValue(CDR(input));
|
{
|
||||||
|
printValue(CAR(*currentCell));
|
||||||
|
if (TYPE(CDR(*currentCell)) == consObject)
|
||||||
|
{
|
||||||
|
printf(" ");
|
||||||
|
}
|
||||||
|
currentCell = &CDR(*currentCell);
|
||||||
|
}
|
||||||
|
if (TYPE(*currentCell) != nilObject)
|
||||||
|
{
|
||||||
|
printf(" . ");
|
||||||
|
printValue(*currentCell);
|
||||||
|
}
|
||||||
printf(")");
|
printf(")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue