Lucifers,

Currently, the documentation for Perl constructors is taken from the "initializer" which defaults to the `init` function. So most .cfh files contain something like:

    inert incremented EasyAnalyzer*
    new(String *language = NULL);

    /**
     * @param language An ISO code from the list of supported languages.
     */
    public inert EasyAnalyzer*
    init(EasyAnalyzer *self, String *language = NULL);

For the C API documentation, we need to document both functions. So I'd like to change that to:

    /** Create a new EasyAnalyzer.
     *
     * @param language An ISO code from the list of supported languages.
     */
    public inert incremented EasyAnalyzer*
    new(String *language = NULL);

    /** Initialize an Easy Analyzer.
     *
     * @param language An ISO code from the list of supported languages.
     */
    public inert EasyAnalyzer*
    init(EasyAnalyzer *self, String *language = NULL);

But with this change, the Perl documentation should use the DocuComment of `new`, not `init`. There's already a mechanism to specify from which function the documentation should be taken: The `initializer` parameter of `CFCPerlPod_add_constructor`.

    @param initializer The name of the initialization routine from the
    Clownfish class.  Defaults to "init".

Maybe we should change this parameter and its default to:

    @param pod_func The name of the function from which the constructor's
    documentation should be taken.  Defaults to "new".

Does that make sense? Related issue:

    https://issues.apache.org/jira/browse/CLOWNFISH-41

Nick

Reply via email to