Up | Next | Prev | PrevTail | Tail |
EXPR PROCEDURE APPEND(U, V); |
IF | NULL U THEN V |
ELSE CAR U . APPEND(CDR U, V); |
EXPR PROCEDURE ASSOC(U, V); |
IF | NULL V THEN NIL |
ELSE | IF ATOM CAR V THEN |
ERROR(000, LIST(V, "is a poorly formed alist")) |
ELSE IF U = CAAR V THEN CAR V |
ELSE ASSOC(U, CDR V); |
EXPR PROCEDURE DEFLIST(U, IND); |
IF NULL U THEN NIL |
ELSE << | PUT(CAAR U, IND, CADAR U); |
CAAR U >> . DEFLIST(CDR U, IND); |
EXPR PROCEDURE DELETE(U, V); |
IF NULL V THEN NIL |
ELSE IF CAR V = U THEN CDR V |
ELSE CAR V . DELETE(U, CDR V); |
EXPR PROCEDURE DIGIT(U); |
IF MEMQ(U, ’(!0 !1 !2 !3 !4 !5 !6 !7 !8 !9)) |
THEN T ELSE NIL; |
EXPR PROCEDURE LENGTH(X); |
IF ATOM X THEN 0 |
ELSE PLUS(1, LENGTH CDR X); |
EXPR PROCEDURE LITER(U); |
IF | MEMQ(U, ’( | !A !B !C !D !E !F !G !H !I !J !K !L !M |
!N !O !P !Q !R !S !T !U !V !W !X !Y !Z |
!a !b !c !d !e !f !g !h !i !j !k !l !m |
!n !o !p !q !r !s !t !u !v !w !x !y !z)) |
THEN T ELSE NIL; |
EXPR PROCEDURE MEMBER(A, B); |
IF NULL B THEN NIL |
ELSE IF A = CAR B THEN B |
ELSE MEMBER(A, CDR B); |
EXPR PROCEDURE MEMQ(A, B); |
IF | NULL B THEN NIL |
ELSE IF A EQ CAR B THEN B |
ELSE MEMQ(A, CDR B); |
EXPR PROCEDURE NCONC(U, V); |
BEGIN SCALAR W; |
IF NULL U THEN RETURN V; |
W := U; |
WHILE CDR W DO W := CDR W; |
RPLACD(W, V); |
RETURN U |
END; |
EXPR PROCEDURE PAIR(U, V); |
IF AND(U, V) THEN (CAR U . CAR V) . PAIR(CDR U, CDR V) |
ELSE IF OR(U, V) THEN ERROR(000, |
"Different length lists in PAIR") |
ELSE NIL; |
EXPR PROCEDURE REVERSE(U); |
BEGIN SCALAR W; |
WHILE U DO << | W := CAR U . W; |
U := CDR U >>; |
RETURN W |
END; |
EXPR PROCEDURE SASSOC(U, V, FN); |
IF NULL V THEN FN() |
ELSE IF U = CAAR V THEN CAR V |
ELSE SASSOC(U, CDR V, FN); |
EXPR PROCEDURE SUBLIS(X, Y); |
IF NULL X THEN Y |
ELSE BEGIN | SCALAR U; |
U := ASSOC(Y, X); |
RETURN | IF U THEN CDR U |
ELSE IF ATOM Y THEN Y |
ELSE | SUBLIS(X, CAR Y) . |
SUBLIS(X, CDR Y) |
END; |
EXPR PROCEDURE SUBST(U, V, W); |
IF NULL W THEN NIL |
ELSE IF V = W THEN U |
ELSE IF ATOM W THEN W |
ELSE SUBST(U, V, CAR W) . SUBST(U, V, CDR W); |
Up | Next | Prev | PrevTail | Front |