-
Notifications
You must be signed in to change notification settings - Fork 0
Add to_int() stdlib function for string-to-integer conversion #44
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requestmediumShould get done, not urgentShould get done, not urgentstdlibStandard library modules and builtinsStandard library modules and builtins
Description
There's no built-in way to convert a String to an Int. The package manager has a hand-rolled parse_int in aster-pkg/src/serialize.aster that does character-by-character digit matching across 30 lines of Aster.
Add to_int(text: String) throws SomeError -> Int as a builtin (like to_string(value: Int) -> String), backed by a Rust runtime function that calls str::parse::<i64>(). Should raise an error for unparseable input.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestmediumShould get done, not urgentShould get done, not urgentstdlibStandard library modules and builtinsStandard library modules and builtins