[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Some questions
- To: mips!pachyderm.earl@su-glacier.arpa (Earl Killian)
- Subject: Some questions
- From: Rob MacLachlan <RAM@C.CS.CMU.EDU>
- Date: Tue, 03 Jun 1986 04:19:00 -0000
- Cc: common-lisp@SU-AI.ARPA, glacier!franz!fimass!jkf@KIM.BERKELEY.EDU, ucbkim!Xerox.COM!miller.pa@SU-GLACIER.ARPA
- In-reply-to: Msg of 2 Jun 1986 21:49-EDT from mips!pachyderm.earl at su-glacier.arpa (Earl Killian)
Date: Monday, 2 June 1986 21:49-EDT
From: mips!pachyderm.earl at su-glacier.arpa (Earl Killian)
Re: Some questions
Unless, you're talking about self-recursive LABELS, note that
according to a discussion on this mailing list long ago, it is not
legal to implement
(defun revappend (a b)
(if (null a)
b
(revappend (cdr a) (prog1 a (setf (cdr a) b)))))
with a branch back to the beginning of the code, because function
calls are defined in terms of symbol-function of the symbol that
happens to be the car of a form.
I would be surprised if this was really the consensus. Tail-recursive
self-calls are such a common idiom in many people's lisp styles that
it is unreasonable to prohibit them turning into a branch. I think
that a compiler should be allowed to do recursive calls however it
pleases. Any optimization of this sort can be turned off by declaring
the function NOTINLINE, forcing a full function call.
Rob