that's how common lisp and clojure still work too!
(defn foobar [] (undef-fn))
gives: 1. Caused by java.lang.RuntimeException
Unable to resolve symbol: undef-fn in this context
Attempting to call foobar: (foobar)
gives: 1. Unhandled java.lang.IllegalStateException
Attempting to call unbound fn: #'user/foobar
Environment info: ;; CIDER 1.3.0 (Ukraine), nREPL 0.9.0
;; Clojure 1.11.1, Java 18.0.2 (def undef-fn)
It should work after that.Evalutating this in CL (SBCL)
(undef-fn)
gives: Restarts:
0: [CONTINUE] Retry calling UNDEF-FN.
1: [USE-VALUE] Call specified function.
2: [RETURN-VALUE] Return specified values.
3: [RETURN-NOTHING] Return zero values.
4: [RETRY] Retry SLY interactive evaluation request.
5: [\*ABORT] Return to SLY's top level.
6: [ABORT] abort thread (#<THREAD "slynk-worker" RUNNING {100288C7E3}>)
[... as well as a clipped stack trace ...]
Pressing 1 will allow you to name an alternative function in a minibuffer prompt, 2 lets you set the return value of the undefined fn, etc.I guess the seamless continue without retry possibility could be useful if you are doing important side effects, but Clojure is quite functional unlike CL so it doesn't come up as much.