develooper Front page | perl.perl6.language | Postings from October 2001

Re: prefix-postfix [was Re: NaN semantics]

Thread Previous
From:
Jonathan Scott Duff
Date:
October 10, 2001 10:45
Subject:
Re: prefix-postfix [was Re: NaN semantics]
Message ID:
20011010124500.D17820@cbi.tamucc.edu
On Wed, Oct 10, 2001 at 06:28:42PM +0200, raptorVD wrote:
> U mean something like 'term' (or how this thing is called 'bareword' ? )
> So I can say :
>  # $x = 10k;
> my sub operator:number is postfix(k) ($num) {
>     return $num * 1000
> }

I think that would be

	sub operator:K is postfix prec(\&operator:-($)) ($num) {
	   return $num * 1000;
	} 

but yeah, that's the idea.  And it would live in a module so that
users would have to do

	use BinaryMetric;	# or some such

to get it.

-Scott
-- 
Jonathan Scott Duff
duff@cbi.tamucc.edu

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