Click here to get back home

Help with xs: converting I32 to int ?

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Help with xs: converting I32 to int ? Peter Billam 04-09-2006
Get Chitika Premium
Posted by Peter Billam on April 10, 2006, 9:12 pm
Please log in for more thread options


> It's probably worth pointing out that if you ever declare dXSARGS
> in a function, then 'items' becomes a keyword (within that function)
> and any attempt to use 'items' as a variable name (within that
> function) will produce fatal redefinition errors - error messages
> that don't really make it clear just what the problem is. For that
> reason I always avoid using 'items' as a variable name .... even
> though it's often the logical name to bestow upon the variable.

I got my "items" from perldoc perlxs where it says:
XSUBs can have variable-length parameter lists by specifying an
ellipsis "(...)" in the parameter list. This use of the ellipsis
is similar to that found in ANSI C. The programmer is able to
determine the number of arguments passed to the XSUB by examining
the "items" variable which the xsubpp compiler supplies for all <==
XSUBs. By using this mechanism one can create an XSUB which
accepts a list of parameters of unknown length.

What's dXSARGS and when would I need to declare it ?
It's mentioned once in perldoc perlxstut, but not in perldoc perlxs.

Regards, Peter

--
AUS/TAS/DPIW/CIT/Servers hbt/lnd/l8 6233 3061 http://www.pjb.com.au
Pasaré, pasarémos dice el agua y canta la verdad contra la piedra
-- Pablo Neruda

Posted by Sisyphus on April 10, 2006, 11:57 pm
Please log in for more thread options



> > It's probably worth pointing out that if you ever declare dXSARGS
> > in a function, then 'items' becomes a keyword (within that function)
> > and any attempt to use 'items' as a variable name (within that
> > function) will produce fatal redefinition errors - error messages
> > that don't really make it clear just what the problem is. For that
> > reason I always avoid using 'items' as a variable name .... even
> > though it's often the logical name to bestow upon the variable.
>
> I got my "items" from perldoc perlxs where it says:
> XSUBs can have variable-length parameter lists by specifying an
> ellipsis "(...)" in the parameter list. This use of the ellipsis
> is similar to that found in ANSI C. The programmer is able to
> determine the number of arguments passed to the XSUB by examining
> the "items" variable which the xsubpp compiler supplies for all <==
> XSUBs. By using this mechanism one can create an XSUB which
> accepts a list of parameters of unknown length.
>

Aaaahh .... sorry - I thought you had declared and were using a variable
named 'items' - but you're obviously not. In fact, you're using 'items' as
that very same reserved variable I was talking about. My mistake.

Cheers,
Rob



Similar ThreadsPosted
Converting email December 21, 2004, 6:14 pm
Converting dates March 30, 2005, 5:22 am
converting phone numbers to alphabets July 7, 2004, 6:49 pm
Converting images with padding or cropping on left and right September 23, 2007, 8:55 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap