Previous: , Up: compiler topics   [Index]


17.3.3 Handling of lambda expressions

Handling of assigned clambda bindigns

If a binding is assigned, it is defined by a bind struct:

(bind ((?lhs ?init))
  (seq
    (assign ?lhs ?rhs)
    ?rest))

and so it is transformed by introducing a vector to hold the read–write machine word:

(bind ((?tmp ?init))
  (bind ((?lhs (funcall (primref vector) ?tmp)))
    (seq
      (funcall (primref $vector-set!)
               ?lhs (constant 0) ?rhs)
      ?rest)))

if its ?init expression is a clambda struct, it is further transformed as follows:

(fix ((?tmp ?clambda))
  (bind ((?lhs (funcall (primref vector) ?tmp)))
    (seq
      (funcall (primref $vector-set!)
               ?lhs (constant 0) ?rhs)
      ?rest)))

so, in the end, clambda expressions originally bound to assigned bindings end up defined by fix forms.