Suggestion for DDoc - share parameter descriptions

nick nick.atamas at gmail.com
Thu May 18 23:22:05 PDT 2006


I am not sure about the best way to do this, but some sort of
"ditto"-like feature may be good.

The flip side of the argument is that you should probably have a vec3
class/template for handling this sort of situation. This kind of logic
would apply to having pretty much any number of similar parameters.
The logic being: If parameters belong together, then group them together
and document the group.


Jarrett Billingsley wrote:
> Sometimes, you have several parameters that work together, as components of 
> an aggregate value, perhaps.  In this case, it seems redundant to write
> 
> 
> /**
> Makes a spoony color.
> 
> Params:
>     r = The red component of the color.
>     g = The green component of the color.
>     b = the blue component of the color.
> */
> uint spoon(int r, int g, int b)
> {
> 
> }
> 
> 
> Instead, it'd be convenient to write something like
> 
> 
> /**
> Makes a spoony color.
> 
> Params:
>     r = The red, green, and blue components of the color.
>     g = ditto
>     b = ditto
> */
> 
> 
> Which follows the current convention for using the same documentation for 
> multiple items.
> 
> Or even better:
> 
> 
> /**
> Makes a spoony color.
> 
> Params:
>     r, g, b = The red, green, and blue components of the color.
> */
> 
> 
> A niche feature, I know, but it's just for fun. 
> 
> 



More information about the Digitalmars-d mailing list