3

I wanna get Hy!

How, In Hylang, do I do the simple Python loop:

for i in range(5):
    print(i)
dagmarPrime
  • 317
  • 3
  • 9

1 Answers1

4

The tutorial provides this example:

(for [x [1 2 3]]
  (print x))         ; => 1 2 3

Changing the variable name, and using range in place of a list, we get:

(for [i (range 5)]
  (print i))
Kodiologist
  • 2,984
  • 18
  • 33