Thread Frage zu Perl 6 (Referenzsyntax)
(10 answers)
Opened by Kuerbis at 2015-07-03 14:59
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) |