Geoffrey Young wrote:
while our code interface into it is parms->info->cmd_data that's not
the way
a C programmer would use it.  over in C land the directive handler
interface
looks exactly like the current perl interface.


What you are missing is that a user is passing that data using the
'cmd_data' hash key, so trying to retrieve it with info() is not the
best choice of the interface, IMHO.


I agree that it's not the best choice.  but this is also exactly the same as
the C interface:

struct command_struct {
    /** Name of this command */
    const char *name;
    /** The function to be called when this directive is parsed */
    cmd_func func;
    /** Extra data, for functions which implement multiple commands... */
    void *cmd_data;

so the arguments required when setting up a directive have the same name as
the structure elements, and the interface when retrieving them is the same
as the C interface.

I don't like when the (sometimes badly designed) C API makes it harder on the Perl users. 99.9% of mod_perl users will never use the C API. We have agreed to keep the Perl API as close to the C API, while making the Perl API intuitive and perlish. This case doesn't seem to follow that idea.


and all of this is exactly like it was in mp1 where
there is lots of documentation explaining it.

I think mp1 API is pretty much irrelevant here, since none of the existing mp1 directive handlers stuff will work as is under mp2.


I think the key and the retrieving
function  need to match. If you want it to be 'info', then it should be
'info' in both places.


for the record, we've had this discussion before and it's no surprise that
we came out on the exact same sides as we are now :)

http://marc.theaimsgroup.com/?t=105409005700004&r=1&w=2

Consistency is good :)

I still like the idea that the accessors match the structure slot names.  I
also think changing it at this point makes less sense - not that we can't
change things now, but that directive handlers are confusing enough without
going against both how Apache itself represents things and all of the
existing documentation for mp1 wrt the accessor names.

Well, I have no strong feelings about that change. I just think we can do better on the user interface. But whatever you feel is right, go with it. We have a way too big API to have the luxury of spending a lot of time discussing each method.


--
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to