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

Re: Semantics of vector operations

Thread Previous | Thread Next
From:
Dave Whipp
Date:
January 23, 2004 18:43
Subject:
Re: Semantics of vector operations
Message ID:
20040124024305.49986.qmail@onion.perl.org
"Larry Wall" <larry@wall.org> wrote in message
news:20040124014137.GA26838@wall.org...
> That is, suppose you have:
>
>     macro leach () { return "»" }
>     macro reach () { return "«" }
>
> You could unambiguosly write
>
>     leach+reach
>
> but (assuming spaces not allowed within distributed operators) you can't
> write
>
>     leacheqreach

But, presumably, you could write a macro that has a whitespace-eater encoded
somehow. That is,

macro leach() { chomp_trailing_whitespace; return "»" }
macro reach () { chomp_leading_whitespace; return "«" }

then the macro magic would expand "leach eq reach" as "»eq«" (which,
hopefully, it then re-parses as a single token^Woperator). This doesn't
solve the generalized problem of disambiguating, though I could see a "_"
operator defined as a macro that eats all its surrounding whitespace.


Dave.



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