Skip to content
Andrew Matthews edited this page Aug 30, 2025 · 1 revision

Lists

I envisage a syntax very similar to the Haskell or Erlang list comprehension syntaxes:

Type Declaration

xs: int[];

List Literals

xs = [1, 2, 3, 4, 5];

List Comprehensions

ys: [int] = [x in xs # x % 2 == 0];

The list comprehension can be directly translated into normal LINQ syntax on a regular List<T>. With a little effort, so can the array syntax. There's also no real reason why we can't have comprehensions on arrays either.

Clone this wiki locally