Skip to content

Lists and Indexed Iteration

CodingUnit edited this page Dec 24, 2011 · 5 revisions

Lists and Indexed Iteration

  • Category: Lists, Tuples and Options
  • Description: This sample shows simple uses of 'iteri'
  • Code:
using Nemerle;
using Nemerle.Collections;
using System;
using System.Console;

def data = ["Cats", "Dogs", "Mice", "Elephants"];
data.IterI((i, x) => WriteLine($"item $i: $x"))
  • Execution Result:
item 0: Cats
item 1: Dogs
item 2: Mice
item 3: Elephants
Clone this wiki locally