fixing print-values
This commit is contained in:
parent
380890b13d
commit
a92e6b95e4
|
@ -485,14 +485,25 @@
|
||||||
Primitives['print-values'] = new Closure(
|
Primitives['print-values'] = new Closure(
|
||||||
function(MACHINE) {
|
function(MACHINE) {
|
||||||
var outputPort = MACHINE.params.currentOutputPort;
|
var outputPort = MACHINE.params.currentOutputPort;
|
||||||
|
var prependNewline = false;
|
||||||
if (MACHINE.argcount > 0) {
|
if (MACHINE.argcount > 0) {
|
||||||
outputPort.write(MACHINE, MACHINE.val);
|
if (MACHINE.val !== undefined) {
|
||||||
|
if (prependNewline) {
|
||||||
outputPort.write(MACHINE, "\n");
|
outputPort.write(MACHINE, "\n");
|
||||||
|
}
|
||||||
|
outputPort.write(MACHINE, MACHINE.val);
|
||||||
|
prependNewline = true;
|
||||||
|
}
|
||||||
|
|
||||||
for(var i = 0; i < MACHINE.argcount - 1; i++) {
|
for(var i = 0; i < MACHINE.argcount - 1; i++) {
|
||||||
|
if (MACHINE.env[MACHINE.env.length - 1 - i] !== undefined) {
|
||||||
|
if (prependNewline) {
|
||||||
outputPort.write(MACHINE, "\n");
|
outputPort.write(MACHINE, "\n");
|
||||||
|
}
|
||||||
outputPort.write(MACHINE,
|
outputPort.write(MACHINE,
|
||||||
MACHINE.env[MACHINE.env.length - 1 - i]);
|
MACHINE.env[MACHINE.env.length - 1 - i]);
|
||||||
|
prependNewline = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
outputPort.write(MACHINE, "\n");
|
outputPort.write(MACHINE, "\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user