Reputation: 379
How can I use at-exp to include blew raw string:
package foo
}
import (
I write like this, but it cannot include the "}" character:
#lang at-exp racket/base
(define code @S{
package foo
}
import (
}
How to include special character like "{}" in the raw part.
Upvotes: 3
Views: 169
Reputation: 29546
Use @S|{...}|
for that: since the closing part is }|
, plain }
s would not be special. Also, remember to use |@
instead of just @
for nested forms. And if you need another different quotation since you want to use }|
s too, you can add more things between, as in @S|==={...}===|
. See the documentation page for details (look for |{
s, and see section 2.4.1).
As for what you've found: this is not the same. What you're doing there is a nested "{"
string, which you can use for each unbalanced character. But that is much less convenient than the above alternative quotation syntax.
Upvotes: 5