digitalmars.D.learn - Documenting contracts in Ddoc
- Ross Hays (12/12) Jan 01 2014 Given that D has contracts built into the language (which is one
- bearophile (4/7) Jan 01 2014 Currently contracts don't go in DDoc, but they could.
- H. S. Teoh (11/18) Jan 01 2014 [...]
- Gary Willoughby (4/25) Jan 02 2014 Agreed. More control is definitely needed over this to aid
Given that D has contracts built into the language (which is one of my favorite features of D by far) it seems to me that it should be possible to document the pre and post conditions of a contract using a contract section in Ddoc. I have been reading through the documentation on Ddoc to see if this is possible, and haven't seen anything yet, nor have I seen any previous topics on it. Am I missing something or is this just not a feature of Ddoc? Furthermore the same thing would be nice to be able to document invariants for a class. I am putting this topic in the learn forum because I may be wrong and it may be possible. If, however, it is not possible, that maybe it is worth a official suggestion?
Jan 01 2014
Ross Hays:I am putting this topic in the learn forum because I may be wrong and it may be possible. If, however, it is not possible, that maybe it is worth a official suggestion?Currently contracts don't go in DDoc, but they could. Bye, bearophile
Jan 01 2014
On Thu, Jan 02, 2014 at 03:42:53AM +0000, bearophile wrote:Ross Hays:[...] They *should*. This is one of the glaring weak points of DDoc. A related issue is the ability to pretty-print signature constraints: the latest dmd will (finally!) include sig constraints in the generated docs, but right now it just comes out as a big block of text, which has poor readability. There really should be a way to pretty-print the sig constraint so that it's more readable. T -- Lottery: tax on the stupid. -- SlashdotterI am putting this topic in the learn forum because I may be wrong and it may be possible. If, however, it is not possible, that maybe it is worth a official suggestion?Currently contracts don't go in DDoc, but they could.
Jan 01 2014
On Thursday, 2 January 2014 at 06:19:53 UTC, H. S. Teoh wrote:On Thu, Jan 02, 2014 at 03:42:53AM +0000, bearophile wrote:Agreed. More control is definitely needed over this to aid readability. I hate the 'big block of text' that it currently does.Ross Hays:[...] They *should*. This is one of the glaring weak points of DDoc. A related issue is the ability to pretty-print signature constraints: the latest dmd will (finally!) include sig constraints in the generated docs, but right now it just comes out as a big block of text, which has poor readability. There really should be a way to pretty-print the sig constraint so that it's more readable. TI am putting this topic in the learn forum because I may be wrong and it may be possible. If, however, it is not possible, that maybe it is worth a official suggestion?Currently contracts don't go in DDoc, but they could.
Jan 02 2014