Re: version(StdDoc)

2018-11-26 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, Nov 25, 2018 at 09:53:50PM +, Stanislav Blinov via Digitalmars-d-learn wrote: > On Sunday, 25 November 2018 at 21:38:43 UTC, H. S. Teoh wrote: > > > Actually, I just thought of a way to do this with the existing language: > > use a struct to simulate an enum: > > > > struct E {

Re: version(StdDoc)

2018-11-25 Thread Stanislav Blinov via Digitalmars-d-learn
On Sunday, 25 November 2018 at 21:38:43 UTC, H. S. Teoh wrote: Actually, I just thought of a way to do this with the existing language: use a struct to simulate an enum: struct E { alias Basetype = int; Basetype impl; alias impl this;

Re: version(StdDoc)

2018-11-25 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, Nov 25, 2018 at 07:22:54AM +, Stanislav Blinov via Digitalmars-d-learn wrote: > On Sunday, 25 November 2018 at 07:19:50 UTC, Stanislav Blinov wrote: > > > Granted, it may require some special syntax, i.e. > > > > enum E { > > a, > > b if version(Windows), > > c if

Re: version(StdDoc)

2018-11-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, November 24, 2018 10:41:56 PM MST H. S. Teoh via Digitalmars-d- learn wrote: > On Sat, Nov 24, 2018 at 05:48:16PM +, Stanislav Blinov via Digitalmars-d-learn wrote: > > On Saturday, 24 November 2018 at 17:43:35 UTC, Jonathan M Davis wrote: > > > I'm still inclined to think though

Re: version(StdDoc)

2018-11-24 Thread Stanislav Blinov via Digitalmars-d-learn
On Sunday, 25 November 2018 at 07:19:50 UTC, Stanislav Blinov wrote: Granted, it may require some special syntax, i.e. enum E { a, b if version(Windows), c if version(Windows), d if version(Posix), } or something to that effect. Come to think of it, since UDAs are now

Re: version(StdDoc)

2018-11-24 Thread Stanislav Blinov via Digitalmars-d-learn
On Sunday, 25 November 2018 at 05:41:56 UTC, H. S. Teoh wrote: On Sat, Nov 24, 2018 at 05:48:16PM +, Stanislav Blinov via Digitalmars-d-learn wrote: Yup. UDAs did get in there eventually, and version should too. I think this would be a trivial DIP, by making it such that a version

Re: version(StdDoc)

2018-11-24 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Nov 24, 2018 at 05:48:16PM +, Stanislav Blinov via Digitalmars-d-learn wrote: > On Saturday, 24 November 2018 at 17:43:35 UTC, Jonathan M Davis wrote: > > On Saturday, November 24, 2018 9:28:47 AM MST Stanislav Blinov via > > Digitalmars-d-learn wrote: [...] > > > enum Foo > > > { > >

Re: version(StdDoc)

2018-11-24 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Nov 24, 2018 at 10:27:07PM +, Adam D. Ruppe via Digitalmars-d-learn wrote: [...] > (Though a parsing thing: /// version(linux) void foo(); - is that doc > on version linux or on void foo or on both? I guess it could only > apply it in if there are {}... but eh I still don't love it.)

Re: version(StdDoc)

2018-11-24 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 24 November 2018 at 16:16:08 UTC, H. S. Teoh wrote: Actually, what would be ideal is if each platform-specific version of the symbol can have its own associated platform-specific docs, in addition to the one common across all platforms, and the doc system would automatically

Re: version(StdDoc)

2018-11-24 Thread Stanislav Blinov via Digitalmars-d-learn
On Saturday, 24 November 2018 at 17:43:35 UTC, Jonathan M Davis wrote: On Saturday, November 24, 2018 9:28:47 AM MST Stanislav Blinov via Digitalmars-d-learn wrote: On Saturday, 24 November 2018 at 07:00:31 UTC, Jonathan M Davis wrote: > [not legal] > > enum Foo > { > > a, > b, >

Re: version(StdDoc)

2018-11-24 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, November 24, 2018 9:28:47 AM MST Stanislav Blinov via Digitalmars-d-learn wrote: > On Saturday, 24 November 2018 at 07:00:31 UTC, Jonathan M Davis > > wrote: > > [not legal] > > > > enum Foo > > { > > > > a, > > b, > > version(linux) c = 42, > > else version(Windows)

Re: version(StdDoc)

2018-11-24 Thread Stanislav Blinov via Digitalmars-d-learn
On Saturday, 24 November 2018 at 07:00:31 UTC, Jonathan M Davis wrote: [not legal] enum Foo { a, b, version(linux) c = 42, else version(Windows) c = 54, } You're forced to version the entire enum. Not in this case, no: enum Foo { a, b, c = {

Re: version(StdDoc)

2018-11-24 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Nov 23, 2018 at 09:43:01PM -0700, Jonathan M Davis via Digitalmars-d-learn wrote: [...] > Honestly, I would argue that if you have multiple versions of the > documentation, then there's a serious problem. The documentation > shouldn't be platform-dependent even if the symbols are. Even if

Re: version(StdDoc)

2018-11-23 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, November 23, 2018 11:22:24 PM MST Neia Neutuladh via Digitalmars- d-learn wrote: > On Fri, 23 Nov 2018 21:43:01 -0700, Jonathan M Davis wrote: > > A solution like that might work reasonably well, but you still > > have the problem of what to do when a symbol is documented in multiple >

Re: version(StdDoc)

2018-11-23 Thread Neia Neutuladh via Digitalmars-d-learn
On Fri, 23 Nov 2018 21:43:01 -0700, Jonathan M Davis wrote: > A solution like that might work reasonably well, but you still > have the problem of what to do when a symbol is documented in multiple > version blocks, and having almost all the documentation in one version > block and a few pieces of

Re: version(StdDoc)

2018-11-23 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, November 23, 2018 7:55:04 PM MST H. S. Teoh via Digitalmars-d- learn wrote: > Adam does have a very good point about showing all alternatives to docs, > though. Arguably, that's what ddoc *should* do. If the programmer > wrote a ddoc comment in the code, it probably should be

Re: version(StdDoc)

2018-11-23 Thread Jonathan M Davis via Digitalmars-d-learn
identifier that can affect the build), it was decided that Phobos would stop using version(D_Ddoc) as the language intended and instead use its own custom, version identifier for the documentation - which is why we now have version(StdDoc) in Phobos and version(CoreDdoc) in druntime. With this change, anyo

Re: version(StdDoc)

2018-11-23 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 24 November 2018 at 02:55:04 UTC, H. S. Teoh wrote: But then that would be reinventing what Adam has already done, right? :-D Precisely, I already do all that. And people are even actually using it!

Re: version(StdDoc)

2018-11-23 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Nov 24, 2018 at 02:09:22AM +, Neia Neutuladh via Digitalmars-d-learn wrote: > On Fri, 23 Nov 2018 17:21:25 -0800, H. S. Teoh wrote: > > Ddoc may have its stink points, but in this case, the stuff inside > > version(Windows) blocks simply isn't compiled, so you can't expect > > ddoc to

Re: version(StdDoc)

2018-11-23 Thread Neia Neutuladh via Digitalmars-d-learn
On Fri, 23 Nov 2018 17:21:25 -0800, H. S. Teoh wrote: > Ddoc may have its stink points, but in this case, the stuff inside > version(Windows) blocks simply isn't compiled, so you can't expect ddoc > to do much about it. You can't just arbitrarily ddoc everything inside > version blocks, because

Re: version(StdDoc)

2018-11-23 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 24 November 2018 at 01:21:25 UTC, H. S. Teoh wrote: Ddoc may have its stink points, but in this case, the stuff inside version(Windows) blocks simply isn't compiled That is why I call it "poorly designed" and a major reason why I dropped it entirely and created my own doc

Re: version(StdDoc)

2018-11-23 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Nov 24, 2018 at 12:51:36AM +, Adam D. Ruppe via Digitalmars-d-learn wrote: > On Friday, 23 November 2018 at 23:13:04 UTC, H. S. Teoh wrote: > > There are a few cases where this is needed, e.g., to generate docs > > for Windows-specific modules, since the website script is run on > >

Re: version(StdDoc)

2018-11-23 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 23 November 2018 at 23:13:04 UTC, H. S. Teoh wrote: There are a few cases where this is needed, e.g., to generate docs for Windows-specific modules, since the website script is run on Posix and the Windows APIs would not be compiled at all, leading to empty docs. Note that that is

Re: version(StdDoc)

2018-11-23 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Nov 23, 2018 at 09:53:59PM +, Adam D. Ruppe via Digitalmars-d-learn wrote: > On Friday, 23 November 2018 at 21:47:51 UTC, Tony wrote: > > What is the situation in which the identifier StdDoc is set? > > When the phobos website is being compiled, its own makefile sets that. > > It is

Re: version(StdDoc)

2018-11-23 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 23 November 2018 at 21:47:51 UTC, Tony wrote: What is the situation in which the identifier StdDoc is set? When the phobos website is being compiled, its own makefile sets that. It is basically a hack for website display.

version(StdDoc)

2018-11-23 Thread Tony via Digitalmars-d-learn
In std.compiler there is this code: /// Which vendor produced this compiler. version(StdDdoc) Vendor vendor; else version(DigitalMars) Vendor vendor = Vendor.digitalMars; else version(GNU) Vendor vendor = Vendor.gnu; else version(LDC) Vendor vendor =