Skip to content

Weird bug with subtraction without spaces #409

@odino

Description

@odino
⧐  10 -1
-1
⧐  10 - 1
9

The interpreter thinks -1 is a number itself, and does num num rather than num - num:

⧐  1 10
10

This last behavior is, in itself, problematic. I guess an easy fix is to see whether there's an operator between two numbers -- if not, raise an error. But if the second number "kind of has an operator" (-), we could simply subtract...

image
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions