Skip to main content
2 of 3
Accidentally posted the raw code instead of a anonymous function. Added 1 byte.
Carcigenicate
  • 3.6k
  • 2
  • 22
  • 30

Clojure, 43 bytes

#(and(=(.getDay(java.util.Date.))7)(/ 1 0))

Try it online!

Uses the fact that and doesn't evaluate the second argument unless necessary. I originally thought I could get away with using the Ratio literal 1/0 to save two bytes, but that unfortunately causes exceptions immediately. It must try to reduce the Ratio right away or something.

(defn sunday-fail []
  (and (= (.getDay (Date.)) 7)
       (/ 1 0)))

(and(=(.getDay(java.util.Date.))7)(/ 1 0))
Carcigenicate
  • 3.6k
  • 2
  • 22
  • 30