to me:
Would you consider passing \$fido to ALLOCATE? It would avoid the
need for some fairly serious pain in Topaz.
need for some fairly serious pain in Topaz.
In Topaz, possession of a Scalar* (old: SV*) is not adequate to tie a
variable; you need the Scalar** (SV**) so that you can create a new
TiedScalar (SV with MAGIC) and make the Scalar** point to it.
Here's an example:
sv_setref_iv(ST(2), Window_Package, (IV)root_return);
generated by xsubpp from the following:
int
XGetGeometry(display, d, root_return, ...
Display * display
Drawable d
Window &root_return
Anybody who uses & syntax in an XSUB seems to be at risk -- operations
that change the scalar's representation will break. I've never really
liked the idea of modifying (or worse, transmogrifying ;) apparent
pass-by-value arguments (another victim of Pascal?), but it is deeply
ingrained in Perl.
Is this a problem for XSUBS, user code, both or neither?
What are the time/space trade-offs for allowing modification of
sub arguments? Is it worth doing to improve compatibility with Perl 5?
- Ken
--
Ken Fox, kfox@ford.com, (313)59-44794
------------------------------------------------------------------------
Ford Motor Company, Powertrain | "Is this some sort of trick
Analytical Powertrain Methods Department | question or what?" -- Calvin
C3P Implementation Section |
