perm filename WARREN.TXT[PAT,LMM] blob sn#061081 filedate 1973-09-04 generic text, type T, neo UTF8
COMMENT ⊗   VALID 00004 PAGES 
RECORD PAGE   DESCRIPTION
 00001 00001
 00002 00002	1. FUTURE - LOOKUP LAST AND MEMB SO USER CAN MAKE FAST DECLARATION.
 00009 00003	Date:  2-SEP-73 1201		From: TEITELMAN
 00023 00004	Date:  4-SEP-73  404
 00024 ENDMK
⊗;
1. FUTURE - LOOKUP LAST AND MEMB SO USER CAN MAKE FAST DECLARATION.
6.  LOOK UP RPLACA AND RPLACD SO USER CAN DECLARE FOR FRPLACA AND
/RPLACA, ETC.  IF YOU WANT TO INSTALL LOOKUP NOW, DO 

(CLISPLOOKUP FN-NAME NIL NIL (GETP FN-NAME 'LISPFN)),

OR TO BE MORE EFFICIENT, SINCE MOST FUNCTIONS WONT HAVE THEIR OWN
DECLARATIONS, INCLUDE THE CODE FROM THE FUNCTION CLISPLOOKUP (WHICH
IS CONTAINED IN THE FILE CLISP) INYOUR OWN BLOCK. CLISPLOOKUP0 IS
OUTSIDE OF THE DWIMBLOCK SINCE IT IS ONLY CALLED WHEN A FULL LOOKUP
HAS TO BE DONE.  IN MOST CASES,  THE SIMPLE FUNCTION SHOWN IN
CLISPLOOKUP WILL SUFFICE.


2. USE ASSOC WHERE POSSIBLE, AND LOOK IT UP ALSO SO USER CANUSE
FASSOC.

3. INSTALL A FLAG OR NEW E.P. (ELEMENTARY PATTERN) CORRESPONDING TO
$ THAT DOES NOT CONTINUE SEARCHING ONCE IT SUCCEEDS (FUZZY CONCEPT),
E.G. ($ ('A $2) $) WOULD BE AN ASSOC WITH A CHECK ON THE LENGTH OF
THE EEMENT,  BUT WOULD NOT CONTINUE SEARCHING FOR ANOTHER 'A,
SIMILARLY ($ 'A 'B $) WOULD BE (EQ (CADR (MEMB 'A X) 'B)). I THINK
THE DEFAULT FOR $ SHOULD BE THIS WAY,  AND THAT SOMETHNG LIKE $$
WOULD MEAN SEARCH YOUR ASS OFF.

7. CHANGE THE INITIAL VARIABLE DEFAULT TO = AND POSTPONE-SETQ-FLG TO
NIL,  I.E. DONT POSTPONE.

8. MAKE SURE THAT POSTPONE SETQ FLG REALLY WORKS. FOR EXAMPLE IN THE
PATTERN (A←($ !B←'FOO ($ !==C))), IF POSTPONESETQFLG IS NIL,  THEN
THERE IS NO NEED FOR DUMMY VARIABLES NOR FOR A PROG,  I.E. YOU CAN
USE THE VARIABLES MENTIONED IN THE PATTERN FOR STORING TEMORARY
RESULTS.

9. X:($1 *←!(3 4) 5) CAN YOU IMPROVE THE DIAGNOSTIC SO AS NOT TO BE
SO SCARY? ALSO WHY ARE 3 AND 4 QUOTED AND 5 DEFAUTED (ACTUALLY 3 4
AND 5 SHOULD BE LEFT AAONE SINCE THEY ARE NUMBERS, BUT I PRESUME IF
THEY HAD BEEN LITATOMS THE SAME WOULD HOLD)

10. WHY DOES X:($ !X←(3 4) $) GO TO A PROG, BUT X:($ X←(3 4) $) TO A
SOME?

12. *****WRONG - X:($ !(A B) C D) ALSO X:($ !($1 $2) $3) X:($ !(A B)
C D $)

13. LOOK AT X:($ Z $) WITH DEFAULT FOR ASSIGNMENT. I DONT UNDERSTAND
THE SOME WITH (LAMBDA (X) T)

14. X:($ 'A !* $1) COULD BE BETTER.

15. IN YOUR WRITEUP, DID YOU MEAN THAT !  WORKS ON ALL PATTERNS THAT
APPEAR AS THE LAST ELEMENT, BUT ONLY !* AND !(SUBPATTERN) WORK IN
THE INTERIOR? I THINK THIS IS WHAT YOU MEAN, I.E. != OR !== IS OK AS
THE LAST E.P.  ALTHOUGH YOU SAY ONLY !* AND !(SUBPATTERN) ARE
IMPLEMENTED.

16. I GUESS YOU KNOW THAT ($ X←!(PATTERN) $) DOESNT WORK.

18. ($1 Y←$3 $1) DOESNT WORK. I THINK THIS IS REALLY A CASE OF A
HIDDEN ! IN THE MIDDLE, BUT IT ISNT EXPLAINED IN THE WRITEUP, AND I
EITHER HAVE TO EXPLAIN IT OR ELSE IT HAS TO WORK.

19. ****WRONG ($1 'C Y←$1 $) DOESNT DO CDDR CHECK.

21. ($ ! 'A) SHOULD BE (EQ (CDR (LAST --)) NOT (AND (SETQ --) (EQ
--)) I WOULD LIKE TO SEE YOU TRY HARD TO AVOIDE UNNECESSARY PROGS
AND DUMMY VARIABLES.

23. ALSO INSTALLING AN (AND) AND (OR) + AND | I.E. ONE MIGHT SAY

 =X|=Y , =X(OR)=Y , ¬=X(AND)¬=Y , ETC.

I MENTION THESE BECAUSE IN LOOKING THROUGH MY LISTINGS FOR AN
EXAMPLE TO USE IN MY PAPER, I WAS MOST OFTEN FRUSTRATED BECAUSE WE
DID NOT HAVE ¬, &, OR |.

→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→WHAT DOES THIS MEAN?

4. CHECK AND SEE WHERE EXTRA SPACES MAKE A DIFFERENCE. IN PARTICULAR
($ = = X $) AND ($ == X $) ARE NOT EQUIVALENT. THIS SHOULD BE FIXED.


→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→DONE

5.  DONT QUOTE NUMBERS. EVEN IF DEFAULT IS FOR QUOTE OR ASSIGNMENT,
NUMBERS SHULD ALWAYS GO IN AS JUST NUMBERS.

11. X:($1 !X←$1 $2) DONT NEED THE EXTRA T, ALSO FOR X:($ !X←... $)
IN GENERAL, THERE ARE MAAY CASES WHERE YOU ALREADY KNOW THAT THE
RESULT OF THE SETQ IS NON NIL, SO YOU DONT HAVE TO PUT IN THAT T ATT
THE END.

20. USE NULL FOR NOT IN TRANSLATION WHEN WHAT IS MEAAT IS EQ NIL.
I.E. FOR ALL CASES IN THE CURENT CONFIGURATION..

22. THINK ABOUT INSTALLING A ¬ NOT PATTERN- I.E. TILDE, E.G. ¬=FOO,
¬&@NUMBERP, ETC.

→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→NOT GOING TO DO

17. ($1 'A $ 'B) GOES TO (AND (EQ --) (EQ (CAR (LAST (CDDR X)) 'B) I
THINK ON LAST'S, YOU MIGHT AS WELL JUST SAY (LAST X) AS (LAST (CDDR
X)) - I UNDERSTAND THAT IN THE CASE OF MEMBS IT MAKES A DIFFERENT,
E.G. ($1 'A $ 'B $),  YOU WOULD WANT TO SAY (MEMB 'B (CDDR X)) SINCE
THE FIRST ELEMENT MIGHT BE B.

Date:  2-SEP-73 1201		From: TEITELMAN

␈↓↓1)␈↓α PRINTSTRUCTURE DOES CHECK CLISPHASHARRAY. DO YOU HAVE
ANY EVIDENCE TO THE CONTRARY?

␈↓↓2)␈↓α NO TO STOP MACRO. 

␈↓↓3)␈↓α PLEASE MAKE A VERSION OF THE FILE MBDNOTES IN WALKERS DIRECTORY
THAT WILL COMPILE CORRECTLY. SAVE THE BUGGY VERSION IN YOUR
DIRECTORY FOR WHEN ALICE FIXES THE COMPILER (TO CHECK IT OUT). IF
THE FIX REQUIRES CHANGING SOME LABELS OR REARRANGING A LITTLE BIT, DO
IT. TELL WALKER WHAT YOU DID AND MAKE SURE HE INCORPORATES THE CHANGES
BACK INTO HIS FILE. THIS IS IMPORTANT AS PETER DOESN'T HAVE A VERSION
WHICH WORKS NOW.

␈↓↓4)␈↓αIN  LP (COND (& -- (GO LP)) (T --))
WOULD YOU HAVE BEEN SATISFIED IF
IT CLISPIFIED TO
LP (WHILE & DO --) -- ...)?

␈↓↓5)␈↓αIN IF STATEMENTS, PRETTYPRINT ONLY PUTS THEM ON THE SAME  LINE
IF (1) THE STATEMENTS CONTAIN NO SUBEXPRESSION, I.E. ARE LINEAR AND
   (2) IF IT DOES THINK THEY WILL FIT, I.E. AS SOON AS IT REACHES
     ONE THAT IT THINKS WILL NOT FIT, IT STARTS THE NEW LINE.
FOR EXAMPLE IN
  (IF &
    THEN (FOO A) (FOO1 B C D ) (FOO2 E F G) (FOO3 X Y)
         (FUM (ZIP X)
              (ZAP X]

NOTE THAT THE FITTING ALGORITHM MAKES SOME ASSUMPTIONS
ABOUT THE AVERAGE LENGTH OF ATOMS (IT DOESNT BLAST THEM APART)
AND IF YOU HAPPEN TO HAVE A FORM WITH LONG ATOMS IN
NEAR THE RIGHT HAND MARGIN THIS WILL FAIL. 

I CAN
 (A) MAKE THE AVERAGE LENGTH OF ATOMS CURRENTLY SET TO 5 BE A VARIABLE
AVAILABLE TO YOU
 (B) USE A MORE CONSERVATIVE ESTIMATE CLOSE TO THE RIGHT HAND MARGIN
 (C) PUT IN MORE THAN ONE SPACE BETWEEN STATEMENTS ON THE SAME LINE.

␈↓↓6)␈↓αI MAY START SOUNDING SURLY SOON.
HERE IS THE SCOOP ON PRETTYPRINT. I SPENT ABOUT HALF AN HOUR
DIGGING INTO IT AND THERE ISN'T MUCH I CAN SEE TO DO
SHORT OF ABANDONING THE DISCIPLINE THAT SAYS
THAT IN CLISP SEGMENTS, I.E. BETWEEN CLISPWORDS,
IF A LIST ITSELF DOES NOT CAUSE A CARRIAGE RETURN INTERNAL
DO NOT CARRIAGE RTURN AFTER IT.
IN YOUR FIRST CASE, WITH FOO,
SINCE VAR←, <'CDDDR VAR> AND I← ARE ALL ATOMS,
THEY ARE PRINTED ON THE SAME LINE. YOU WOULDNT WANT THEM IN
COLUMNS. AFTER AN ATOM ENDING IN A CLISP OPERATOR,
PRETTYPRINT NEVER SPACES, SO THERE IS NO PLACE IN THAT FUNCTION
THAT IS EFFECTED BY THE DECISION TO TREAT LINEAR LISTS
AS ATOMS. FURTHERMORE, EXPECTING PRETTYPRINT
TO KNOW THAT AFTER VAR>   THE END OF A
"CLUSTER" WAS REACHED, REQUIRES IT TO HAVE ALL THE INFORMATION
THAT DWIMIFY HAS, AND MORE.

IN FIE, THE SITUATION IS A LITTLE MORE SUSCEPTIBLE
TO ANALYSIS, AND MAYBE YOU'LL SUGGEST SOMETHING.
PRETTYPRINT PROCEEDS BY FIRST ASKING WHETHER THE
EACH LIST CAN FIT BEFORE DECIDING WHETHER TO START A
NEW LINE.
IN FIE, THE PROBLEM IS THAT A VERY LONG STRING APPEARS AT THE RIGHT
MARGIN. IF THIS WERE A NORMAL ATOM, NO PROBLEMS
WOULD OCCUR, SINCE THERE IS ROOM FOR SEVEN CHARACTERS.

THE PROBLEM GOES AWAY WHEN I INSTALLED THE SPACE TWO
CHARACTERS BETWEEN LISTS, SINCE THEN THERE IS ONLY ROOM FOR
THREE CHARACTERS, AND THE FITP ALGORITHM DETECTS THIS.
ANYWAY, I GUESS STRINGS OCCUR SUFFICIENTLY RARELY, AND
THEIR STATISTICS ARE SUFFICIENTLY SCREWED UP THAT
THEY DESERVE A MORE ACCURATE ACCOUNTING, SO I MADE FITP
ACTUALLY DO AN NCHARS WHEN IT ENCOUNTERS A STRING, AND
IN THIS CASE, IT WILL PRINT EVERYTHING ON THE SAME LINE
IF IT FITS, AND IN YOUR CASE, PRINT A CARRIAGE RETURN
BEFORE THE (PRINT ...)
BEFORE WE CLOSE THIS SUBJECT, YOUR COMMENT
BREVITY IS NICE, LEGIBILITY IS IMPORTANT, LEADS ME TO BELIEVE
THAT YOU THINK THIS "JUST HAPPENED" I.E. THE PRINTING
OF IFS AND THENS THIS WAY. NOT ONLY DID IT TAKE A FAIR
AMOUNT OF THINKING ABUT AND EXPERIMENTING TO DECIDE WHAT
 LOOKED NICE (PLUS CONSULTING MANY OTHERS ON THEIR OPINION)
BUT AN AWFUL LOT OF HACKING WITH SOME VERRY MESSY CODE.
I HAVE PROBABY SPENT IN THE VICINITY OF 50 HOURS ON
PRETTYPRINT TO MAKE IT WORK ON CLISP  THE WAY
IT DOES. CONSTRUCTIVE SUGGESTIONS ARE WELCOME.

␈↓↓7)␈↓αTHERE ARE LOTS OF PLACES WHERE (DWIMIFY (CLISPIFY PURE-LISP))
ISNT THE ORIGINAL. E.G.
(DWIMIFY (CLISPIFY (APPEND (LIST X) Y))) IS (CONS X Y)
I HAVE FIXED THE WHILE DO SO THAT IT DOESN'T
MAKE THINKS LIKE (IF T THEN --). 

␈↓↓8)␈↓αRe:   REMOVING PARENTTHESES IN IF ANTECEDENTS IN PROGS.
FIXED.
ALSO, YOUR VARIOUS EXAMPLES ALSO SUGGESTS
THAT IF THE USER IS EDITING THE EXPRESSION
(ITIMES A B) AND REPLACES A WITH X+Y, IT WILL
NOT CLISIFY CORRECTLY. GUESS I HAVE TO DWIMIFY
WHENEVER I SEE AN ATOM WITH FUNNY CHARS IN IT
WHEN THE EXPRESSION IS TO BE CONVERTED TO INFIX OPERATORS.

(I THOUGHT I WAS DONE LAST NIGHT).

␈↓↓9)␈↓αFIXED THE (OR TEM←(GETP X 'FOO) (PRINT MESSAGE))
IT NOW FIRST DWIMIFIES THE TEM←  PART.

ONLY DOES THIS WHEN NECESSARY.

␈↓↓10)␈↓αOTHER RAMIFICATIONS OF PARTIAL CLISPIFYING,
IF YOU CLISPIFY (IF A AND (OR B C) THEN -- THE PARENTHESES
GET TAKEN OUT BECAUSE IT DOESNT NOTICE THE AND.

␈↓↓11)␈↓αRE IMPLICIT VARIABLES...
DO YOU REALLY THINK THAT PEOPLE WILL WANT
TO SEE (OR WORSE BE ASKED) MESSAGES ABOUT SUCH CORRECTIONS,
E.G. FOR X IN Y BY CDDR DO ...  AND HAVE
DWIM SAY CDDR -> (CDDR X) ?

I UNDERSTAND AND AGREE WITH THE ESSENCE OF YOUR ARGUMENT
ABOUT TRANSFORMATIONS THAT ARE AFFECTED BY CONTEXT AS
REQUIRING INTERACTIONS, BUT AM NOT SURE WHAT TO DO IN
THIS CASE. I PERSONALLY FROWN VERY STRONGLY ON USING
THE SAME NAME FOR BOTH FUNCTIONS AND VARIABLES, AND
***TAKE NOTE*** THE PROBLEM WILL GET WORSE WHEN
WE START HAVING MORE SOPHISTICATED CORRECTIONS, I.E.
IF ONE IS TRYING TO WRITE A SYSTEM TO DISAMBIGUATE
AND THE USER IS INSERTING A LOT OF AMBIGUITY ....

WOULD YOU AGREE THAT IF THE 'FN' IN QUESTION WERE
LIKE CDR, OR ATOM, OR NUMBERP (AS OPPOSED TO VALID
WHICH YOU DEFINED), THAT THE CORRECTION SHOULD
BE DONE AUTOMATICALLY, AND SHOULD THE USER BE  INFORMED?

CALL ME WHEN U GET A CHANCE AS I  WANT TO DISCUSS
THE CLISPIFY PROBLEM WITH YOU ALSO.

␈↓↓12)␈↓αRe:   SURRENDER
OK. I PUT IN THE #$'&$#@*> (THAT'S NOT DLS GARBAGE)
THING FOR MESSAGES ON USE OF FUNCTION NAME
AS A FORM. 


␈↓↓13)␈↓αRE THE LAST ITEMS IN YOUR MESSAGE FILE.
I LOOKED AT NESTED FORS. TOO HARD. IT IS MAKING
THEM WORK IN SITUATIONS LIKE
IN X FOR Y FROM 1 TO 10 DO ...  I.E. FIRST FOR IMPLICIT,
PLUS INTERACTIONS WITH AS ETC. ALSO
IT IS A CHANGE IN A WHOLE NEW DIRECTION IN THAT
IT DOESNT FIT INTO THE TEMPLATE FOR ITERATIVE
STATEMENTS AS THEY STAND RIGHT NOW. SORRY.

␈↓↓14)␈↓αRE SUM, PRODUCT, MAXIMUM, ET AL.
I DDNT LIKE THE SYNTAX FOR THEN OR THEREIS. HOWEVER,
I HAVE INSTALLED A FEATURE WHICH LETS YOU DEFINE
NEW I.S.TYPES SUCH AS SUM PRODUCT ETC., OR
EVEN CHANGE COLLECT. THERE IS A FUNCTION CALLED
I.S.OPR WHICH TAKES FOUR ARGUMENTS: NAME,
FORM, INIT, AND VAL.
FORM IS THE THING TO BE DONE EACH TIME. * STANDS
FOR THE ARGUMENT TO THE OPERATOR, AND $$VAL INDICATES
THE VALUE, E.G. FOR
RCOLLECT, FORM WOULD BE (CONS * $$VAL), FOR
COLLECT AS IT NOW STANDS (NCONC1 $$VAL *).
INIT IS OPTIONAL AND IS AN INITIALIZING FORM, E.G.
FOR SUM, INIT WOULD BE 0, FOR PRODUCT IT WOULD BE 1.
VAL IS ALSO OPTIONAL AND SPECIFIES A RETURN VALUE.
IF NIL, (RETURN $$VAL) IS SUPPLIED. HOWEVER,
YOU MIGHT DEFINE COLLECT AS
I.S.OPR(COLLECT (CONS * $$VAL) NIL (DREVERSE $$VAL))

