-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Addr literal #61
base: main
Are you sure you want to change the base?
Addr literal #61
Conversation
I'm wondering if this is somewhere where we should depart from Teal. This syntax is a bit odd to me. I feel like it would be more useful to have a What do you think? I don't have strong feelings about this. It's just an observation. |
I'm not crazy about it either TBH. Ideally I think something like the following might be nicer but would need other considerations
Where addr is a sort of alias for AVMType.bytes (+ extra processing) This would also be useful in the case of
Where bigint is also an alias for AVMType.bytes (+ mapping fn calls like +/-/* to the bytemath equivalent) |
An explicit address type also makes it nicer for code legibility when we can do things like: |
Similar to hex looking for
0x...
in #60, this looks foraddr(...)
where the contents are valid b32 strings.This also changes the
const
map to allowUnion[ConstValue, Literal]
whereLiteral
is the AST Node type, this way we can use thewrite_teal
defined on the Literal itself (important forLiteralAddress
to writeaddr ...
)Note: this also includes the
LiteralHex
changes, so if that gets merged this will look cleanerMarked as draft for now until syntax is decided.