On Wed, May 27, 2009 at 05:42:58PM -0500, John M. Dlugosz wrote:
> Mark J. Reed markjreed-at-gmail.com |Perl 6| wrote:
>> On Wed, May 27, 2009 at 6:05 PM, John M. Dlugosz
>> <2nb81l...@sneakemail.com> wrote:
>>   
>>> And APL calls it "|¨" (two little dots high up)
>>>     
>>
>> Mr. MacDonald just said upthread that the APL reduce metaoperator was
>> spelled "/".  As in:
>>
>>      +/1 2 3
>>  6
>>
>> So how does |¨ differ?
>>
>>
>>   
>
> Sorry, the two dots is APL's equivilent of the hyper operators, not the  
> reduction operators.  Easy to get those mixed up!
>
> For example, |1 2 3 ⍴¨ 10| would natively be written in Perl 6 as |10  
> »xx« (1,2,3)|.
>
> --John

Yes.  The full expression in raw APL for n! is:

*/<i>n

(where <i> is the Greek letter iota - <iota>n is Perl's 1..$n).

Like many things in APL, having a 3-character combination of raw
operators to provide a function makes creating a special operator
unnecessary.  (Although, if I recall correctly, there were also raw
operators for combinatorial pick and choose, and factorial(n) is
the same as choose(n,n) [or pick(n,n) whichever is the one the
considers the order of the returned list to be significant] and
factorial was actually returned if there was only one operand
provided.)

Reply via email to