Re: Problem with SBCL pprint
Robert Goldman <[email protected]> Tue, 31 Mar 2026 14:34:31 -0500
| Newsgroups | gmane.lisp.steel-bank.general |
|---|---|
| Message-ID | <[email protected]> |
--===============4327240959613067167== Content-Type: multipart/alternative; boundary="=_MailMate_8411FDF5-211A-45D2-B7E0-208BA7AC1F7E_=" --=_MailMate_8411FDF5-211A-45D2-B7E0-208BA7AC1F7E_= Content-Type: text/plain; format=flowed; markup=markdown On 30 Mar 2026, at 2:41, Douglas Katzman wrote: > Binding *print-pretty* to NIL suffices to avoid an infinite loop, but > what's the motive for defining a dispatch function on 'integer in the > first > place? I would think you can delete the dispatch function unless you > expect > *print-base* not to be 10. > Sorry -- should have answered this sooner. The motive is that I'm printing PDDL (the Planner Domain Definition Language), represented internally as s-expressions, in a way that must honor the parsing quirks of other tools that consume PDDL. Among other things, they don't handle integers, except in base 10 and they don't accept floats in exponential notation or CL-specific floats with the embedded "s" or "d" to indicate single or double floats. I *should* also have a table entry that ensures that rationals are not printed in CL style, but are converted to floats. It's somewhat akin to the problems in Waters's paper about printing CL as Pascal, except that I doubt any of the resulting Pascal actually was read by someone else's Pascal parser. Alas, that is not true for my code, whose output is read by many other systems, many of which are grad-student-ware. Thank you again for all your help in getting this to work. Best, R --=_MailMate_8411FDF5-211A-45D2-B7E0-208BA7AC1F7E_= Content-Type: text/html Content-Transfer-Encoding: quoted-printable <!DOCTYPE html> <html> <head> <meta http-equiv=3D"Content-Type" content=3D"text/xhtml; charset=3Dutf-8"= > </head> <body><div style=3D"font-family: sans-serif;"><div class=3D"markdown" sty= le=3D"white-space: normal;"> <p dir=3D"auto">On 30 Mar 2026, at 2:41, Douglas Katzman wrote:</p> <blockquote style=3D"margin: 0 0 5px; padding-left: 5px; border-left: 2px= solid #777777; color: #777777;"> <p dir=3D"auto">Binding <em>print-pretty</em> to NIL suffices to avoid an= infinite loop, but<br> what's the motive for defining a dispatch function on 'integer in the fir= st<br> place? I would think you can delete the dispatch function unless you expe= ct<br> <em>print-base</em> not to be 10.</p> </blockquote> <p dir=3D"auto">Sorry -- should have answered this sooner.</p> <p dir=3D"auto">The motive is that I'm printing PDDL (the Planner Domain = Definition Language), represented internally as s-expressions, in a way t= hat must honor the parsing quirks of other tools that consume PDDL.</p> <p dir=3D"auto">Among other things, they don't handle integers, except in= base 10 and they don't accept floats in exponential notation or CL-speci= fic floats with the embedded "s" or "d" to indicate s= ingle or double floats. I <em>should</em> also have a table entry that e= nsures that rationals are not printed in CL style, but are converted to f= loats.</p> <p dir=3D"auto">It's somewhat akin to the problems in Waters's paper abou= t printing CL as Pascal, except that I doubt any of the resulting Pascal = actually was read by someone else's Pascal parser. Alas, that is not tru= e for my code, whose output is read by many other systems, many of which = are grad-student-ware.</p> <p dir=3D"auto">Thank you again for all your help in getting this to work= =2E</p> <p dir=3D"auto">Best,<br> R</p> </div> </div> </body> </html> --=_MailMate_8411FDF5-211A-45D2-B7E0-208BA7AC1F7E_=-- --===============4327240959613067167== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============4327240959613067167== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Sbcl-help mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sbcl-help --===============4327240959613067167==--