Re: Tying sub arguments is rare?
[email protected] (Ken Fox) Wed, 13 Oct 1999 20:52:58 -0400 (EDT)
| Newsgroups | perl.perl6.porters |
|---|---|
| Message-ID | <[email protected]> |
Chip Salzenberg writes:
> The hard case is when a Scalar of undetermined type -- say, a
> KenFoxScalar -- is tied. Since I have no knowledge of the size or
> lifetime or other characteristics of KenFoxScalars, I can't assume
> that transmogrification will work. Thus my intention to restrict
> the semantics of tie.
We haven't seen TiedScalar yet, but if you think you can make the
core work, then extension authors will probably just copy whatever
you come up with. We've been able to learn magic after all, so how
hard can transmogrification be? ;)
Is tying the only case where transmogrification hurts? This bit of
code seems painful too:
my $x = 1;
$x = foo();
sub foo { my $y : KenFoxScalar = 2; $y }
BTW, I've never really been sure if extension writers are going to
be creating new scalars or new Guts. Doesn't all of this trouble go
away if extension writers only create new Guts? Then everything
works like a Thin or Fat scalar -- just like Perl 5, but with the
ability to stash small values right in the SV.
- Ken
--
Ken Fox, [email protected], (313)59-44794
------------------------------------------------------------------------
Ford Motor Company, Powertrain | "Is this some sort of trick
Analytical Powertrain Methods Department | question or what?" -- Calvin
C3P Implementation Section |