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

Re: Semantics of vector operations

Thread Previous | Thread Next
Larry Wall
January 23, 2004 17:42
Re: Semantics of vector operations
Message ID:
On Fri, Jan 23, 2004 at 01:54:21PM -0800, Dave Whipp wrote:
: When I see these long squiggles of line noise, I can't help thinking that
: English might be a better alternative. Using Larry's terminology from a few
: posts ago, we might think of:
:  @a  \C[leach] + \C[reach] @b
: Not mnemonic in a visual sense, but extendable to all sorts of trigraph
: contexts. Indeed, if we had a "this is an operator" operator, we could give
: every symbol a textual name:
:   $a \op[assign] $b \op[plus] $c;
:   @a = @b \op[leach plus reach] @c;

That's an interesting idea, but I'd prefer to generalize it to the
notion of how you interpolate a macro call that may be ambiguous
with its surroundings.  Then you can set up any text you want.
In the unambiguous cases you can leave out the disambiguating syntax.

That is, suppose you have:

    macro leach () { return "»" }
    macro reach () { return "«" }

You could unambiguosly write


but (assuming spaces not allowed within distributed operators) you can't


But if instead you could write something like


then you can still do it even when it'd be ambiguous.  But I can think
of prettier ways to disambiguate:


Unfortunately, all the good brackets are taken.  Hey, we could use
those weird French quotes:


Oh, wait...nevermind...


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About