Re: Protos and display
| From: | Hartmut Holzgraefe | Date: | Wed, 02 Jul 2003 15:31:42 +0000 |
| Subject: | Re: Protos and display | ||
| References: | 1 2 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969355002@lists.php.net to get a copy of this message | ||
Gabor Hojtsy wrote:
the notation itself is valid in that it says that argument 2 and 3 are both optinal but not independent of each other, so you have either one or all 3 of themIt seems like we have a problem with the proto's constructions : From php.net/manual/en/function.dba-fetch.php : string *dba_fetch* ( string key [, int skip, resource handle]) [...]
The display is based on the PHP rule, which means that if a parameter is optional, the additional parameters are also optional. There should not be a PHP funciton with a proto, where some parameter not on the end of the param list is optional... ;((the actual implementation is really violating this rule in that its prototype is "string dba_fetch(string key [, int skip], resource handle)" there is no way to express both variants with DocBook <methodsynopsis> (and don't even ask about <funcionsynopsis> ;) as you can just flag parameters as optional but can't express dependancy relationships with the given tags and attributs (unless we introduce another role=... 'abuse) when i (afair it was me?) implemented the stylesheet logic for renderung <methodsynopsis> as prototypes i decided that the first case (optional parameter followed by non-optional is "either both or none") was the "right thing" so implemented stuff this way (i didn't even know we had functions like dba_fetch) all this just leads me to a different question: does using <methodsynopsis> really make sense? or is the markup just making things unnecessary complicated? maybe we should just drop all that and put in a verbatim prototype instead just like in the C source instead ...? -- Hartmut Holzgraefe <hartmut@php.net>