Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

#Clojure, 11 bytes

Clojure, 11 bytes

(defn x[]1)

At first I thought to just post a single character answer in the REPL like the other languages, e.g.

user=> 1
1

But the problem is that if you remove that character, the REPL doesn't do anything upon the enter keypress. So instead it had to be wrapped with a function as permitted by the question's rules. When you call this function, it returns 1. If you remove the only character in the function,

(defn x[])

the function returns nil which prints an additional two bytes.

user=> (defn x[]1)
#'user/x
user=> (x)
1
user=> (defn y[])
#'user/y
user=> (y)
nil

#Clojure, 11 bytes

(defn x[]1)

At first I thought to just post a single character answer in the REPL like the other languages, e.g.

user=> 1
1

But the problem is that if you remove that character, the REPL doesn't do anything upon the enter keypress. So instead it had to be wrapped with a function as permitted by the question's rules. When you call this function, it returns 1. If you remove the only character in the function,

(defn x[])

the function returns nil which prints an additional two bytes.

user=> (defn x[]1)
#'user/x
user=> (x)
1
user=> (defn y[])
#'user/y
user=> (y)
nil

Clojure, 11 bytes

(defn x[]1)

At first I thought to just post a single character answer in the REPL like the other languages, e.g.

user=> 1
1

But the problem is that if you remove that character, the REPL doesn't do anything upon the enter keypress. So instead it had to be wrapped with a function as permitted by the question's rules. When you call this function, it returns 1. If you remove the only character in the function,

(defn x[])

the function returns nil which prints an additional two bytes.

user=> (defn x[]1)
#'user/x
user=> (x)
1
user=> (defn y[])
#'user/y
user=> (y)
nil
Source Link

#Clojure, 11 bytes

(defn x[]1)

At first I thought to just post a single character answer in the REPL like the other languages, e.g.

user=> 1
1

But the problem is that if you remove that character, the REPL doesn't do anything upon the enter keypress. So instead it had to be wrapped with a function as permitted by the question's rules. When you call this function, it returns 1. If you remove the only character in the function,

(defn x[])

the function returns nil which prints an additional two bytes.

user=> (defn x[]1)
#'user/x
user=> (x)
1
user=> (defn y[])
#'user/y
user=> (y)
nil

AltStyle によって変換されたページ (->オリジナル) /