This is the mail archive of the docbook@lists.oasis-open.org mailing list for the DocBook project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFE #473365: Allow optional in funcprototype


RFE #473365[1] reads, in part:

  The current way of modeling how functions take arguments makes it
  almost impossible to correctly model for example PHP functions and is
  causing a lot of trouble for the documentation.

  [It would be better to] allow optional in funcprototype and paramdef
  in optional. This would allow both clean grouping of optional
  parameters together and making some optional parameters dependent of
  the previous ones. An example:

  <funcprototype>
  <funcdef>int <function>foo</function></funcdef>
  <paramdef>int <parameter>bar</parameter></paramdef>
  <optional>
  <paramdef>int <parameter>baz</parameter></paramdef>
  <paramdef>int <parameter>aaa</parameter></paramdef>
  <optional>
  <paramdef>int <parameter>bbb</parameter></paramdef>
  <paramdef>int <parameter>ccc</parameter></paramdef>
  </optional>
  </optional>
  </funcprototype>

  This would probably help modeling some other languages too.

Languages that allowed optional function arguments weren't very common
when funcprototype was designed. This solution seems to solve the
problem fairly well, except that it would require introducing paramdef to
the content model of optional.

The TC discussed this and is considering adding an 'optionalparamdef'
wrapper instead (i.e., instead of optional above, not instead of paramdef).

Does this seem useful to the community at large?

Is a similar optionalmethodparam element needed for methodparam?

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com>      | If you cannot find the truth right
http://www.oasis-open.org/docbook/ | where you are, where else do you
Chair, DocBook Technical Committee | expect to find it?--Dogen


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]