I.S.OPR DOES ALL THE STUFF TO THE PROPERTY LISTS,
AS WELL AS ADDING THINGS TO SPELLING LISTS ETC.
IT ALSO HANDLES THE LOWER CASE VERSION.
IT IS UNDOABLE.
I'M SURE YOU'LL GO BATSHIT.
I'LL LET YOU KNOW AS SOON AS I LOAD UP.

␈↓↓15)␈↓αRe:   NEW FEATURE IN FOR STATEMENTS
cc:   DEUTSCH, LAMPSON, MCCREIGHT, RULIFSON, BOBROW, TESLER
- - - -
AS SOON AS I LOAD UP AGAIN, THE NEW SYSTEM WILL HAVE
A SIMPLE WAY OF EXTENDING THE SYNTAX OF FOR STATEMENTS
TO PERMIT SPECIFYING SUMS PRODUCTS, MAXIMUM MINIMUM
ETC. ETC.  READ <LISP>LISP.MEMO

␈↓↓<LISP>LISP.MEMO)␈↓α
NEW I.S.OPERATORS

THE FUNCTION I.S.OPR PROVIDES A WAY OF DEFININT
NEW I.S.OPERATORS. CURRENTLY, COLLECT, JOIN, DO, AND SUM
ARE DEFINED. I.S.OPR IS A FUNCTION OF FOUR ARGUMENTS:
(NAME FORM INIT VAL). NAME IS THE NAME OF THE OPERATR,
E.G. COLLECT, PRODUCT, ETC.  FORM IS
THE FORM TO BE EVALUATED EACH ITERATION. IN FORM,
$$VAL IS USED TO REFERENCE THE VALUE BEING ASSEMBLED,
AND * CORRESPONDS TO THE ARGUMENT IN THE ITERATIVE STATEMENT
FOLLOWING NAME, E.G. FOR COLLECT AS IT IS NOW DEFINED,
FORM IS (NCONC1 $$VAL *). FOR SUM,
(IPLUS $$VAL *). 
INIT IS OPTIONAL AND SPECIFIES AN INITIAL VALUE
FOR $$VAL, E.G. FOR SUM INIT IS 0.
VAL IS OPTIONAL AND SPECIFIES THE RETURN VALUE.
IF NIL, (RETURN $$VAL) IS SUBSUMED. 

