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

Boolean variables only half implemented #214

Open
XmiliaH opened this issue Feb 19, 2021 · 6 comments
Open

Boolean variables only half implemented #214

XmiliaH opened this issue Feb 19, 2021 · 6 comments
Labels

Comments

@XmiliaH
Copy link
Contributor

XmiliaH commented Feb 19, 2021

Boolean variables seem to only be implemented half.
They can be declared with local b:boolean but @boolean(b) casts b to a usertype with metatable boolean.
Furthermore, local b:boolean = tostring(1) will error but local b:boolean; b = tostring(1) will not error at compile nor runtime.

What is the expected behavior of boolean variables?

@dibyendumajumdar
Copy link
Owner

Hi,
The types that can be used in annotations are described here: https://the-ravi-programming-language.readthedocs.io/en/latest/ravi-reference.html

boolean is not defined - hence it is assumed that this is a userdata type

@dibyendumajumdar
Copy link
Owner

I guess that I intended to add it but didn't - we can either remove it as a recognized type or add support for it.

@dibyendumajumdar
Copy link
Owner

Removing it is quite easy I think as the only place it is recognized is in the parser.

@XmiliaH
Copy link
Contributor Author

XmiliaH commented Feb 19, 2021

Both, fully implementing or removing it could break existing code.

@dibyendumajumdar
Copy link
Owner

I am going to remove it from being recognized the parser for now.

dibyendumajumdar added a commit that referenced this issue Feb 20, 2021
…, the parser will no longer recognize the :boolean annotation.
@snoopcatt
Copy link

I also made some success of re-implementing boolean type.
You can see proposed solution #223

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

No branches or pull requests

3 participants