Thread Frage zu Perl 6 (Referenzsyntax) (10 answers)
Opened by Kuerbis at 2015-07-03 14:59

Kuerbis
 2015-07-04 09:36
#181481 #181481
User since
2011-03-20
943 Artikel
BenutzerIn
[default_avatar]
Müsste in dem Beispiel (http://learnxinyminutes.com/docs/perl6/)

@numbers[5..*] = 3, 9 ... *;

z.B. so aussehen

@numbers[5..*] = 3, 9 ... * > 86; ?


Code (perl): (dl )
1
2
3
4
5
6
7
# You can use that in most places you'd expect, even assigning to an array  
my @numbers = ^20;  
my @seq =  3, 9 ... * > 95; # 3 9 15 21 27 [...] 81 87 93 99
@numbers[5..*] = 3, 9 ... *; # even though the sequence is infinite,
                             # only the 15 needed values will be calculated.
say @numbers; #=> 0 1 2 3 4 3 9 15 21 [...] 81 87
              # (only 20 values)

View full thread Frage zu Perl 6 (Referenzsyntax)