-
Notifications
You must be signed in to change notification settings - Fork 158
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
ASR: String to List Conversion #1079
Conversation
LGTM, Thank you! x = list()
x = list([])
x = list("lpython") |
Will this work for runtime string variables? |
I will add the LLVM backend as a follow-up for runtime values. |
0febd0b
to
f71887e
Compare
f71887e
to
764d337
Compare
x = list("L") | ||
assert len(x) == 1 and x[0] == 'L' | ||
|
||
f() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is okay. Really surprising though. None of the variables (s
, x
) are marked as constant but still they work with only the compile time logic you have added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is because if we have a string value at compile time then we can directly make a list constant out of it. So no cast, in that case, is required.
#733