Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[svn:perl6-synopsis] r9076 - doc/trunk/design/syn

5 views
Skip to first unread message

autr...@cvs.perl.org

unread,
May 1, 2006, 1:32:02 PM5/1/06
to perl6-l...@perl.org
Author: autrijus
Date: Mon May 1 10:32:02 2006
New Revision: 9076

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.

ja...@mastros.biz

unread,
May 1, 2006, 7:44:25 PM5/1/06
to perl6-l...@perl.org
On Mon, May 01, 2006 at 10:32:02AM -0700, autr...@cvs.perl.org wrote:
> 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);

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

Audrey Tang

unread,
May 2, 2006, 2:10:29 PM5/2/06
to ja...@mastros.biz, perl6-l...@perl.org
ja...@mastros.biz wrote:
> 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

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

signature.asc

ja...@mastros.biz

unread,
May 2, 2006, 4:55:56 PM5/2/06
to perl6-l...@perl.org

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

0 new messages