Re: What's the secret to static class members

2016-06-29 Thread Guido via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 15:40:57 UTC, Andrea Fontana wrote: On Wednesday, 29 June 2016 at 15:33:58 UTC, Guido wrote: The problem is actually much more profound. The classes need to be declared outside the main() scope. WTF?!?!?! I put them in main() so they would be in scope. This seems

Re: What's the secret to static class members

2016-06-29 Thread Guido via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 15:18:53 UTC, Guido wrote: I'm using a static class member in a parent class, but can't get the compiler to see it. Class Grid{ public: uint xdim; } Class Holder : Grid { uint var; } Any of the following should work, but none of them do: Grid.xdim = 0; gri

What's the secret to static class members

2016-06-29 Thread Guido via Digitalmars-d-learn
I'm using a static class member in a parent class, but can't get the compiler to see it. Class Grid{ public: uint xdim; } Class Holder : Grid { uint var; } Any of the following should work, but none of them do: Grid.xdim = 0; grid = new Grid; grid.xdim = 0; holder = new Holder; holder.

Re: Why don't we write configuration files in D instead of JSON?

2016-06-16 Thread Guido via Digitalmars-d-learn
have a look at `dub convert` - in your case e.g. `dub convert -f sdl` This dub convert command is weird. It works as `cat dub.json | dub convert -sdl' and makes a nice SDL file called dub.sdl, but it blows away the source file, which I've never seen before with piped output from cat. I don't

Re: Why don't we write configuration files in D instead of JSON?

2016-06-16 Thread Guido via Digitalmars-d-learn
On Thursday, 16 June 2016 at 06:07:55 UTC, Seb wrote: On Thursday, 16 June 2016 at 05:31:26 UTC, Guido wrote: It would seem that by running the file through mixin, you can simply create the vars you want in scope. The drawback being random code execution. Is there any way to sanitize mixin code

Why don't we write configuration files in D instead of JSON?

2016-06-15 Thread Guido via Digitalmars-d-learn
It would seem that by running the file through mixin, you can simply create the vars you want in scope. The drawback being random code execution. Is there any way to sanitize mixin code from user-configurable file? Once that's shot down, does anyone know a .json to .sdl converter program