[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
:Structure-Print and *print-level*
- To: Scott E. Fahlman <Fahlman@C.CS.CMU.EDU>, Guy Steele <gls@THINK-AQUINAS.ARPA>, "BACH::GREEK" <firstname.lastname@example.org>, Dan Hoey <hoey@NRL-AIC.ARPA>, "BACH::ROBBINS" <email@example.com>, Rob MacLachlan <RAM@C.CS.CMU.EDU>
- Subject: :Structure-Print and *print-level*
- From: David A. Moon <Moon@SCRC-STONY-BROOK.ARPA>
- Date: Fri, 22 Nov 85 15:27 EST
- Cc: common-lisp@SU-AI.ARPA
- In-reply-to: <FAHLMAN.12161024452.BABYL@C.CS.CMU.EDU>, <851121112509.7.GLS@FAUSTINUS.THINK.COM>, <501445600/hoey@nrl-aic>, <FAHLMAN.12161093987.BABYL@C.CS.CMU.EDU>, <501463108/hoey@nrl-aic>, The message from "BACH::ROBBINS" <firstname.lastname@example.org>, <FAHLMAN.12161334664.BABYL@C.CS.CMU.EDU>, The message from "BACH::GREEK" <email@example.com>
Introducing magic hidden variables and kludgey recursive-p arguments to control
them is inviting disaster. I'm strongly opposed to this. We've had some experience
with this in Zetalisp and it is not good. It is always better to pass this kind
of state around as explicit arguments than to put it in hidden variables.
I fail to see what was wrong with the suggestion in Fahlman's original message of
adding a :DEPTH argument to WRITE, which defaults to 0 but can be supplied by a
structure's print function if it so desires.
I should think the answer to the question of whether a structure's print
function should increment the depth that it received as an argument
before passing it on to WRITE is perfectly obvious: it depends on
whether the print function printed any left parentheses before calling
WRITE. I think the fact that the print system has no reasonable way to
tell whether the print function printed any left parentheses, other than
the print function telling it so, counters Greek's argument that the old
thing should be automatic. Suppose the print function uses brackets as
part of its syntax and wants them treated as equivalent to a level
of parentheses for depth-abbreviation purposes.
I'm not concerned about the case of print functions that call FORMAT. FORMAT is
a convenient abbreviation mechanism for writing code to do simple forms of
formatting quickly. If you need to do something more complicated, you don't add
a new feature to FORMAT, you use Lisp instead of the FORMAT string language.