On Thu Jan 22 17:55:55 EST 2009, r...@swtch.com wrote:
> >> <- is a unary operator.
> 
> > okay, what does it do? (unless you meant -> in C++)
> 
> it receives from a channel.

i assumed that ron was talking about c.
in c, "<- 0" tokenizes as "<", "-", and "0".
"-" is taken to be a unary operator on "0".

even gcc does this correctly:

; cat > x.c
#include <u.h>
#include <libc.h>

void
x(int seed)
{
        int m_31;

        m_31 = 1<<31;
        if(seed <- 0)
                seed = seed + m_31;
        print("seed %d\n", seed);
}

void
main(void)
{
        x(-5);
        exits("");
}
<eot>; 9c x.c
; 9l x.o
; ./a.out
seed -2147483648

- erik

Reply via email to