You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One neat feature Ruby has is symbols - unique identifiers, where two different symbols with the same name are equal:
p:yes == :yes# true
I think Mica should get a similar feature, though much less dynamic. Unlike strings, symbols should not cause allocations. Their use case would be similar to enums in statically typed languages. For instance, a LÖVE-like API might use symbols for specifying if rectangles should be filled or outlined:
In NaN-tagged mode, symbols should use the unused values of ValueImpl::SIGN_ENUM NaNs - those past nil, false, and true. The values for symbols should be stored in the environment, such that symbols are comparable across all scripts run by the same engine.
The text was updated successfully, but these errors were encountered:
One neat feature Ruby has is symbols - unique identifiers, where two different symbols with the same name are equal:
I think Mica should get a similar feature, though much less dynamic. Unlike strings, symbols should not cause allocations. Their use case would be similar to enums in statically typed languages. For instance, a LÖVE-like API might use symbols for specifying if rectangles should be filled or outlined:
In NaN-tagged mode, symbols should use the unused values of
ValueImpl::SIGN_ENUM
NaNs - those pastnil
,false
, andtrue
. The values for symbols should be stored in the environment, such that symbols are comparable across all scripts run by the same engine.The text was updated successfully, but these errors were encountered: