On Fri, Nov 8, 2019 at 9:56 AM Jay McCarthy <jay.mccar...@gmail.com> wrote:

> On Fri, Nov 8, 2019 at 9:51 AM Christopher Lemmer Webber <
> cweb...@dustycloud.org> wrote:
>
>> I have a need to do two things in a #lang:
>>
>>  - Most importantly, make all strings that appear in the source code
>>    immutable
>>
>
> Make #%datum turn literal strings `s` into `(string->immutable-string s)`
>

 But the default `#%datum` (which expands to `quote`) already does this:
> (immutable? "foo")
#t
Or, for another way of thinking about it, strings that go into syntax
objects are interned. The upshot is that literals are immutable by default:
a language that wanted mutable literals would have to make special effort
via `#%datum`.

-Philip

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAH3z3gaxTm1hfEW2v8FjRFQ3noSMH7H_o%2BfY7oxXNpS5pqGvuA%40mail.gmail.com.

Reply via email to