From: Clint Hyde
Subject: some built-in printing behavior I want to turn off
Date:
Message-ID: <357D610E.6984@bbn.com>
#+allegro-v4.3.1
an app I'm working on these days assigns an attribute called 'FUNCTION
to an alist on some objects. when I print the alist, I of course get
'(... #'FOO ...)
when what I'd like is:
'(... (FUNCTION FOO) ...)
Q is, how do I turn off that #' printing behavior?
please reply direct, I seem to be having trouble finding this newsgroup
in my browser :)
--
Clint Hyde "Give me a LispM or give me death!" -- anonymous
BBN Internet: ·····@bbn.com
Columbia, MD (410) 309-8361
From: Kent M Pitman
Subject: Re: some built-in printing behavior I want to turn off
Date:
Message-ID: <sfw1zsyxype.fsf@world.std.com>
Clint Hyde <·····@bbn.com> writes:
> Q is, how do I turn off that #' printing behavior?
You could bind *print-pretty* to nil. Or, if you need the pretty
printer, you could customize pretty-printing of FUNCTION. My recollection
is that this is easy to do, but I don't recall exactly how. You could
check CLHS.
http://www.harlequin.com/education/books/HyperSpec/FrontMatter/index.html
In the printer chapter, there's a section or two on controlling the
pretty printer.
From: Steven M. Haflich
Subject: Re: some built-in printing behavior I want to turn off
Date:
Message-ID: <35881A57.64993C84@franz.com>
Clint Hyde wrote:
> when I print the alist, I of course get
>
> '(... #'FOO ...)
>
> when what I'd like is:
>
> '(... (FUNCTION FOO) ...)
>
> Q is, how do I turn off that #' printing behavior?
You can specify the precise behavior in ANSI CL with set-pprint-dispatch:
(set-pprint-dispatch '(cons (member function))
(lambda (stm lst) (pprint-fill stm lst t)))
Remember that *print-pprint-dispatch* can be lambda bound if you want this
behavior only in certain contexts.