Re: global vs context variable

2013-12-11 Thread Artur Skawina
On 12/11/13 09:21, luka8088 wrote: > Hi everyone! > > I would like to address the issue of global variables (or states). In > general my opinion is that they are bad solely because they (in most > cases) lack the ability of alternative values (or states) or ability to > alter them in user friendly

Re: global vs context variable

2013-12-11 Thread Ary Borenszweig
On 12/11/13 12:54 PM, luka8088 wrote: On 11.12.2013. 15:47, monarch_dodra wrote: On Wednesday, 11 December 2013 at 12:58:54 UTC, luka8088 wrote: Yeah, and it always keeps pooping right up! I hate it when issues just keep pooping up. So rude! Lol, popping xD shit happens

Re: global vs context variable

2013-12-11 Thread luka8088
On 11.12.2013. 15:47, monarch_dodra wrote: > On Wednesday, 11 December 2013 at 12:58:54 UTC, luka8088 wrote: >> Yeah, and it always keeps pooping right up! > > I hate it when issues just keep pooping up. So rude! Lol, popping xD

Re: global vs context variable

2013-12-11 Thread monarch_dodra
On Wednesday, 11 December 2013 at 12:58:54 UTC, luka8088 wrote: On 11.12.2013. 10:53, QAston wrote: This issue is probably nearly as old as programming itself. There are several sollutions already developed: dependency injection (requires complex configuration rules), manually passing deps as

Re: global vs context variable

2013-12-11 Thread luka8088
On 11.12.2013. 12:14, Shammah Chancellor wrote: > On 2013-12-11 08:21:35 +, luka8088 said: > >> Examples using such library: >> >> void writeOutput () { >> writeln("example output"); >> } >> >> void main () { >> >> writeOutput(); >> >> standardOutputContext(file("example.txt"), { >>

Re: global vs context variable

2013-12-11 Thread luka8088
On 11.12.2013. 10:53, QAston wrote: > > This issue is probably nearly as old as programming itself. > There are several sollutions already developed: dependency injection > (requires complex configuration rules), manually passing deps as args > (cumbersome), service locator or global variables. Y

Re: global vs context variable

2013-12-11 Thread luka8088
On 11.12.2013. 9:30, monarch_dodra wrote: > > "write" is really just a global helper/shortcut function that calls > "stdout.write". If the user wants to customize this, then it's really no > more complicated than doing a write to a named stream, which represents > the global out, which may or may

Re: global vs context variable

2013-12-11 Thread Shammah Chancellor
On 2013-12-11 08:21:35 +, 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(

Re: global vs context variable

2013-12-11 Thread QAston
On Wednesday, 11 December 2013 at 08:21:33 UTC, luka8088 wrote: Hi everyone! I would like to address the issue of global variables (or states). In general my opinion is that they are bad solely because they (in most cases) lack the ability of alternative values (or states) or ability to alte

Re: global vs context variable

2013-12-11 Thread monarch_dodra
On Wednesday, 11 December 2013 at 08:21:33 UTC, luka8088 wrote: Hi everyone! I would like to address the issue of global variables (or states). In general my opinion is that they are bad solely because they (in most cases) lack the ability of alternative values (or states) or ability to alte

global vs context variable

2013-12-11 Thread luka8088
Hi everyone! I would like to address the issue of global variables (or states). In general my opinion is that they are bad solely because they (in most cases) lack the ability of alternative values (or states) or ability to alter them in user friendly way. For example, take write function from st