./perl -I lib -Dp -e '{package Dog}; my $spot = 0' 2 dogless

2005-08-22 Thread Jim Cromie

folks,

I was poking around to see if I could figure out where perly.y
handled 'my Dog $spot' differently than the dogless variety, and couldnt 
find it.


so I tried:
./perl -I lib -Dp -e '{package Dog}; my $spot = 0' 2 dogless
./perl -I lib -Dp -e '{package Dog}; my Dog $spot = 0' 2 dogfull

and diffd them.
only difference was hex-codes - no differences reported by -Dp.

I know that there is some difference inside,
else this would not fail:

mydog]$ ./perl -I lib -e 'my Dog $spot = 0'
No such class Dog at -e line 1, near my Dog
Execution of -e aborted due to compilation errors.


any hints ?


Re: ./perl -I lib -Dp -e '{package Dog}; my $spot = 0' 2 dogless

2005-08-22 Thread Rafael Garcia-Suarez
Jim Cromie wrote:
 folks,
 
 I was poking around to see if I could figure out where perly.y
 handled 'my Dog $spot' differently than the dogless variety, and couldnt 
 find it.

It's handled upstream, by the tokenizer. Look up case KEY_my in toke.c.


Re: ./perl -I lib -Dp -e '{package Dog}; my $spot = 0' 2 dogless

2005-08-22 Thread Jim Cromie

Rafael Garcia-Suarez wrote:


Jim Cromie wrote:
 


folks,

I was poking around to see if I could figure out where perly.y
handled 'my Dog $spot' differently than the dogless variety, and couldnt 
find it.
   



It's handled upstream, by the tokenizer. Look up case KEY_my in toke.c.

 


looked, saw, these arent the droids im looking for.

I ran again w -DT, got a diff with 'Dog' as the only difference on 8 lines
(no point in showing them).

So I should get a bit more specific;
I thought Id try to define a few op-private flags on padsv, sassign, 
aassign to indicate

some manner of dog-ness / object-ness.

I dont have any strategy in mind, except to mark them in a way that 
makes them
easy to find with optimizer.pm.  Then all sorts of out-of-core hackery 
can commence. :-)


Re: ./perl -I lib -Dp -e '{package Dog}; my $spot = 0' 2 dogless

2005-08-22 Thread Rick Delaney
On Mon, Aug 22, 2005 at 12:45:41PM -0600, Jim Cromie wrote:
 
 So I should get a bit more specific;
 I thought Id try to define a few op-private flags on padsv, sassign, 
 aassign to indicate
 some manner of dog-ness / object-ness.
 
 I dont have any strategy in mind, except to mark them in a way that 
 makes them
 easy to find with optimizer.pm.  Then all sorts of out-of-core hackery 
 can commence. :-)

In that case, if you just need to be able to identify the class then
look at how fields.pm does it.  Grep for FIELDS in op.c and go up a bit.

Here is some code I've used before with optimizer:

char* lexical_type(int pad_offset) {
SV* lexname;
lexname = *av_fetch(PL_comppad_name, pad_offset, TRUE);
if (!(SvFLAGS(lexname)  SVpad_TYPED))
return NULL;
return HvNAME(SvSTASH(lexname));
}

HTH,

-- 
Rick Delaney
[EMAIL PROTECTED]


Re: ./perl -I lib -Dp -e '{package Dog}; my $spot = 0' 2 dogless

2005-08-22 Thread Dave Mitchell
On Mon, Aug 22, 2005 at 03:15:59PM -0400, Rick Delaney wrote:
 Here is some code I've used before with optimizer:
 
 char* lexical_type(int pad_offset) {
 SV* lexname;
 lexname = *av_fetch(PL_comppad_name, pad_offset, TRUE);
 if (!(SvFLAGS(lexname)  SVpad_TYPED))
 return NULL;
 return HvNAME(SvSTASH(lexname));
 }

or see PAD_COMPNAME_TYPE()

-- 
Never do today what you can put off till tomorrow.