I am having a tough time trying to find an example of converting a boolean to a string in Scheme.
My problem is that I use string-append to add a few strings together as part of a debugger. My fix was to check if equal to #t, then append "#t", and like-wise with #f.
My question- is there a method in Scheme to convert bools to strings? Something like bool->string?
My Code:
(if (equal? val #t)
(string-append (number->string count) ":" "#t")
(string-append (number->string count) ":" "#f") )
Use format
:
> (format "~a" #t)
"#t"
> (format "~a" #f)
"#f"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With