Grupos de Google ya no admite nuevas publicaciones ni suscripciones de Usenet. El contenido anterior sigue siendo visible.

[patch] do EXPR

Visto 6 veces
Saltar al primer mensaje no leído

Agent Zhang

no leída,
15 ago 2006, 8:11:4615/8/06
a p6l
Hello~

Here is a snippet from the Pugs test suite:

{
my $ret = eval 'do 42';
ok(!$ret, 'do EXPR should not work', :todo);
# XXX or should it? Feels weird...
}

which motivated me to create the following patch for S04:

Index: D:/projects/Perl6-Syn/S04.pod

===================================================================

--- D:/projects/Perl6-Syn/S04.pod (revision 10955)

+++ D:/projects/Perl6-Syn/S04.pod (working copy)

@@ -349,8 +349,9 @@


$x = do if $a { $b } else { $c };

-This construct only allows you to prefix a statement. If you want to
-continue the expression after the statement you must use the curly form.
+This construct only allows you to prefix I<one> statement (or an expression).
+If you want to continue the expression after the statement you must use the
+curly form.

Since C<do> is defined as going in front of a statement, it follows
that it can always be followed by a statement label. This is particularly


Cheers,
Agent

0 mensajes nuevos