Safely construct an svex for a function call, with rewriting.
Macro:
(defmacro svcall-rw (fn &rest args) (svcall-rw-fn fn args))
Function:
(defun svcall-rw-fn (fn args) (declare (xargs :guard t)) (b* ((look (assoc fn *svex-op-table*)) ((unless look) (er hard? 'svcall "Svex function doesn't exist: ~x0" fn)) (formals (third look)) ((unless (eql (len formals) (len args))) (er hard? 'svcall "Wrong arity for call of ~x0" fn))) (cons 'svex-rewrite-fncall (cons '1000 (cons '-1 (cons (cons 'quote (cons fn 'nil)) (cons (cons 'list args) '(t t))))))))