mini-carcdr.red 429 B

1234567891011121314151617181920212223242526
  1. % MINI-CAR-CDR.RED
  2. % ---- Some Basic LIST support Functions
  3. Procedure Car x;
  4. if Pairp x then car x else <<Print "*** Cant take CAR of NON PAIR";NIL>>;
  5. Procedure Cdr x;
  6. if Pairp x then cdr x else <<Print "*** Cant take CDR of NON PAIR";NIL>>;
  7. % -- CxxR -- may need in EVAL if not open coded
  8. Procedure Caar x;
  9. Car Car x;
  10. Procedure Cadr x;
  11. Car Cdr x;
  12. Procedure Cdar x;
  13. Cdr Car x;
  14. Procedure Cddr x;
  15. Cdr Cdr x;
  16. end;