Miko O'Sullivan suggested:

> Give split an option to keep the delimiters in the returned array

As Dave mentioned, this already happens if you capture within the
split pattern.


 > --------------------------------------------------------
> Set preferred boolean string for scope

It's possible that Perl 6 will have built-in functions C<true> and C<false>.
When called without arguments, they will return the standard true and false
values (1 and "") respectively. If that is the case, then to dynamically 
change them, you'd just write:

        {
                temp sub false() {0}
                # etc.
        }

Then, if the built-ins were all defined to use C<true> and C<false> to
return true and false values, you'd have exactly the control you need.

Though I must say I can't see the real need for this. Especially when
you can prefix any boolean expression with unary + and ensure that
any ""s are converted to 0's anyway.


> --------------------------------------------------------
> Push with []
> 
> Our friends over in PHP have a nifty little way of saying "push this onto
> the end of the array".  You simply assign the value to the array using an
> empty index.  In Perl6 it could look like this:
> 
>   @arr[] = $var;

I have to admit that don't find that syntax very intuitive.

Besides, in Perl 5 the same functionality just:

        $arr[@arr] = $var;

In Perl 6, that would be:

        @arr[+@arr] = $var;

or:

        @arr[@arr.length] = $var;

or maybe just :

        @arr[.length] = $var;

(if an array were to be made the topic inside its own accessor brackets).

Damian


PS: Thanks for the ideas, Mike! :-)

Reply via email to