Skip to main content
deleted 50 characters in body
Source Link
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))

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))

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)))
Accidentally posted the raw code instead of a anonymous function. Added 1 byte.
Source Link
Carcigenicate
  • 3.6k
  • 2
  • 22
  • 30

Clojure, 4243 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))

Clojure, 42 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))

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))
Source Link
Carcigenicate
  • 3.6k
  • 2
  • 22
  • 30

Clojure, 42 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))