summaryrefslogtreecommitdiff
path: root/src/cli
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2006-10-06 19:29:58 +0000
committerRich Hickey <richhickey@gmail.com>2006-10-06 19:29:58 +0000
commitdc4c38e0f3bea2ebb7708c36ac8d670fe9b95f97 (patch)
tree9cf6233932acb297dc040ac13babc00d08858116 /src/cli
parent8acca11d1aa4ffdf1facf48ca1b8aec6d6bf0e7f (diff)
fixed ~{ in doFormat
Diffstat (limited to 'src/cli')
-rw-r--r--src/cli/runtime/RT.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cli/runtime/RT.cs b/src/cli/runtime/RT.cs
index 431185d6..ef30e8f2 100644
--- a/src/cli/runtime/RT.cs
+++ b/src/cli/runtime/RT.cs
@@ -596,7 +596,7 @@ static public Object format(Object o, String s, params Object[] args) {
return null;
}
-static public void doFormat(TextWriter w, String s, ISeq args) {
+static public ISeq doFormat(TextWriter w, String s, ISeq args) {
for (int i = 0; i < s.Length;)
{
char c = s[i++];
@@ -629,13 +629,14 @@ static public void doFormat(TextWriter w, String s, ISeq args) {
if(j == -1)
throw new Exception("Missing ~}");
String subs = s.Substring(i, j-i);
- format(w, subs, RT.seq(RT.first(args)));
- args = RT.rest(args);
+ for (ISeq sargs = RT.seq(RT.first(args)); sargs != null; )
+ sargs = doFormat(w, subs, sargs);
+ args = RT.rest(args);
i = j+2; //skip ~}
break;
case '^':
if(args == null)
- return;
+ return null;
break;
case '~':
w.Write('~');
@@ -650,6 +651,7 @@ static public void doFormat(TextWriter w, String s, ISeq args) {
break;
}
}
+ return args;
}
/*-------------------------------- values --------------*/