https://dlang.org/phobos/std_algorithm_searching.html#.any
See the buttons below the example code. You can even edit the examples and try variations.
https://dlang.org/phobos/std_algorithm_searching.html#.any
See the buttons below the example code. You can even edit the examples and try variations.
https://web.archive.org/web/20160405080736/https://dlang.org...
Now that's of course just the website feature. Maybe D had executable examples that were tested by the compiler before Go, which would still be very interesting. However, it does appear Go at least did have the in-browser feature as far back as 2015:
Not that this matters for much other than historical interest: good ideas like this should be copied shamelessly (and obviously it's not a terribly original idea to begin with, just a good implementation of it.)
Sounds like D's ability to specify unit tests in production source code, and have them optionally executed, fits the bill for that.
https://dlang.org/spec/unittest.html
Builtin unit tests were a great leap forward for code verification.
It's the earliest I'm aware of.
1. integrated documentation
2. unit tests
3. 1_000_000 literals
4. ranges
5. compile time function execution
6. static if
BTW, the 1_000_000 specifically came from Ada 1983.
All of them predating D.