MTS 8: LISP and SLIP in MTS
June 1976
Examples:
.?
:(COND ((NULL X) NIL) (T (CONS X X)))
.EMBED NULL IN (PRINT *) ?
:(COND ((PRINT (NULL X)) NIL) (T (CONS X X)))
Command: EXTRACT p1...pn FROM q1...qn
The EXTRACT command replaces the element designated by "q1...qn"
with the element designated by "p1...pn". The element designated
by "p1...pn" must be a substructure of that designated by "q1...qn
UP". EXTRACT may be abbreviated to EX.
Examples:
.?
:(COND ((NULL (CAR X)) NIL) (T (CONS (CAR X)(CADR X))))
.EXTRACT CAR FROM NULL : ?
:(COND ((CAR X) NIL) (T (CONS (CAR X) CADR X))))
.EXTRACT CONS FROM COND : !0 ?
:(LAMBDA (X) (CONS (CAR X) (CADR X)))
The remaining commands in this section move elements to higher or
lower levels in the structure. In the printed form, this appears to
have the effect of adding, removing, or shifting parentheses.
Commands: ML ±n p1...pn
MR ±n p1...pn
The ML command moves the left parenthesis of the element designated
by "p1...pn" ±n elements to the right. The MR command moves the
right parenthesis in the same way. "p1...pn" must designate a
nonatomic element.
Examples:
.?
:(A B C (D E F) G H I)
.ML -1 4 : ?
:(A B (C D E F) G H I)
.ML 3 C : ?
:(A B C D E (F) G H I)
.MR 2 F : ?
:(A B C D E (F G H) I)
.MR -1 F : ?
:A B C D E (F G) H I)
96 The LISP Editor

MTS 8: LISP and SLIP in MTS
June 1976
Command: BI p1...pn THRU q1...qn
The BI command (mnemonic for Both In) adds parentheses around the _ _
sequence of elements beginning with the element designated by
"p1...pn" and ending with the element designated by "q1...qn". The
designated elements must be members of the same list, and "p1...pn"
must precede "q1...qn".
Examples:
.?
:(A B C D E F)
.BI B THRU E : ?
:(A (B C D E) F)
.BI C THRU D : ?
:(A (B (C D) E) F)
.BI 1 NX THRU -1 BK : ?
:(A (( B (C D) E)) F)
Command: BO p1..pn
The BO command (mnemonic for Both Out) removes parentheses from the _ _
element designated by "p1...pn". This element must be nonatomic.
Examples:
.?
:(A ((B (C D) E)) F)
.BO C : ?
:(A ((B C D E)) F)
.BO 2 : ?
:(A (B C D E) F)
.BO 1 NX : ?
:(A B C D E F)
COMMANDS FOR ERROR RECOVERY ___________________________
Each time a structural change is made using a command that modifies
the current expression, the LISP system keeps a record of the changes
made so that they can later be reversed. It is always possible to
reverse any changes made since the invocation of the LISP editor. This
feature allows the user to experiment without fear of permanent damage;
such experimentation is encouraged.
Command: ??
The ?? command prints a list of the structure modification
commands which have been executed, in inverse order of their
execution.
The LISP Editor 97
Previous Page Next Page