;;;; A class and a generic function, for the dev loop rather than for output. ;;;; ;;;; What a session does with this is the question the feature is judged on: ;;;; adding a method to a running program has to reach the call sites that ;;;; were compiled before the method existed. It does, and the reason is that ;;;; a generic is one function — the methods are branches of its body, not ;;;; functions of their own — so a new method is the ordinary redefinition of ;;;; one name, through the cell the call already goes through. ;;;; ;;;; It keeps running rather than returning, for dev-repl.flan's reason: an ;;;; expression typed at the editor is a thunk the agent runs at a frame ;;;; boundary, and a parked program has none. (import agent "vendor:agent") (defclass point [x y]) (defclass circle [r]) (defgeneric area [self] dyn) (defmethod area point [p] (* (get p :x) (get p :y))) (defn main [] i32 (agent/start "/tmp/flan-dev-class-fallback.sock") (dotimes [i 4000] (agent/wait 5)) 0)