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