(in-package :jvm) (defun rewrite-function-call (form) (let ((op (car form)) (args (cdr form))) (if (and nil (listp op) (eq (car op) 'lambda)) (expand-function-call-inline form (cadr op) (cddr op) args) (if (unsafe-p args) (let ((arg1 (car args))) (cond ((and (consp arg1) (eq (car arg1) 'GO)) arg1) (t (let ((syms ()) (lets ())) ;; Preserve the order of evaluation of the arguments! (dolist (arg args) (cond ((constantp arg) (push arg syms)) ((and (consp arg) (eq (car arg) 'GO)) (return-from rewrite-function-call (list 'LET* (nreverse lets) arg))) (t (let ((sym (gensym))) (push sym syms) (push (list sym arg) lets))))) (list 'LET* (nreverse lets) (list* (car form) (nreverse syms))))))) form))))