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

Re^2: Accessors in xs

by hardburn (Abbot)
on Oct 24, 2005 at 19:04 UTC ( [id://502560]=note: print w/replies, xml ) Need Help??


in reply to Re: Accessors in xs
in thread Accessors in xs

That was it. Applying chromatic's suggestion for a *PUSH* macro fixed it all:

void world_location(self) SV* self PREINIT: HV *hash_self = (HV*) SvRV( self ); SV **x = hv_fetch( hash_self, "x", 1, FALSE ); SV **y = hv_fetch( hash_self, "y", 1, FALSE ); PPCODE: EXTEND(SP, 2); PUSHs( *x ); PUSHs( *y );

Passes all tests. Thanks.

"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-25 17:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found