At 10:30 PM 4/8/2002 -0700, Robert Spier wrote:

>>Keep track of global (or interpreter local) scope with a macro
>>upon entry.
>
>I shudder every time someone says "macro" on p6i.
>
>perl5 has several thousand macros defined.  (grep for ^#define) (over 8000 
>if you include all the embedding macros.  it's down to ~4000 if you cut 
>out embedding, config.. and closer to ~1500/2000 if you rip out more things.)

Are you counting literals and things like bit values in your grep?

>This makes it wonderfully challenging to debug.

That might be a bit unfair, I'd argue that it makes it _easier_
to debug in many cases, particularly with constants.

>Macros are a useful feature of the C language, but we should be very 
>careful in how we use them.  (I'm not saying don't use them at all.) I'm 
>sure there's a happy medium somewhere between no macros and perl5. We 
>should look for it.

'macro' here is a choice of words... call it an inline function if you want.

I'd be more worried about debugging that computed goto core than a macro. :)

-Melvin

Reply via email to