On Sun, Jul 13, 2008 at 12:46:30PM +0200, TSa (Thomas Sandlaß) wrote:
: HaloO,
: 
: I know that the hot phase of the operator discussions are over.
: But here's a little orthogonalizing idea from my side. The observation
: is that * can be regarded as repeated addition: 5 * 3 == 5 + 5 + 5
: and ** as repeated multiplication. Now imagine having a meta_postfix:<*>
: that gives +* as multiplication (perhaps abbreviated as *) and ** as
: (integer) exponentiation. We can then continue with replication as ~*
: for strings and ,* for lists thus freeing x and xx as some generic
: multiplication operators.

I think this is not going to fly from the standpoint of keeping common
operators visually distinct.  Also, how will you parse 1..* and such?

(Another consideration is that every time you add another metaoperator
you're potentially exploding the number of operators that the longest
token matcher needs to deal with, though STD currently cheats on this.)

: The meta * also is useful e.g. as (1,2) Z* 3 === (1,1,1),(2,2,2). Also
: when we apply it to unary postfix as well: $x++* 3 === $x++.++.++ which
: is useful when $x is of some class with overloaded ++ where the single
: steps are important. The meta postfix * could also be stacked and tetration
: falls out naturally as ***.

Speaking on behalf of the mere mortal, My Eyes Glaze Over.

Speaking as a parser writer, you're confusing the parser with a
metaoperator that changes expectation of term vs infix.

Sepaking as a programmer, $x++.++.++ won't do what you seem to think it does.

: With + as the default case for meta_postfix:<*> we win the advantage that
: we have +* and * as multiplication operators with the latter being a special
: form of the former. But for Vectors +* would automatically yield the scalar
: multiplication infix:<+*>:(Vector,Num) when infix:<+>:(Vector,Vector) is
: defined as expected.

You can, of course, do anything you like with your own copy, but the
standard reserves most of Unicode as the playground of mathematicians,
so please leave our poor little * alone.  :)

Larry

Reply via email to