nilang 0.4.1

A scripting language interpreter for Advent of Code
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
fn new_counter() {
  counter = {x:0};

  return fn() {
    x = counter.x;

    counter.x = x + 1;

    return x;
  };
}

my_counter = new_counter();

print(my_counter()); // 0
print(my_counter()); // 1
print(my_counter()); // 2