3 GCL : The following 8 problems failed: (7 29 38 39 40 47 48 69)
4 SBCL : The following 4 problems failed: ( 38 63 65 69)
5 CCL : The following 2 problems failed: ( 27 54 )
6 ECL : The following 6 problems failed: ( 38 54 63 65 66 69)
7 CLISP: The following 5 problems failed: ( 27 38 63 65 69)
8 CMUCL: The following 0 problems failed: ( )
11 printf(false, "|~5a|~5:a|~5@a|~5:@a|", 42,42,42,42);
14 printf(false, "|~5a|~5:a|~5@a|~5:@a|", "42","42","42","42");
17 printf(false, "|~5s|~5:s|~5@s|~5:@s|", "42","42","42","42");
18 "|\"42\" |\"42\" | \"42\"| \"42\"|"$
20 printf(false, "|~10b|~10:b|~10@b|~10:@b|", 42,42,42,42);
21 "| 101010| 101,010| +101010| +101,010|"$
23 printf(false, "~{ ~c ~:c ~@c ~:@c ~}", makelist("w", n,1,4) );
26 printf(false, "|~10d|~10:d|~10@d|~10:@d|", 42,42,42,42);
27 "| 42| 42| +42| +42|"$
29 printf(false, "~{~a ~s ~d ~f ~h ~}", makelist( sqrt(2), n,1,5) ), fpprec: 24$
30 "sqrt(2) \"sqrt(2)\" 1 1.4142135623730951 1.41421356237309504880169 "$
32 printf(false, "|~v,v,v,,vf|", 12, 3, 0 ,"f", 9);
35 printf(false, "|~v,v,v,,,vh|", 12, 3, 0 ,"h", 9);
38 printf(false , "|~#,vf|", 2,3,4,5,6,7);
41 printf(false , "|~#,vh|", 2,3,4,5,6,7);
44 printf(false, "~{~[Siamese~;Manx~;Persian~] Cat ~%~}", [1,2,3,4]);
51 printf(false, "~{~[Siamese~;Manx~:;Persian~] Cat ~%~}", [1,2,3,4]);
58 printf(false, "~{~:[Siamese~;Manx~] Cat ~%~}", [true,false,1,0]);
65 printf(false, "|~@[x~]|", true );
68 printf(false, "|~@[x~]|", false );
71 printf(false, "|~@{~#d|~}",6,5,4,3,2,1);
74 printf(false, "~d ~{~d ~}~d",7,[6,5,4,3,2,1],0);
76 printf(false, "~d ~@{~d ~}",7,6,5,4,3,2,1,0);
78 printf(false, "~d ~{~{~d ~}~}",7,[[6,5],[4,3],[2,1],[0]]);
80 printf(false, "~d ~:{~d ~}",7,[[6,5],[4,3],[2,1],[0]]);
82 printf(false, "~d ~:{~d ~^~d ~}",7,[[6,5],[4,3],[2,1],[0]]);
84 printf(false, "~d ~:@{~d ~^~d ~}",7,[6,5],[4,3],[2,1],[0]);
86 printf(false, "~d ~:@{~d ~}",7,[6,5],[4,3],[2,1],[0]);
89 printf(false, "~{~h|~%~16,10h|~%~16,10,,,,'#h|~%~16,10@h|~%~,10,2,-3h|~%~10,,,,'xh|~%~}",
90 makelist( sqrt(2), n,1,6) ), fpprec: 24;
91 "1.41421356237309504880169|
99 printf(false, "|~10<foo~;bar~>|");
101 printf(false, "|~30<foo~;bar~;baz~>|");
104 printf(false, "~:{/~a~^ ...~}", [[hot, dog], [hamburger], [ice, cream]] );
105 "/hot .../hamburger/ice ..."$
107 printf(false, "~:{/~a~:^ ...~}", [[hot, dog], [hamburger], [ice, cream]] );
108 "/hot .../hamburger .../ice"$
110 printf(false, "~? ~d", "|~a ~f|", ["Foo", 5], 7 );
113 printf(false, "~@? ~d", "|~a ~f|", "Foo", 5, 7 );
118 printf(false,"~{|~a|~5a|~5@a|~5,,,'.a|~5,,3,'.a|~6,2,,'.a|~6,5,,'.a|~}", makelist('x,n,1,7));
119 "|x|x | x|x....|x....|x......|x.....|"$
121 printf(false,"~{|~s|~5s|~5@s|~5,,,'.s|~5,,3,'.s|~6,2,,'.s|~6,5,,'.s|~}", makelist('x,n,1,7));
122 "|\"x\"|\"x\" | \"x\"|\"x\"..|\"x\"...|\"x\"....|\"x\".....|"$
125 printf(false,"[~a, ~a, ~a, ~a, ~a, ~a, ~a]", true,sqrt(2),%pi,2/6,1.234b0,[a+a,[b,c]],"foo");
126 "[true, sqrt(2), %pi, 1/3, 1.234b0, [2*a,[b,c]], foo]"$
128 printf(false,"[~s, ~s, ~s, ~s, ~s, ~s, ~s]", true,sqrt(2),%pi,2/6,1.234b0,[a+a,[b,c]],"foo");
129 "[\"true\", \"sqrt(2)\", \"%pi\", \"1/3\", \"1.234b0\", \"[2*a,[b,c]]\", \"foo\"]"$
133 args: [42,1.5,sqrt(2),%pi,7/2,1.234b0];
134 [42,1.5,sqrt(2),%pi,7/2,1.234b0]$
136 printf(false,"[~{~d~^, ~}]", args);
137 "[42, 1, 1, 3, 3, 1]"$
139 ( ans: "[4.2E+1, 1.5E+0, 1.4142135623730951E+0, 3.141592653589793E+0, 3.5E+0, 1.234E+0]",
140 printf(false, "[~{~e~^, ~}]", args),
141 if sequalignore (%%, ans) then true else %%);
144 printf(false,"[~{~f~^, ~}]", args);
145 "[42.0, 1.5, 1.4142135623730951, 3.141592653589793, 3.5, 1.234]"$
147 printf(false,"[~{~g~^, ~}]", args);
148 "[42. , 1.5 , 1.4142135623730951 , 3.141592653589793 , 3.5 , 1.234 ]"$
150 printf(false,"[~{~h~^, ~}]", args), fpprintprec=16;
151 "[42.0, 1.5, 1.414213562373095, 3.141592653589793, 3.5, 1.234]"$
154 printf(false,"~{[~b, ~o, ~x, ~2r, ~3r, ~4r, ~10r, ~22r, ~36r]~}", makelist(42,n,1,9) );
155 "[101010, 52, 2A, 101010, 1120, 222, 42, 1K, 16]"$
157 printf(false,"~{[~r, ~:r, ~@r, ~:@r]~}", makelist(42,n,1,4) );
158 "[forty-two, forty-second, XLII, XXXXII]"$
161 printf(false,"~d dog~p. ~d bone~p.", 2, 2, 1, 1 );
164 printf(false,"~d dog~:p. ~d bone~:p.", 2, 1 );
167 printf(false,"~d fl~:@p. ~d fl~:@p.", 1, 2 );
171 printf(false,"[~$, ~$, ~$, ~@$]", 2, 1.985, 1.995, 2 );
172 "[2.00, 1.99, 2.00, +2.00]"$
175 printf(false,"0123456789~%|~5t|~4,3t|~,2t|~%|~4,3t|~,2t|");
181 printf(false,"012345678901234~%|~5@t|~4,3@t|~,2@t|~%|~4,3@t|~,2@t|");
187 printf(false,"~~ ~3~");
191 printf(false, "A long format string can simply be sepa~
192 rated by a single ~~ immediately ~%followed by newline. Add~
193 itional blanks are ignored.~:
194 ~~: causes the ~%blanks to be printed. ~~@ enf~
196 k and ignores following blanks.");
197 "A long format string can simply be separated by a single ~ immediately
198 followed by newline. Additional blanks are ignored. ~: causes the
199 blanks to be printed. ~@ enforces the linebrea
200 k and ignores following blanks."$
203 printf(false, "~d aaa ~? bbb ~d", 0, "~d ~d ~d", [1,2,3], 4);
206 printf(false, "~d aaa ~@? bbb ~d", 0, "~d ~d ~d", 1,2,3, 4);
209 printf(false, "~d ~v,v^~f ", 0, 1, 2, 3);
211 printf(false, "~d ~v,v^~f ", 0, 1, 1, 3);
216 printf(false,"~h",2.b0^-64);
217 "0.0000000000000000000542101086242752217003726400434970855712890625"$
218 printf(false,"~,17,0h",1.23456789012345678901234567890b9);
219 "1234567890.12345678901234568b+0"$
220 printf(false,"~50h",2.b0^64);
221 " 18446744073709551616.0"$
225 makelist (ev (printf (false, "~h", bfloat (%pi)), fpprintprec=i), i, 2, 16);
226 ["3.1", "3.14", "3.141", "3.1415", "3.14159", "3.141592", "3.1415926",
227 "3.14159265", "3.141592653", "3.1415926535", "3.14159265358",
228 "3.141592653589", "3.1415926535897", "3.14159265358979", "3.141592653589793"];
230 /* printing numbers close to 1 exposes bug in FORMAT
231 * reported to mailing list 2015-03-10: "Rounding problem with format"
237 (3.486966909006701254309886183074014693622265540576239825103417070695233093147180625237524509429931641b-22
238 *2.867821881007928e+21,
239 printf(false, "~13,6,3,1e", %%),
240 if sequalignore (%%, "1.000000e+000") then true else %%);
246 (printf (false, "~13,6,3,1e", 0.9999999999999999),
247 if sequalignore (%%, "1.000000e+000") then true else %%);
250 (printf (false, "~9,3,2,1e", 1.0),
251 if sequalignore (%%, "1.000e+00") then true else %%);
254 (printf (false, "~9,3,2,1e", 0.999),
255 if sequalignore (%%, "9.990e-01") then true else %%);
258 (printf (false, "~9,3,2,1e", 0.9999),
259 if sequalignore (%%, "9.999e-01") then true else %%);
262 (printf (false, "~9,3,2,1e", 0.99999),
263 if sequalignore (%%, "1.000e+00") then true else %%);
267 /* changing fpprec should not change the printed result
271 bf: 1.23456789012345678901234567890b-10,
272 a1: printf(false, "~,42,,0h~%", bf),
273 a2: printf(false, "~,42,,10h~%", bf),
274 a3: printf(false, "~,42,,-10h~%", bf),
276 b1: printf(false, "~,42,,0h~%", bf),
277 b2: printf(false, "~,42,,10h~%", bf),
278 b3: printf(false, "~,42,,-10h~%", bf),
280 is(a1=b1) and is(a2=b2) and is(a3=b3) );
283 (remvalue(args,bf,a1,a2,b1,b2,c1,c2), 0);
286 /* handle ~m, ~:m, ~@m in printf */
288 block ([display2d_unicode: false],
289 with_default_2d_display(printf (false, "~m~%", 1/2)));
295 block ([display2d_unicode: false],
296 with_default_2d_display(block ([s: make_string_output_stream ()],
297 printf (s, "~m~%", 1/2),
298 get_output_stream_string (s))));
304 block ([display2d_unicode: false],
305 with_default_2d_display(printf (false, "~m, ~a, ~:m, ~@m, ~d~%", (1 + x)/(1 - x), (1 + x)/(1 - x), (1 + x)/(1 - x), (1 + x)/(1 - x), 1234)));
307 -----, (x+1)/(1-x), (x+1)/(1-x), -----, 1234
311 block ([display2d_unicode: false],
312 with_default_2d_display(block ([s: make_string_output_stream ()],
313 printf (s, "~m, ~a, ~:m, ~@m, ~d~%", (1 + x)/(1 - x), (1 + x)/(1 - x), (1 + x)/(1 - x), (1 + x)/(1 - x), 1234),
314 get_output_stream_string (s))));
316 -----, (x+1)/(1-x), (x+1)/(1-x), -----, 1234
320 block ([display2d_unicode: false],
321 with_default_2d_display(printf (false, "~~m ~~:m ~~~~@m ~m, ~a, ~:m, ~@m, ~d ~~z ~~~~z ~~~~~~y~%", (1 + x)/(1 - x), (1 + x)/(1 - x), (1 + x)/(1 - x), (1 + x)/(1 - x), 1234)));
323 ~m ~:m ~~@m -----, (x+1)/(1-x), (x+1)/(1-x), -----, 1234 ~z ~~z ~~~y
327 block ([display2d_unicode: false],
328 with_default_2d_display(block ([s: make_string_output_stream ()],
329 printf (s, "~~m ~~:m ~~~~@m ~m, ~a, ~:m, ~@m, ~d ~~z ~~~~z ~~~~~~y~%", (1 + x)/(1 - x), (1 + x)/(1 - x), (1 + x)/(1 - x), (1 + x)/(1 - x), 1234),
330 get_output_stream_string (s))));
332 ~m ~:m ~~@m -----, (x+1)/(1-x), (x+1)/(1-x), -----, 1234 ~z ~~z ~~~y