Hi all,

I'm looking to perform string interpolation identically to
the #<# multi-line reader macro, but for single-line strings.
The string-utils package has set-sharp-string-interpolation-syntax
and string-interpolate, which do almost exactly what I want, but
the default interpolation only uses (interaction-environment),
which keeps a function like this from working:

(define (print-with-foo x)
   (display #"foo #{x}"))

Conversely, the following works, but doesn't scan as neatly to my eyes:

(define (print-with-foo x)
   (display #<#EOF
foo #{x}
EOF
   ))

I looked at setting the ENV parameter of string-interpolate,
but the 'environments' module has disappeared from CHICKEN 5,
so I can't even clumsily construct a string interpolation environment.

As a last resort, I could write my own reader macro, but I'd like
to explore any existing solutions before heading down that route.
(If someone on this mailing list is a read-syntax wizard and has a
pithy solution in mind, share it!)

Advice greatly appreciated.

Cheers,
Phil

_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to