fork download
  1. proc echoItem(x: int) = echo x
  2.  
  3. proc forEach(action: proc (x: int)) =
  4. const
  5. data = [2, 3, 5, 7, 11]
  6. for d in items(data):
  7. action(d)
  8.  
  9. forEach(echoItem)
  10.  
Success #stdin #stdout 0s 4252KB
stdin
Standard input is empty
stdout
2
3
5
7
11