Comment

Comment by sczi

Oooh now that is interesting. What I by mean stuff I don't even know that I don't know :)

Yes mine doesn't handle that, it is the same as jupyter there. Smalltalk is supposed to be best at interactive development, I wonder if it will update the old closures. I don't know it to try, but I do know Common Lisp which is also supposed to be quite good, and fwiw it behaves the same, new closures have the new code, but the old ones are not updated:

  (use-package :serapeum)
  (defun adder (x)
    (flet ((inner (y) (/ x y)))
      #'inner))
  
  (defparameter *adders* (dict))
  
  (defun add (x y)
    (ensure (@ *adders* x) (adder x))
    (funcall (@ *adders* x) y))

  (add 3 6) ; => 1/2
  (add 3 9) ; => 1/3
  ;; change / to + in inner
  (add 4 9) ; => 13
  (add 3 10) ; => 3/10
parent sczi 1 year ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton