Skip to content
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

from/to string conversion for primitive expressions #4

Open
julochrobak opened this issue Jul 5, 2012 · 0 comments
Open

from/to string conversion for primitive expressions #4

julochrobak opened this issue Jul 5, 2012 · 0 comments

Comments

@julochrobak
Copy link
Member

Bandicoot is a strongly-typed language and converting a primitive expression of a given type into another type must be explicit. The current version of Bandicoot supports only conversion from one numeric type to another. This task is to implement conversions from string to numeric and the other way around:

extend si = (string 1), sr = (string 1.1), sl = (string 1L)
i = (int "123234" 0), r = (real "123123.3242343" 0.0), l = (long "12312312321" 0L)
....

The conversion from a string to a numeric value must have a default value specified. The default is used if the conversion fails:
i = (int "Hello World" 0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant