[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
LABEL
- To: (BUG LISP) at MIT-MC, (BUG COMPLR) at MIT-MC
- Subject: LABEL
- From: KMP at MIT-MC (Kent M. Pitman)
- Date: Fri, 15 Feb 80 10:53:00 GMT
- Cc: (FILE [AR2:KMP;LABEL ODDITY]) at MIT-MC
- Original-date: 15 FEB 1980 0553-EST
Did LABEL go away? COMPLR says it won't support it. But the interpreter
still supports:
;; 'Normal' recursive factorial
(DEFUN RECURSIVE-F (X)
((LABEL FOO #'(LAMBDA (X)
(COND ((ZEROP X) 1.)
(T (TIMES X (FUNCALL FOO (SUB1 X)))))))
X))
;; ... and (you guessed it, lossage fans) ... the iterative version ...
(DEFUN ITERATIVE-F (X)
((LABEL FOO #'(LAMBDA (X)
(SETQ FOO 1)
(DO ((X X (1- X)))
((< X 2) FOO)
(SETQ FOO (TIMES X FOO)))))
X))