Re: FORMAT a list
"J. Gareth Williams" <[email protected]> Wed, 14 May 2025 22:57:08 -0400
| Newsgroups | gmane.lisp.steel-bank.general |
|---|---|
| Message-ID | <CALfqwApb6ahcN_vMSkgqehd1NVGpB4vR2Kwk-aCJZOK0X6UUNg@mail.gmail.com> |
You're pretty-printing the list.
Print it to T rather NIL, and notice that the "?" ends up aligned under
"Watts" -- that is, that it wrapped the line and indented it so that the
elements of the inner list line up.
Try :
(let ((*print-right-margin* 60)
(zz '( "SELECT" "this, that" "FROM" "table" "WHERE" "this" "LIKE"
"\"foo%\"" "OR" ("watts" ">" 42 "AND" "jules" ">" "?"))))
(format t "~&~{~A~^ ~}" zz))
and then play with the margin to see the effect.
g
On Wed, May 14, 2025 at 10:39 PM Christopher Stacy <[email protected]> wrote:
> In SBCL 2.4.6 (Intel MacOS Monterey):
>
> When I FORMAT the following list:
>
> ("SELECT" "this, that" "FROM" "table" "WHERE" "this" "LIKE" "\"foo%\""
> "OR" ("watts" ">" 42 "AND" "jules" ">" "?"))
>
> with (format nil "~{~A~^ ~}" zz)
>
> I get a ton of gratuitous whitespace between the ">" and the "?".
> In SBCL: (length (format nil "~{~A~^ ~}" zz)) => 137
> In CCL: (length (format nil "~{~A~^ ~}" zz)) => 81
>
> Am I doing something silly or is this a bug?
>
> Thanks!
> ---Chris
>
>
>
>
>
> _______________________________________________
> Sbcl-help mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sbcl-help
>
_______________________________________________
Sbcl-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-help