Previous: , Up: compiler dircalls   [Index]


17.9.4 Examples of debug-call integration

As example of integration, the standard language form:

((lambda (x) x) 1)

is expanded into the core language form:

(annotated-call ?annotation-struct
                (annotated-case-lambda #'(lambda (x) x)
                                       ((x x)))
                (quote 1))

which is recordised as:

(funcall (primref debug-call)
         (constant (?annotation-source . ((lambda (x) x) '1)))
         (lambda (x_0) x_0)
         (constant 1))

and integrated as:

(bind ((x_0 (constant 1)))
  x_0)

where we can see there is no more a function application.

Another example, the standard language form:

((let ((f (lambda (y) y)))
   f)
 '1)

is expanded and recordised into:

(funcall (primref debug-call)
         (constant (?annotation-source
                    . ((let ((f (lambda (x) x))) f) 1)))
         (bind ((f_0 (lambda (x_0) x_0))) f_0)
         (constant 1))

and integrated as:

(bind ((f_0 (lambda (y_0) y_0)))
  (funcall (primref debug-call)
           (constant (?annotation-source
                      . ((let ((f (lambda (y) y))) f) 1)))
           f_0
           (constant 1)))

where we can see the debug-call moved into the body.