dibyendumajumdar/ravi

Boolean variables only half implemented

XmiliaH opened this issue · 6 comments

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?

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

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.

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

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

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

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