generate doclist automatically based on modelist
This commit is contained in:
parent
4c1497fc29
commit
37fc612756
17 changed files with 118 additions and 94 deletions
14
demo/kitchen-sink/docs/d.d
Normal file
14
demo/kitchen-sink/docs/d.d
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env rdmd
|
||||
// Computes average line length for standard input.
|
||||
import std.stdio;
|
||||
|
||||
void main() {
|
||||
ulong lines = 0;
|
||||
double sumLength = 0;
|
||||
foreach (line; stdin.byLine()) {
|
||||
++lines;
|
||||
sumLength += line.length;
|
||||
}
|
||||
writeln("Average line length: ",
|
||||
lines ? sumLength / lines : 0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue