Comment

Comment by lispm

How does it look like in Python? In Lisp:

  CL-USER 43 > (+ 1 (foo 20))

  Error: Undefined operator FOO in form (FOO 20).
    1 (continue) Try invoking FOO again.
    2 Return some values from the form (FOO 20).
    3 Try invoking something other than FOO with the same arguments.
    4 Set the symbol-function of FOO to another function.
    5 Set the macro-function of FOO to another function.
    6 (abort) Return to top loop level 0.

  Type :b for backtrace or :c <option number> to proceed.
  Type :bug-form "<subject>" for a bug report template or :? for other options.

  CL-USER 44 : 1 > (defun foo (a) (+ a 21))
  FOO

  CL-USER 45 : 1 > :c 1
  42
Note that we are not in some debug mode, to get this functionality. It also works for compiled code.

Lisp detects that FOO is undefined. We get a clear error message.

Lisp then offers me a list of restarts, how to continue.

It then displays a REPL one level deep in an error.

I then define the missing function.

Then I tell Lisp to use the first restart, to try to invoke FOO again. We don't want to start from scratch, we want to continue the computation.

Lisp then is able to complete the computation, since FOO is available now.

parent lispm 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton