Closed Mercerenies closed 2 years ago
See #94
Symbol
is still a wrapped string in this version of GDLisp. However, intern
returns a globally-indexed symbol from a global table, so =
works on symbols as intended, since two symbols with the same name will always (by the semantics of intern
) be the same exact object.
Here's another nasty one that's probably worth bringing up.
Should strings and symbols be synonymous? Right now,
Symbol
as a class behaves oddly. For one, it's literally just a wrapped string, so it's no more efficient than actual strings. For another, default==
fails on it, and it can't be used as a hash key in any meaningful way.In Godot 4.x, we're going to rid ourselves of the
Symbol
class and compile toStringName
anyway.But on the flipside, macros need to be able to distinguish between strings and symbols, so we would still need some way of identifying them separately. Worth exploring further.