News for hackers. Stuff that matters.
Re:Tidy First? by pass_the_salt22 on Thursday January 11, 2024 @07:46AM (#38951497)
I miss this in LISP. It might force me to better structure my programs so that a lot of this is dealt with in an up-front manner or simply can’t occur. I do it all the time in JS though and love it.
Re:Tidy First? by srcreigh on Thursday January 11, 2024 @08:22AM (#38951859)

    (let/cc ret
      (when (= y 0) (ret nil)
      (/ x y))
Re:Tidy First? by Bost on Thursday January 11, 2024 @10:40AM (#38953679)
Your snippet is not working.

  #lang racket

  (define (division x y)
    (let/cc return
      (when (= y 0) (return null))
      (/ x y)))