develooper Front page | perl.perl6.language | Postings from March 2009

r25890 - docs/Perl6/Spec

From:
pugs-commits
Date:
March 18, 2009 12:04
Subject:
r25890 - docs/Perl6/Spec
Message ID:
20090318190417.12487.qmail@feather.perl6.nl
Author: lwall
Date: 2009-03-18 20:04:16 +0100 (Wed, 18 Mar 2009)
New Revision: 25890

Modified:
   docs/Perl6/Spec/S03-operators.pod
Log:
kill off int as a prefix operator to avoid confusion with the type name


Modified: docs/Perl6/Spec/S03-operators.pod
===================================================================
--- docs/Perl6/Spec/S03-operators.pod	2009-03-18 18:24:25 UTC (rev 25889)
+++ docs/Perl6/Spec/S03-operators.pod	2009-03-18 19:04:16 UTC (rev 25890)
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall <larry@wall.org>
   Date: 8 Mar 2004
-  Last Modified: 17 Mar 2009
+  Last Modified: 18 Mar 2009
   Number: 3
-  Version: 159
+  Version: 160
 
 =head1 Overview
 
@@ -991,7 +991,6 @@
 
 Functions of one argument
 
-    int
     sleep
     abs
     sin
@@ -1000,9 +999,16 @@
 Note that, unlike in PerlĀ 5, you must use the C<.meth> forms to default
 to C<$_> in PerlĀ 6.
 
-There is no unary C<rand> function in Perl 6, though there is a C<.rand>
-method call and an argumentless C<rand> term.
+There is no unary C<rand> prefix in Perl 6, though there is a C<.rand>
+method call and an argumentless C<rand> term.   There is no unary C<int>
+prefix either; you must use a typecast to a type such as C<Int> or C<int>.
+(Typecasts require parentheses and may not be used as prefix operators.)
+In other words:
 
+    my $i = int $x;   # ILLEGAL
+
+is a syntax error (two terms in a row), because C<int> is a type name now.
+
 =over
 
 =item *




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About