Modified:
doc/trunk/design/syn/S03.pod
Log:
* S03.pod: Retire lvalue undef and replace it with lvalue Whatever:
# Perl 5
(undef, undef, $x) = (1,2,3);
# Perl 6
(*, *, $x) = (1,2,3);
Modified: doc/trunk/design/syn/S03.pod
==============================================================================
--- doc/trunk/design/syn/S03.pod (original)
+++ doc/trunk/design/syn/S03.pod Mon May 1 10:32:02 2006
@@ -12,9 +12,9 @@
Maintainer: Larry Wall <la...@wall.org>
Date: 8 Mar 2004
- Last Modified: 30 Apr 2006
+ Last Modified: 2 May 2006
Number: 3
- Version: 25
+ Version: 26
=head1 Changes to existing operators
@@ -671,6 +671,8 @@
@slice = @x[*;0;*]; # any Int
@slice = %x{*;'foo'}; # any keys in domain of 1st dimension
@array[*] # flattens, unlike @array[]
+ (*, *, $x) = (1, 2, 3); # skip first two elements
+ # (same as lvalue "undef" in Perl 5)
C<Whatever> is an undefined prototype object derived from C<Any>. As a
type it is abstract, and may not be instantiated as a defined object.
Is my ($foo, *, $bar) = 1..3 legal perl6? my ($foo, undef, $bar) =
1..3; is valid perl5, but AFAIK that is completely undocumented. (It's
quite useful from time to time -- now if only my (@rest, $almost, $last) =
function_returning_many_thingies could work...
-=- James Mastros
Most likely yes, as lvalue * can just act as a /dev/null.
> -- now if only my (@rest, $almost, $last) =
> function_returning_many_thingies could work...
This may be implemented by allowing slurpy scalar _after_ slurpy array.
But what would be the use case?
Thanks,
Audrey
Hm, possibly I should specify what I mean by "work" -- as if I'd specified
C<< my (@last, $almost, @rest) = reverse(function_returning_many_thingies);
>>. As to use case... um, I'm sure I've had it come up for me, but I can't
think of where it'd be terribly common such that the extra cognative
overhead is worth it, come to think of it.
I withdraw the (stupid) suggestion.
-=- James Mastros