develooper Front page | perl.perl6.language | Postings from January 2004

RE: Semantics of vector operations

Thread Previous | Thread Next
From:
Jonathan Lang
Date:
January 20, 2004 20:28
Subject:
RE: Semantics of vector operations
Message ID:
20040121042739.85679.qmail@web40809.mail.yahoo.com
Austin Hastings wrote:
> Larry Wall wrote:
> > On the other hand, it's possible that we should extend the visual
> > metaphor of �� and apply it asymmetrically when one of the arguments 
> > is expected to be scalar.  That would mean that your last three lines 
> > would be written:
> >
> >     (1,2,3) �+� (4,5,6)
> >     $a �+� $b
> >     $x +� $y
> >
> > What's more, a unary vector op would then just be
> >
> >     -� @bar
> >
> > This also lets us use an array in its scalar sense for its length:
> >
> >     @foo �+ @bar
> 
> If only from a syntax-highlighting point of view, this is a horrible
> proposal. Make it die.

How is this any worse than syntax-highlighting a full �� construct?  

Incidently, it might make matters easier if you forbid whitespace between
the �� operator modifier and its operator.  Indeed, you might want to look
into including a trait for operator declarations which allows you to
modify the importance of whitespace - something like:

sub circumfix:�� (&o is infix) is whitespace(forbidden) {...}
sub prefix:� (&o is postfix|infix) is whitespace(forbidden) {...}
sub postfix:� (&o is prefix|infix) is whitespace(forbidden) {...}

=====
Jonathan "Dataweaver" Lang

__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

Thread Previous | Thread Next


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