[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What should be in T?
- To: Nix at YALE
- Subject: Re: What should be in T?
- From: Chris Riesbeck <Riesbeck at YALE>
- Date: Thu ,11 Jun 82 17:12:00 EDT
- Cc: T-Discussion at YALE
- In-reply-to: Your message of 11-Jun-82 2:50PM-EDT (Fri)
I agree with most of what Bob Nix had to say, except the following:
Biased Classification of Riesbeck's Utilities
=============================================
1. APPEND1 and APPEND1!
Where did the use of "1" arise, anyway? Class 2 form.
From NCONC1 in UCILisp, presumably for "NCONC one element." I sometimes
like CONSR for "CONS right" but then it gets confusing which order the
arguments should be in.
1. MSG -- (MSG -cmds-)
FORMAT seems clearly superior, so the only reason to have this is for
compatibility. I think that you should convert calls to MSG to
FORMAT in TLISP_TO_T. Class 7 form, that is superseded by a
good Class 6 form, so it should be flushed.
Sorry -- I think MSG is clearly superior. I find it much easier to write
(MSG T "X is " X " and Y is " (E (SPRINT Y 1)) T) than
(BLOCK (FORMAT SO "~%X is ~S and Y is ") (SPRINT Y 1) (FORMAT so "~%"))
for several reasons:
1. I like having things appear in the order in which they come out.
2. All those special characters in FORMAT really slow down my typing.
3. I like to mix in special printing with (E exp) without leaving
the MSG form.
4. MSG has a tabulation feature -- (T n) moves to column n. If this
is in FORMAT, it's not documented.
5. As implemented in T, MSG is open-ended. The user can define
his or her own command forms, e.g., (PP exp) to replace
(E (PP exp)), or (RJ exp) to right-justify exp.
I don't see how to add this flexibility to FORMAT.
I realize that people who work with PRINTF have FORMAT-style output in their
blood, and I'm happy to let them continue, but there's no way I'm flushing
MSG. I actually thought for a while about translating MSG to FORMAT and
realized how difficult that would be because MSG is so much more powerful.
I have changed the names of some things, e.g., (E exp) is actually (DO exp)
and (T n) is (COLUMN n), but on the whole I like MSG the way it is.
Note that MSG currently has no stream argument. My current plan is to
fix this with (STREAM exp), with STANDARD-OUTPUT as the default. This would
allow (but why would one want it?) changing streams in mid-message.
These already exist, although you may have different semantics in mind. If
you're happy with the T definitions, then these should be converted during
TLISP_TO_T:
2. ADD1 and SUB1 are 1+ and -1+. Class 4 form.
3. CONSP ==> is PAIR?. Class 4 form.
4. SUFLIST is NTHCDR. Class 4 form.
While I like 1+ and -1+, TLisp doesn't. I needed ADD1 and SUB1 for
compatibility with the output of TLISP_TO_T, not for future use.
CONSP is not PAIR?, because it returns the argument if it's a pair,
allowing me to write dirty code like (OR (CAR (CONSP X)) X). You can
take it out of T and I can't argue on aesthetic grounds, but I know
a number of people who will borrow it from me.
SUFLIST was obviously to be parallel to PRELIST, particularly because
they tend to be used to together. I'd like to have it as a synonym.
The only major disagreement is with MSG and FORMAT. There are just
two worlds here, systems programmers and non-sps.
-------