Carp icon indicating copy to clipboard operation
Carp copied to clipboard

FR: Better REPL output

Open glyh opened this issue 4 years ago • 2 comments

Here are some of the weird output in REPL:

> {1 1.0 2 2.0}
=> (() () () () () () () () () () () () () ((1 1.0)) ((2 2.0)) ()) ;; Expect: {1 1.0 2 2.0}
> (and true true true)
=> (if true (if true true false) false) ;; Expect: true

glyh avatar Jan 31 '22 10:01 glyh

Hi, thanks for reporting. I agree these are quite strange and confusing 😅 Will fix! (eventually)

eriksvedang avatar Feb 02 '22 08:02 eriksvedang

The map is an unfortunate side effect of the internal implementation bleeding out. We had an idea to implement a dynamic types and a protocol dispatcher (see #1177) but the implementation was deemed a little too magical (totally fair). I mention this because that would have meant that dynamic maps could have an implementation for str, which currently is not possible (it just prints lists, as shown above).

The other issue is the long-standing macro expansion versus evaluation in the REPL. I thought we had an approach to make it work at some point, but I guess it was never implemented :( My bad!

hellerve avatar Feb 02 '22 17:02 hellerve