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

Re: About TRACE

	The following is a test function:

	(defun flatten (lst)
	   (cond ((null lst) nil)
	         ((atom (car lst)) (cons (car lst) (flatten (cdr lst))))
	         (t (append (flatten (car lst)) (flatten (cdr lst)))) ))

	This is what I get with Trace:


	Could someone explain what's going on here.

Notice the "(declare (noinline fact))" on page 255 of the manual?
Well include something like it for flatten in your definition above
and it will work.  If you (disassemble 'flatten) you will see that
Allegro compiles away the name of the function above unless you include a
notinline declaration.  To quote the documentation on page 253:
"Functions that are compiled inline cannot be traced. ...
Note that, by default, self-recursive calls are compiled as inline
branches.  To effectively trace a Function with self-recursive calls,
you should declare it not inline."