Re: Mutually recursive template expansion
On Friday, 1 October 2021 at 14:26:39 UTC, jfondren wrote: On Friday, 1 October 2021 at 14:03:06 UTC, Stephen wrote: This code should work should mutual recursion be supported. It still wouldn't work, because structs are value types and it's impossible to say how large either struct is: Error: struct `mutualrec.Ar` no size because of forward reference With s/struct/class/ it still wouldn't work because this is a mixin problem rather than a problem of template mutual recursion: ```d mixin(q{ class Ar { Br b; } }); mixin(q{ class Br { Ar b; } }); ``` mutualrec2.d-mixin-1(1): Error: undefined identifier `Br`, did you mean class `Ar`? This seems like a surprising limitation of mixin, though, which isn't highlighted by the spec. All right I'll try to design without mutual recursion but mixins don't seem to work if they're put out of order. (i.e. this works: ```d struct Ar { Br b; ubyte a; } struct Br { ubyte b; } ``` but not this: ```d mixin(q{struct Ar { Br b; ubyte a; }}); mixin(q{struct Br { ubyte b; }}); ``` ). Is this by design?
Mutually recursive template expansion
I've been trying out templates in more depth and one thing I was wondering was whether template expansions with circular dependencies might work. Here is an example that doesn't work: ```d mixin(A!()); mixin(B!()); void main() {} template A() { const char[] A = q{ struct Ar { Br b; } }; } template B() { const char[] B = q{ struct Br { Ar a; } }; } ``` This code should work should mutual recursion be supported. How might I get it to work properly (without sacrificing recursion or templates)?
Re: Can we get a video tutorial?
On Friday, 4 September 2015 at 16:11:59 UTC, Stephen wrote: On Friday, 4 September 2015 at 05:51:02 UTC, Mike Parker wrote: * What was previously said * * Bump * Hopefully I'm allowed to bump this...?
Re: Can we get a video tutorial?
On Friday, 4 September 2015 at 05:51:02 UTC, Mike Parker wrote: * What was previously said * DMD is not currently compatible with VS 2015. You'll have trouble if you try to use it. That will hopefully be fixed in a not-too-distant release. * What was previously said * Based on this error, it appears you've done this in your code: import MainWindow; When you should be doing this: import gtk.MainWindow; Thanks for telling me it doesn't work too well with VS 2015 And here's what I am importing import gtk.MainWindow; import gtk.Label; import gtk.Main;
Re: Can we get a video tutorial?
On Thursday, 3 September 2015 at 19:41:55 UTC, wobbles wrote: * What was previously said * So, can you show your project's dub.json? { "name": "test graphics and math", "description": "A minimal D application.", "copyright": "Copyright © 2015, Stephen", "authors": ["Stephen"], "dependencies": { "gfm": "~>3.0.2", "gtk-d": "~>3.1.4", "gtk-d:gtkd": "~master" } }
Re: Can we get a video tutorial?
On Wednesday, 2 September 2015 at 01:15:28 UTC, Mike Parker wrote: * What was previously said * Ok, so, I am running Windows 10, I have installed VS 2015, I have installed DMD 1 and 2 (I know I only need 2 but it shouldn't hurt to have both), I have installed VisualD, and I have installed DUB with it's installer. (All of these installed successfully and work) So, I'm trying to install gtkD but get "Error: module MainWindow is in file 'gtk/MainWindow.d' which cannot be read" when I try to run the program. No idea what this means, how to fix it, or what step I missed. What I'd like is for someone to either make a tut of how to get from no Dlang on their computer to having a package working in a program, or for someone to help me and I'll try to make one later.
Re: Can we get a video tutorial?
On Tuesday, 1 September 2015 at 14:50:53 UTC, cym13 wrote: On Tuesday, 1 September 2015 at 14:48:55 UTC, Stephen wrote: So I've been trying to install Dlang, VisualD, and Dub for the past day with little luck. I have DMD 1 and 2, and VisualD installed, but I can't get Dub working. Are you on linux or windows or...? Please, give a bit of context. I (personally) am on Windows, umm, not sure what you want for context. When I run my program, it gives an error that something I'm importing .d can't be read.
Can we get a video tutorial?
So I've been trying to install Dlang, VisualD, and Dub for the past day with little luck. I have DMD 1 and 2, and VisualD installed, but I can't get Dub working. I finally asked a friend to help and he got me to my current point of maybe having a package working but I'm not sure because I'm getting an error. I searched the forums and found someone else with the same problem from 2 years ago, and the pictures are down so no luck there. So, as a complete noob/novice, I'm asking for someone to make a very simple, easy to follow, video tutorial for how to install the basics of D (DMD 1 and 2, VisualD (or an IDE of their choosing), Dub, and a graphics package/library to use with it). This will hopefully simplify the installation process for people a lot and have less people turn away and go learn a different language rather than waste a couple days just setting D up.