Comment

Comment by WalterBright

D (also in Das BetterC) has:

1. underscores in literals:

    int a = 1_234_567;
2. case ranges:

    case 5 .. case 6:
3. named arguments:

    void test(int a, int b);

    void foo() { test(b:3, a:4); }
4. nested functions:

    int foo(int i) {
      int plus(int a) { return a + i; }
      return plus(3);
    }
5. static nested functions:

    int foo(int i) {
      static int plus(int a) { return a + i; }
      return plus(3);
    }

    Error: `static` function `test.foo.plus` cannot access variable `i` in frame of function `test.foo`
6. a feature similar to generators https://dlang.org/spec/statement.html#foreach_over_struct_an...

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton