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
Most of our built-in types have their own AST node (e.g., TyInt, TyFloat, and TySeq) but some are represented by TyCons (at least Symbol and Ref). Before #902 these were distinguished by being left unsymbolized, after #902 they're distinguished by having particular globally set Names. This seems inconsistent.
There are a few ways to approach this:
Give Symbol and Ref their own AST-nodes.
Represent all built-in types with globally reserved Names. A minor variation of this would be to only do this for atomic types (TyInt, TyFloat, etc.) and not composite ones (TySeq).
There is also an orthogonal, but related concern: Int, Float, etc., are reserved keywords in the parser today. This could be changed, make it so that Int, Float, etc., are type aliases in scope when the program starts.
The text was updated successfully, but these errors were encountered:
Most of our built-in types have their own AST node (e.g.,
TyInt
,TyFloat
, andTySeq
) but some are represented byTyCon
s (at leastSymbol
andRef
). Before #902 these were distinguished by being left unsymbolized, after #902 they're distinguished by having particular globally setName
s. This seems inconsistent.There are a few ways to approach this:
Symbol
andRef
their own AST-nodes.Names
. A minor variation of this would be to only do this for atomic types (TyInt
,TyFloat
, etc.) and not composite ones (TySeq
).Symbol
andRef
externals, not built-ins. These types have relatively little need for special casing in the compiler, and what need there is should be doable anyway (e.g., via something like_getTyConExn
added in Loader, generate-json-serializer, generate-pprint, generate-eq, and generate-utest #901).There is also an orthogonal, but related concern:
Int
,Float
, etc., are reserved keywords in the parser today. This could be changed, make it so thatInt
,Float
, etc., are type aliases in scope when the program starts.The text was updated successfully, but these errors were encountered: