Alexey Trofimenko writes:
> I remember perl5 scalar:
>     scalar($a, $b, $c)

In Perl 6, I presume that means the same as:

    [ $a, $b, $c ]

> hm.. sorry, scalar() isn't needed at all:)
> 
>   2+(test,test,test)

Likewise, this would be:

    2+[test, test, test]

Which should be:

    2+3

Assuming test returns a single value.

> ok, all I want is an ability to write operator which wouldn't try to  
> create lists or store result of first operand and will call it in _void_  
> context, so I could easily write short postfix loops and conditionals when  
> I want to.

We hear ya.  It's called C<;> enclosed in a C<do> block.  I know, it's a
pain sometimes, but you just have to get used to it.  I've stopped using
the scalar comma in Perl 5, and the code just I<feels> cleaner to me
now.  I doubt we'll be getting an operator analogous to the C comma.

It's easy to write with a macro:

    macro infix:then is looser(&infix:,) ($left, $right) {
        return { 
            $left.run;
            $right.run;
        }
    }

Luke

Reply via email to