dyaml/examples/getting_started/main.d
Ferdinand Majerech 13ea5f0c24 Added a shortcut alias called "as" for Node.get(), and replaced
get() with as() all over the code, tutorials, examples and docs.
Fixed a bug in YAML benchmark makefile.
Fixed a bug in autoddoc configuration.
2011-10-22 17:06:32 +02:00

19 lines
366 B
D

import std.stdio;
import yaml;
void main()
{
//Read the input.
Node root = Loader("input.yaml").load();
//Display the data read.
foreach(string word; root["Hello World"])
{
writeln(word);
}
writeln("The answer is ", root["Answer"].as!int);
//Dump the loaded document to output.yaml.
Dumper("output.yaml").dump(root);
}