Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: Terrible Trouble With Typemaps (XS Question)

by dragonchild (Archbishop)
on Sep 07, 2004 at 16:41 UTC ( [id://389130]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Terrible Trouble With Typemaps (XS Question)
in thread Terrible Trouble With Typemaps (XS Question)

What about the following:
CODE: if ( MY_SV_IS( ST(0), 'MyList' )) { THIS->count_Items_in( MY_CAST_SV( ST(0), 'MyList' ) } elsif (MY_SV_IS( ST(0), 'MyHash' )) { THIS->count_Items_in( MY_CAST_SV( ST(0), 'MyHash' ) }

This way, you don't have a plethora of macros. Remember, a preprocessor macro is just a direct text substitution. So, you can put text in there, kinda like what I was doing in my first reply.

------
We are the carpenters and bricklayers of the Information Age.

Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

I shouldn't have to say this, but any code, unless otherwise stated, is untested

Replies are listed 'Best First'.
Re^4: Terrible Trouble With Typemaps (XS Question)
by Molt (Chaplain) on Sep 09, 2004 at 11:03 UTC

    It's got to be a plethora of macros, unfortunately, since the way I convert to MyList could well be very different from the conversion to MyHash.. especially when it comes to handling classes inherited from them.

    Ah well, with a consistant naming strategy there's not too much stuff making the macro namespace unusable.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://389130]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-04-19 12:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found