Crow programming language
IchorDev
zxinsworld at gmail.com
Sat Feb 17 15:48:40 UTC 2024
On Thursday, 15 February 2024 at 23:46:10 UTC, andy wrote:
> Is it as simple as that? I'd have to cast away the `immutable`
> when adding a new interned string though. Is that still the
> correct way to do it?
Oh no, you should never cast away immutable, that might lead to
undefined behaviour (as immutable objects may be placed in ROM)
Pure should not be able to read any global mutable data, either
way…
> I declare a parameter `scope` whenever it's true — the memory
> isn't retained anywhere — even if I can't prove that to the
> compiler, so it needs to be trusted instead. This comes up a
> lot because `scope` only applies one level deep, so if I need a
> pointer to something `scope`, I'm forced to cast away the
> scopeness of the pointee. This happens if I need to put it in a
> `struct` since `struct`s can't contain `ref`s, only pointers.
Oh, interesting. I’ve never had this exact issue
More information about the Digitalmars-d-announce
mailing list