summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-08-28 16:57:09 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-08-28 16:57:09 +0200
commit5f0f8e7c29b6812c1f7a2696d345a5dc7b1a217a (patch)
tree335ba3e743b0dfbf013af45e56e5842f3d508779
parent9f06467f57576cd557ee172f10f5e12bba7f1f9e (diff)
LOAD: Print messages on *STANDARD-OUTPUT* instead of stderr.
-rw-r--r--MLKInterpreter.m8
-rw-r--r--MLKRoot.m24
2 files changed, 19 insertions, 13 deletions
diff --git a/MLKInterpreter.m b/MLKInterpreter.m
index a808909..81415d1 100644
--- a/MLKInterpreter.m
+++ b/MLKInterpreter.m
@@ -140,10 +140,12 @@ PRIMARY (NSArray *array)
formdesc = MLKPrintToString(code);
//fprintf (stderr, "; COMPILE-MINIMALLY: %s\n", [formdesc UTF8String]);
- fprintf (stderr, "; ");
+ MLKCharacterStream *ostream = [[MLKDynamicContext currentContext]
+ valueForSymbol:[cl intern:@"*STANDARD-OUTPUT*"]];
+ [ostream writeString:@"; "];
for (i = 0; i < level; i++)
- fprintf (stderr, "| ");
- fprintf (stderr, "LOAD: %s\n", [formdesc UTF8String]);
+ [ostream writeString:@"| "];
+ [ostream writeString:[NSString stringWithFormat:@"LOAD: %@\n", formdesc]];
if (MLKLoadCompilesP)
{
diff --git a/MLKRoot.m b/MLKRoot.m
index 2184d6a..eaff94c 100644
--- a/MLKRoot.m
+++ b/MLKRoot.m
@@ -109,17 +109,21 @@ load (id _data, NSString *fileName, id _marker)
MLKDynamicContext *ctx;
l = [fileName length];
- fprintf (stderr, ";\n; ");
+
+ MLKCharacterStream *ostream = [[MLKDynamicContext currentContext]
+ valueForSymbol:[cl intern:@"*STANDARD-OUTPUT*"]];
+
+ [ostream writeString:@";\n; "];
for (i = 0; i < 68 - 2*level; i++)
- fprintf (stderr, "_");
+ [ostream writeChar:'_'];
- fprintf (stderr, "\n; /");
+ [ostream writeString:@"\n; /"];
for (i = 0; i < 30 - l/2 - level; i++)
- fprintf (stderr, "-");
- fprintf (stderr, " LOAD: %s ", [fileName UTF8String]);
+ [ostream writeChar:'-'];
+ [ostream writeString:[NSString stringWithFormat:@" LOAD: %s ", [fileName UTF8String]]];
for (i = 0; i < 30 - (l+1)/2 - level; i++)
- fprintf (stderr, "-");
- fprintf (stderr, "\n; |\n");
+ [ostream writeChar:'-'];
+ [ostream writeString:@"\n; |\n"];
//NSLog (@"%d", [input hasBytesAvailable]);
[input open];
@@ -153,10 +157,10 @@ load (id _data, NSString *fileName, id _marker)
LRELEASE (ctx);
[input close];
- fprintf (stderr, "; \\");
+ [ostream writeString:@"; \\"];
for (i = 0; i < 68 - 2*level; i++)
- fprintf (stderr, "_");
- fprintf (stderr, "\n; \n");
+ [ostream writeChar:'_'];
+ [ostream writeString:@"\n; \n"];
return truify (success);
}