Re: RFC 200 (v2) Objects: Revamp tie to support extensibility (Massive tie changes)

[email protected] (Piers Cawley) 21 Sep 2000 09:53:35 +0100
Newsgroups perl.perl6.language.objects
Message-ID <[email protected]>
Damian Conway <[email protected]> writes:

> I didn't see any mention of my plea that C<tie> should pass the 
> original variable being tied as one of its arguments. :-(
> 
> E.g.:
> 
> 	sub ReadOnly::TIESCALAR {
> 		my ($class, $original, @otherargs) = @_;
> 		bless {
> 			internals => \@otherargs,
> 			value     => $original,
> 		      }, $class
> 	}
> 
> 	sub ReadOnly::FETCH { return $_[0]->{value} }
> 
> 	# and later:
> 
> 	my $x = 10;
> 	tie $x, 'ReadOnly';
> 	print $x;	# still prints 10
> 
> 
> I feel that additional functionality is *very* important.

Seconded. Really, really strongly. Even if it does smack of *very*
spooky action at a distance if one isn't careful. But that's the whole
point of tie...

-- 
Piers