diff options
author | Matthias Andreas Benkard <matthias@benkard.de> | 2008-08-28 16:57:09 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <matthias@benkard.de> | 2008-08-28 16:57:09 +0200 |
commit | 5f0f8e7c29b6812c1f7a2696d345a5dc7b1a217a (patch) | |
tree | 335ba3e743b0dfbf013af45e56e5842f3d508779 | |
parent | 9f06467f57576cd557ee172f10f5e12bba7f1f9e (diff) |
LOAD: Print messages on *STANDARD-OUTPUT* instead of stderr.
-rw-r--r-- | MLKInterpreter.m | 8 | ||||
-rw-r--r-- | MLKRoot.m | 24 |
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) { @@ -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); } |