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
Symbols would look like in ruby: :symbol
The type of a symbol would be essentially the symbol itself, inside of a pseudo type constructor like sym:
let s: sym(:my_symbol) = :my_symbol
You can use the more generic sym type without specifiying a symbol like this:
var s: sym = :my_symbol
Symbols can be combined by using the | operator or by writing literals next to each other:
let s1 = :sym_a
let s2 = :sym_b
let combined = s1 | s2
let combined2 = :sym_a :sym_b
The combination of Symbols can be stored inside the type as well, this would result in a type like this: sym(:sym_a, :sym_b)
You would only be able to combine known Symbols, that is Symbols which have a type like sym(:symbol)
Combined symbols would be factually the same as normal symbols, they also get uniqued so two combinations of symbols will compare equal.
The real power comes when converting these to enums and flag enums. This is TBD.
The text was updated successfully, but these errors were encountered:
Symbols would look like in ruby:
:symbol
The type of a symbol would be essentially the symbol itself, inside of a pseudo type constructor like
sym
:You can use the more generic
sym
type without specifiying a symbol like this:Symbols can be combined by using the
|
operator or by writing literals next to each other:The combination of Symbols can be stored inside the type as well, this would result in a type like this:
sym(:sym_a, :sym_b)
You would only be able to combine known Symbols, that is Symbols which have a type like
sym(:symbol)
Combined symbols would be factually the same as normal symbols, they also get uniqued so two combinations of symbols will compare equal.
The real power comes when converting these to enums and flag enums. This is TBD.
The text was updated successfully, but these errors were encountered: