(with (PIC (table) ;init empty table num-calls 0 orig-fn (fn (n) (+ (method n) (other-meth n)))) (def general-function (n) ((aif ; don't infer type: just look at the runtime type (PIC:type n) it (is optimization-trigger-level** (++ num-calls)) (do (= num-calls 0) (= (PIC:type n) (optimize* orig-fn (type n)))) orig-fn) n)))