scope: refuse `&x` where x is a local variable
[nit.git] / examples / rosettacode / loops_n_plus_one_half.nit
1 #!/usr/bin/env nit
2 #
3 # This file is part of NIT ( http://www.nitlanguage.org ).
4 # This program is public domain
5
6 # Task: Loops/n + 1/2
7 #
8 # SEE: http://rosettacode.org/wiki/Loops/N_plus_one_half
9 module loops_n_plus_one_half
10
11 for i in [0..10] do
12 printn i
13 if i == 10 then break
14 printn ", "
15 end
16 print ""
17
18 # Here the idiomatic version using `join`
19 print([0..10].join(", "))