Helmut Eller
10/13/2015 8:32:00 AM
On Mon, Oct 12 2015, james wrote:
> I want to see how the function values implementation, Is there any
> easy way? I am using slime+sbcl.
If you press M-. on values you will see a list like this:
/scratch/sbcl/src/code/eval.lisp
(defun values)
/scratch/sbcl/src/code/setf.lisp
(define-setf-expander values)
/scratch/sbcl/src/compiler/ir1opt.lisp
(:deftransform values "optimize")
/scratch/sbcl/src/compiler/srctran.lisp
(:defoptimizer values sb-c:derive-type)
(:define-source-transform values)
/scratch/sbcl/src/compiler/ir2tran.lisp
(:defoptimizer values sb-c:ir2-convert)
/scratch/sbcl/src/compiler/fndb.lisp
(declaim values sb-c:defknown)
As you can see the SBCL compiler tries to recognize and optimize a
number of different cases. The most important to understand is, I think,
(:defoptimizer values sb-c:ir2-convert). To understand that you need to
understand SBCLs IR2 representation.
Helmut