in reply to Fringe case slice behavior
That means there's no C-style comma operator in Perl 6. If you want the last value of a list, subscript it with [-1]. This also means that a slice in scalar context will not return the last value as it does in Perl 5. If you try that in Perl 6, you'll get a list reference, which will fail when you try to apply a scalar operator like += to it. (Perl 6 has a way to apply scalar operators to lists, but you have to be explicit.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Fringe case slice behavior
by BrowserUk (Patriarch) on Jan 13, 2004 at 21:10 UTC | |
by TimToady (Parson) on Jan 14, 2004 at 02:17 UTC | |
by BrowserUk (Patriarch) on Jan 14, 2004 at 02:37 UTC | |
by Abigail-II (Bishop) on Jan 13, 2004 at 21:22 UTC | |
by BrowserUk (Patriarch) on Jan 14, 2004 at 00:02 UTC |