News for hackers. Stuff that matters.
Re:Dragon Programming Language by packetlost on Tuesday March 07, 2023 @09:55AM (#35056013)
I mean, pretty much all code is just strings subject to certain parsing constraints by the compiler/interpreter/lexer. What GP is talking about is semantic difference, which is super important in programming.
Re:Dragon Programming Language by onlyrealcuzzo on Tuesday March 07, 2023 @10:53AM (#35056739)
Isn't the difference just mutable vs immutable?
Re:Dragon Programming Language by packetlost on Tuesday March 07, 2023 @02:31PM (#35060025)
uhhh... no? The difference depends on the language, but really it boils down to semantic meaning behind certain strings. x == y has different semantic meaning than "x == y" but both are literally strings of text.
Re:Dragon Programming Language by Pet_Ant on Tuesday March 07, 2023 @02:33PM (#35060037)
Well strings in various languages are immutable in many programming languages so that's not it.

In strings I'd say the _content_ matters. If the value needs to be preserved at runtime that is a string, if after compilation the value doesn't, it's only used for binding at compilation time then it's a symbol. So, semantic litmus test I'd propose: if you search and replaced the value and recompiled, would you notice?