FAQ
Author: lwall
Date: 2009-02-07 08:50:27 +0100 (Sat, 07 Feb 2009)
New Revision: 25226

Modified:
docs/Perl6/Spec/S29-functions.pod
Log:
missing commas


Modified: docs/Perl6/Spec/S29-functions.pod
===================================================================
--- docs/Perl6/Spec/S29-functions.pod 2009-02-07 06:25:54 UTC (rev 25225)
+++ docs/Perl6/Spec/S29-functions.pod 2009-02-07 07:50:27 UTC (rev 25226)
@@ -819,14 +819,14 @@
value. For example:

@list = (1, 2, 3, 4);
- (:@even, :@odd) := classify { $_ % 2 ?? 'odd' !! 'even' } @list;
+ (:@even, :@odd) := classify { $_ % 2 ?? 'odd' !! 'even' }, @list;

In this example, @even will contain all even numbers from C<@list>
and C<@odd> will contain all odd numbers from C<@list>.

To simply transform a list into a hash of arrays:

- %cars_by_color = classify { .color } @cars;
+ %cars_by_color = classify { .color }, @cars;
red_car_owners(%cars_by_color<red>.map:{.owner});

=item grep

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl6-language @
categoriesperl
postedFeb 7, '09 at 7:51a
activeFeb 7, '09 at 7:51a
posts1
users1
websiteperl6.org

1 user in discussion

Pugs-commits: 1 post

People

Translate

site design / logo © 2021 Grokbase