Open ksev opened 2 weeks ago
This is due to std/core/show.kk
.
// Show a string as a string literal
pub noinline fun string/show( s : string ) : string
"\"" ++ s.list.map(show-char).join ++ "\""
I think we should change this to
// Show a string as a string literal
pub noinline fun string/show( s : string ) : string
"\"" ++ s ++ "\""
// Show a string as an escaped string literal
pub noinline fun string/show-raw( s : string ) : string
"\"" ++ s.list.map(show-char).join ++ "\""
The name of the old functionality should maybe be show-raw
, show-ascii
, or something like that.
I don't think we should get rid of the surrounding quotes though.
Thanks, for some context i was working on some C bindings (https://github.com/ksev/koka-duckdb/) and could not for the life of me figure out why converting duckdb's strings to koka strings did not work for me, turns out they did i was just fooled by what was shown.
This code:
Prints the following:
I'm using Koka 3.1.2 on Fedora 41.
This does not seem like the intended behaviour?