-
Notifications
You must be signed in to change notification settings - Fork 89
Lists and Filter
NN--- edited this page Apr 18, 2012
·
3 revisions
- Category: Lists, Tuples and Options
- Description: This sample shows how to filter a list
- Code:
using Nemerle;
using Nemerle.Collections;
using System;
using System.Console;
def data = [("Cats", 4),
("Dogs", 5),
("Mice", 3),
("Elephants", 2)];
def res = data.Filter((nm, x) => nm.Length <= 4);
WriteLine($"Animals with short names: $res")
- Execution Result:
Animals with short names: [(Cats, 4), (Dogs, 5), (Mice, 3)]
[Copyright ©](Terms of use, legal notice)