Uh oh!
There was an error while loading. Please reload this page.
Implement str to int conversion - #2599
Conversation
ubaidsk
commented
Mar 16, 2024
Please mark this as "Ready for review" when ready. If you have any doubt, please ask. |
@Shaikh-Ubaid I do have some doubts. They are related to throwing errors.
My chief concern is that while both of these can be done while casting, it is not clean, and probably not supported there too. |
ubaidsk
commented
Mar 17, 2024
Sharing my thoughts on this:
I believe the above approach solves all your concerns. |
ubaidsk
commented
Mar 17, 2024
Also see #2554 (comment). |
I think there is a catch. @certik said that Supporting your idea and building upon it, I think we need to not just cast a string to an integer, but convert it. Please let me know your thoughts on this. :) But again, we can surely build on top of the support we have for |
ubaidsk
commented
Mar 17, 2024
I think the type
Let's just focus on normal/decimal (base 10) integers for now. Once that is robustly supported, we can try supporting integers of other bases. |
ubaidsk
commented
Mar 17, 2024
Sure, go ahead and make a plan. Figure out what is left to be supported for |
Resolves#2554
Implement basic string to integer conversion using
CharacterToIntegercasting, which I believe is a part of LFortran, but was not implemented here in LPython.Working
ASR
Tasks
i8,i16, etc even take a 2nd argument. Even when several arguments are passed, only the 1st is dealt with and errors related to the same are thrown.