On Jun 5, 2013, at 02:29 , Marvin Humphrey <[email protected]> wrote:

> There are a few odd cases which make the situation a little more complicated:
> 
> *   Abstract classes define `init` but not `new`.  (At the C level, at least.
>    The Perl bindings are different.)
> *   Some classes have no constructors: BoolNum, HashTombstone.
> *   Some classes need many custom constructors: CharBuf, Err.
> *   Several classes present constructors (named "open" by convention) which
>    attempt to return NULL and set an error variable on failure rather than
>    throw exceptions.
> 
> However, I don't think those oddities spoil the rationale.
> 
> Does that make sense?

It does make sense. But from a practical point of view, most host languages 
will use 'new' as constructor. So it would simplify things if we moved the 
constructor's documentation to the 'new' function and use an alias only for 
languages that have constructors with different names.

I think it would also be more consistent for classes with multiple 
constructors. In this case, we have to document the additional constructors 
because there aren't corresponding 'init' functions.

But it's no problem to work with the current system. I can simply copy the 
'init' documentation if 'new' doesn't have one.

Nick

Reply via email to