Flag proposal

David Nadlinger see at klickverbot.at
Sat Jun 11 07:14:42 PDT 2011


On 6/11/11 3:56 PM, Andrei Alexandrescu wrote:
> To add the documentation effort:
>
> /**
> This is an argument for func. Refer to func below.
> */
> enum Abc {
> no, /// you don't want func to do Abc
> yes /// you do want func to do Abc
> }
>
> /**
> This is func. Mind Abc defined above.
> */
> void func(Abc abc);
>
> I think we agree this is rather awkward (I know because I wrote a fair
> amount of such).
>
> So we have the advantage of a nice call syntax and the disadvantage of
> verbose definition and documentation.

So what? Library code is typically written once, and used often. Also, 
what's wrong with the followig (maybe there is really an issue with it, 
didn't run it through DDoc):

---
/**
  * This is func.
  *
  * Params:
  *   abc = Abc.yes to destroy the world, Abc.no to leave it intact.
  */
void func(Abc abc) {}

/// Ditto.
enum Abc : bool { no, yes }
---

David


More information about the Digitalmars-d mailing list