EXAMPLES:
TO DEFINE A VERSION OF COLLECT WHICH USES CONS INSTEAD
OF NCONC1 AND THEN REVERSES THE VALUE
I.S.OPR(RCOLLECT (CONS * $$VAL) NIL (DREVERSE $$VAL))

TO DEFINE PRODUCT:
I.S.OPR(PRODUCT (ITIMES * $$VAL) 0)
TO DEFINE A VERSION OF COLLECT WHICH USES TCONC:
I.S.OPR(TCOLLECT (TCONC $$VAL *) NIL (CAR $$VAL))

I.S.OPR PERFORMS THE APPROPRIATE PROPERTY LIST
UPDATING, AS WELL AS ADDING NAME TO THE VARIOUS
SPELLING LISTS. I.S.OPR ALSO TAKES CARE OF
THE LOWER CASE VERSION OF NAME.
Date:  4-SEP-73  404
From: TEITELMAN
- - - -
THE NEW LISP HAS EVERYTHING FIXED EXCEPT FOR THE
COMPILER BUG, AND PARTIALLY CLISPIFIED EXPRESSIONS
CONTAIING ANGLE BRACKETS (BECAUSE OF JACKSONS CODE).
ALL OF YOUR PROBLEMS AND THE SUGGESTIONS I RESPONDED TO
YOU ABOUT IT ARE IMLEMENTED. CLISPIFY SHOULD WORK
ON ALL PARTIALLY CLISPIFIED EXPRESSIONS.
TRY TO BREAKIT AND LET ME KNOW HOW IT GOES.

WARREN