[racket] at-exp: is there any way to make it turn @list{A @"string" escape} into (list "A " "string" " escape") ?

From: Matthew Butterick (mb at mbtype.com)
Date: Sat Dec 27 12:42:06 EST 2014

@list{A @'{string} escape}

?


On Sat, Dec 27, 2014 at 8:21 AM, Alexander D. Knauth <alexander at knauth.org>
wrote:

> Is there any way to make the at-exp reader turn @list{A @"string" escape}
> into (list "A " "string" " escape”),
> instead of into (list “A string escape”) ?
>
> The reason is that I wanted to make my own versions of format, printf,
> fprintf, error, etc. that would work with the at-exp reader and
> convert something like this:
> @my-error['f]{message
>                 given: ~v@"something"
>                 other-arguments: ~v@"something-else" ~v@
> "another-something-else"}
> into something like this:
> (error 'f "message\n  given: ~v\n  other-arguments: ~v ~v"
>        "something" "something-else" "another-something-else")
>
> It works the way I want it to if the “something”s etc. are anything other
> than a string literal, but is there any way to make it work for string
> literals?
>
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20141227/be430293/attachment.html>

Posted on the users mailing list.