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

Cannot convert quantity of unit 'b' to a scalar #45

Closed
hrzafer opened this issue Mar 20, 2017 · 3 comments
Closed

Cannot convert quantity of unit 'b' to a scalar #45

hrzafer opened this issue Mar 20, 2017 · 3 comments

Comments

@hrzafer
Copy link

hrzafer commented Mar 20, 2017

> b = 5
5
> a = 5
5
> a+b
Cannot convert quantity of unit 'b' to a scalar
@ivanbakel
Copy link

b is reserved for bits, it seems. Confirm it by asking the value of b, which gives 1b. The assignment of b (or any unit) to the environment seems to work, since ls shows the value pair correctly - the parsing makes the mistake. Either remove the assumption that u === 1u or forbid assigning to units and anything else reserved.

@sharkdp
Copy link
Owner

sharkdp commented Mar 20, 2017

Yes, thanks for the explanation @ivanbakel. This is already tracked in #29.

Edit: Small correction: b is for byte (bit it for bits).

@sharkdp sharkdp closed this as completed Mar 20, 2017
@sharkdp
Copy link
Owner

sharkdp commented Mar 24, 2017

This is now fixed (byte is now B, but insect throws an error if you try to overwrite it):

> b = 5
5
> a = 5
5
> a+b
10
> B = 5
Parse error: The identifier 'B' is reserved for a physical unit at position 6

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

No branches or pull requests

3 participants