global vs context variable

Shammah Chancellor anonymous at coward.com
Wed Dec 11 03:14:34 PST 2013


On 2013-12-11 08:21:35 +0000, luka8088 said:

> Examples using such library:
> 
> void writeOutput () {
>   writeln("example output");
> }
> 
> void main () {
> 
>   writeOutput();
> 
>   standardOutputContext(file("example.txt"), {
>     writeOutput();
>   });
> 
> }


What does this method have over just using:

with(file("example.txt"))
{
	writeln("Foo");
}



More information about the Digitalmars-d mailing list