[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Some questions

    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)
    	      (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.