Should this work?

Jacob Carlborg doob at me.com
Fri Jan 10 00:22:27 PST 2014


On 2014-01-10 02:13, H. S. Teoh wrote:

> The hand-classified table of functions in std.algorithm and std.range is
> more useful, IMO. At least it lets you use divide-and-conquer to zoom
> down to your area of interest, whereas the order of links in the blob of
> links has no relation whatsoever to the functionality provided.

I'm convinced the both of the tables on in the std.algorithm 
documentation can automatically be generated with a bit help from the 
compiler. Add a macro, $(CATEGORY), the compiler knows about. The 
compiler will the generate the first table by using the symbol (which it 
already knows about) and the $(CATEGORY) macro. The second table can be 
generated in a similar way, just take the summary (first paragraph) of 
the documentation of the symbol.

> The order of docs for each symbol also follows the order in the source
> code, which may not necessarily follow a logical order. This makes
> browsing the docs difficult -- one minute it's describing find()
> overloads, next minute it's talking about set unions, then after that
> it's back to findAfter(), then it jumps to remove(), etc.. Try finding
> what you want when the docs are 50 pages of this random jumping around.
> All the more this makes a hand-classified table of symbols
> indispensable.

I would say that is poorly organized code. Although, if you do have a 
$(CATEGORY) macro, as described above, it might be a good idea to group 
the rest of the documentation after this as well.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list