perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [mp2] Suggest renaming Apache::CmdParms $parms->info to $parms->cmd_data
Date Thu, 16 Sep 2004 04:11:37 GMT
Geoffrey Young wrote:
>>>> sub MyDirective {
>>>>   my($self, $parms, $args) = @_;
>>>>   my $info = $parms->info;
>>>>                      ^^^^
>>>>
>>>>Wouldn't $parms->cmd_data make more sense ?
> 
> 
>>>+1
>>>
>>>Especially since parms->info on the C level is something else. It's
>>>really parms->info->cmd_data.
> 
> 
> 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.  for instance, from core.c:
> 
> static const char *set_server_string_slot(cmd_parms *cmd, void *dummy,
>                                           const char *arg)
> {
>     /* This one's pretty generic... */
> 
> 
>     int offset = (int)(long)cmd->info;
> 
> so, unless I'm missing something, I don't see the reason to change this
> interface at all.

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 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.


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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message