develooper Front page | perl.perl6.language | Postings from September 2002

Re: Throwing lexicals

Thread Previous
From:
Andrew Wilson
Date:
September 9, 2002 13:38
Subject:
Re: Throwing lexicals
Message ID:
20020909203817.GB3166@rivendale.net
On Mon, Sep 09, 2002 at 02:13:55PM -0600, Luke Palmer wrote:
> Err.. I don't think so.
> 
> 	# Date.pm
> 	grammar Date;
> 	my $date;
> 	rule date_rule { $date := <something> }
> 
> 	# uses_date.p6   (hmm.. I wonder what a nice extension would be...)
> 	use Date;
> 	my $date;
> 	m/ <Date::date_rule> /;
> 
> This would mess with $Date::date, not $main::date.  If there was no 
> $Date::date, it wouldn't mess with anything, and it would store 
> the return value of <something> in $0{date}.

Ok, That makes a great deal more sense.  I was confused by the
discussion of dynamic scope.

andrew
-- 
Cancer: (June 22 - July 22)
You will soon find yourself entangled in a messy accident with a knife thrower,
although drunk driving, not knife throwing, is actually the real issue.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About