Промењена општа нотације листе у принт функцији
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)
|
||||
{
|
||||
printf("(");
|
||||
printValue(CAR(input));
|
||||
printf(" . ");
|
||||
printValue(CDR(input));
|
||||
object *currentCell = &input;
|
||||
while (TYPE(*currentCell) == consObject)
|
||||
{
|
||||
printValue(CAR(*currentCell));
|
||||
if (TYPE(CDR(*currentCell)) == consObject)
|
||||
{
|
||||
printf(" ");
|
||||
}
|
||||
currentCell = &CDR(*currentCell);
|
||||
}
|
||||
if (TYPE(*currentCell) != nilObject)
|
||||
{
|
||||
printf(" . ");
|
||||
printValue(*currentCell);
|
||||
}
|
||||
printf(")");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue