Prev: Disjoint sets
Next: ecl on cygwin
From: Zach Beane on 24 May 2010 14:13 pjb(a)informatimago.com (Pascal J. Bourguignon) writes: > Zach Beane <xach(a)xach.com> writes: > >> D Herring <dherring(a)at.tentpost.dot.com> writes: >> >>> On 05/23/2010 05:38 AM, Bastien Dejean wrote: >>>> I'm trying to use the pprint function as a code beautifier. >>>> Here's my first draft : >>>> >>>> #!/opt/local/bin/sbcl --script >>>> >>>> (let ((*print-case* :downcase)) >>>> (do ((c (read nil nil nil) (read nil nil nil))) >>>> ((null c)) >>>> (pprint c) >>>> (terpri))) >>>> >>>> Meant usage : cat foo.lisp | cltidy. >>>> Unfortunately, comments are ignored… >>> >>> Yes, that will happen. Unfortunately, the standard reader cannot >>> return forms with annotations like comments. >> >> Comments aren't too big an issue, since you can just make a readtable >> that does something different with ; and #|. Package prefixes would be a >> bigger issue, since the behavior of : and :: in symbols can't be >> customized in a standard way. > > Funny, I don't remember having used anything out of pure standard > Common Lisp to implement my reader, and with it, the behavior of : and > :: in symbols can be perfectly well customized. That's cheating, of course! I was talking about *the* CL reader, not *a* CL reader. Zach |