jank icon indicating copy to clipboard operation
jank copied to clipboard

REPL returns `nil` or throws when no value provided

Open frenchy64 opened this issue 11 months ago • 2 comments

Worth keeping mind when implementing *1.

;; jank
clojure.core=> ;comment
nil

clojure.core=> *1
unbound@0x1094c7360 for var #'clojure.core/*1

clojure.core=> #_a
nil



;; clj
user=> ;comment
user=> *1
1
user=> #_a


<nothing happens>

Similiar oddity for \<enter>

;; jank
clojure.core=> \
clojure.core=>...
nil


;; clj
user=> \

Syntax error reading source at (REPL:2:1).
EOF while reading character

Or even just pressing enter:

;; jank
clojure.core=>
Exception: unable to map file /var/folders/s5/309818k92r92zn9c_nzvmnzc0000gn/T/jank-repl-e833.jank due to error: unable to map file



;; clj
user=>
user=>

frenchy64 avatar Jan 30 '25 05:01 frenchy64

\ and then enter is a hack we have in place right now to allow multi-line REPL code. It should be replaced with logic to detect unexpected EOF and wait for more input.

The other notes here I think are valid bugs.

jeaye avatar Jan 30 '25 19:01 jeaye

Pressing enter now throws instead of nil.

clojure.core=>
Exception: unable to map file /var/folders/s5/309818k92r92zn9c_nzvmnzc0000gn/T/jank-repl-1ca7.jank due to error: unable to map file

frenchy64 avatar Feb 24 '25 23:02 frenchy64