meta_postfix:*

2008-07-13 Thread TSa (Thomas Sandlaß)
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.

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 ***.

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.


Regards, TSa.
-- 
The unavoidable price of reliability is simplicity -- C.A.R. Hoare
Simplicity does not precede complexity, but follows it. -- A.J. Perlis
1 + 2 + 3 + 4 + ... = -1/12  -- Srinivasa Ramanujan


Re: meta_postfix:*

2008-07-13 Thread Jon Lang
So you're suggesting that

  A op* n

should map to

  [op] A xx n

?

-- 
Jonathan Dataweaver Lang


$foo[0][0] versus $foo[0;0]

2008-07-13 Thread Adrian Kreher
Hi,

I'm reviewing the tests in S09, and the file 
t/spec/S02-builtin_data_types/multi_dimensional_array.t uses the [0][0]  
indexing format interchangeably with [0;0].

These two formats mean two different things, correct? The [0][0] form isn't 
mentioned much in the spec, nor is [0;0] or if they interact somehow.

Thanks,
-- 
Adrian Kreher