On 10/02/11 23:47, Tim Bunce wrote:
> On Sun, Feb 06, 2011 at 02:39:09PM +0000, Martin J. Evans wrote:
>> On 06/02/2011 13:00, Tim Bunce wrote:
>>> On Sat, Feb 05, 2011 at 01:27:11PM +0000, Martin J. Evans wrote:
>>>>> ok, the 3 new trace flags are in and I added macros (slight shame
>>>>> you cannot use them in DBI.pm too but not a great deal).
>>> I think they should be added to the ALIAS list in constant().
>>>
>> Which I've done but I'm not sure it you meant this was supposed to
>> allow me to use them in DBI.pm as I still cannot. I don't really
>> understand constant() it just seems to return the ix which I thought
>> was the index number of the alias so I'm not sure what it is there
>> for.
> 
> It is the 'index number' but by using the
> 
>     ALIAS:
>         DBIf_FOO = DBIf_FOO
> 
> syntax you can set the index number for a specific name to a specific
> value. In this case the value of the macro of that name. Kind'a cute.
> So now DBIf_FOO is the name of a perl constant[*] that has the value of
> the DBIf_FOO macro.

I sort of gathered that was supposed to happen from perlxs but I thought you 
were indicating once I'd done that I could avoid the use of the hex constant in 
2 places.

> [*] These constants aren't real compile-time constants, sadly. They're
> just AUTOLOADed functions that return a constant value. There are
> probably better (faster and lighter-weight) ways of defining constants
> in XS in modern perl versions. I've never got around to reworking this.

ok, thanks for the explanation.
 
>>> I've not tested any of the above. I'd be grateful if you could test it
>>> out. t/09trace.t could be extended for that purpose. (I'm not sure how
>>> much effort it would be to keep DBI::PurePerl in sync with this work.)
>>
>> I changed 09trace.t for new flags and it passes ok.
>>
>> I don't know much about DBI::PurePerl (never used it) - it doesn't
>> see to do anything with trace flags at all as far as I can see.
> 
> DBI::PurePerl mostly ducks the issue of selective tracing.
> I suspect the 09trace.t tests just aren't noticing that.
> Not a big issue.
> 
> Tim.

Thanks.

Martin
-- 
Martin J. Evans
Easysoft Limited
http://www.easysoft.com

Reply via email to