echo 1 == 0 # space in the beginning and end of ==
    
    echo 1==0 # no space
    
    
    Run

can be compiled and run without warning/error

however 
    
    
    echo 1== 0
    
    
    Run

can be compiled and run as expected, but there is a warning ` Warning: Number 
of spaces around '==' is not consistent [Spacing]`

the most strange is that nim refuses to compile 
    
    
    echo 1 ==0
    
    
    Run

and says 
    
    
    Error: type mismatch: got <int literal(0)>
    but expected one of:
    proc `==`(x, y: float): bool
    proc `==`(x, y: int64): bool
    proc `==`[T](x, y: ptr T): bool
    proc `==`(x, y: int): bool
    proc `==`(x, y: string): bool
    proc `==`[T: proc](x, y: T): bool
    proc `==`[T](x, y: ref T): bool
    proc `==`[T: SomeUnsignedInt](x, y: T): bool
    proc `==`(x, y: bool): bool
    proc `==`(x, y: char): bool
    proc `==`[T](x, y: seq[T]): bool
    proc `==`[T: tuple |
        object](x, y: T): bool
    proc `==`[Enum: enum](x, y: Enum): bool
    proc `==`(x, y: float32): bool
    proc `==`(x, y: int8): bool
    proc `==`(x, y: int32): bool
    proc `==`(x, y: int16): bool
    proc `==`(x, y: cstring): bool
    proc `==`[T](x, y: set[T]): bool
    proc `==`(x, y: pointer): bool
    proc `==`[I, T](x, y: array[I, T]): bool
    
    expression: ==0
    
    
    Run

Reply via email to