chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] string interpolation


From: Kon Lovett
Subject: Re: [Chicken-users] string interpolation
Date: Mon, 25 Mar 2019 15:39:07 -0700

yeah, it shouldn’t eval on the fly

unfortunately i cannot work on it until next week

sorry

> On Mar 25, 2019, at 2:30 PM, Phil Hofer <address@hidden> wrote:
> 
> 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
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/chicken-users




reply via email to

[Prev in Thread] Current Thread [Next in Thread]