2
* This is a Ddoc block comment
3
* Authors: Melvin D. Nerd, melvin@mailinator.com
4
* Bugs: Doesn't work for negative values.
12
* This is a documentation comment block
13
* @param xxx does this (this is the documentation keyword)
14
* @authr some user (this is the documentation keyword error)
17
void main(string[] args)
21
* This is a block comment
24
/// Deprecated: superseded by function bar().
30
int a = /+ Nested Comment +/ 1;
31
int b = 2; // Line Comment
33
writefln("Hello World, Reloaded");
35
// auto type inference and built-in foreach
36
foreach (argc, argv; args)
38
// Improved typesafe printf
39
writeln("argc: ", argc, " arg: ", argv);
42
// Nested structs and classes
45
// all members automatically initialized
49
// Nested functions can refer to outer
50
// variables like args
55
s.count = args.length; // get length of array with .length
56
s.allocated = typeof(args).sizeof; // built-in native type properties
58
s.allocated += argv.length * typeof(argv[0]).sizeof;
62
// built-in string and common string operations
63
writefln("argc = %d, " ~ "allocated = %d",
64
argspecs().count, argspecs().allocated);