On Sat, Aug 1, 2009 at 12:01 PM, Tracy Harms<[email protected]> wrote:
> On Sat, Aug 1, 2009 at 4:20 AM, Raul Miller<[email protected]> wrote:
>> The problem is the traditional leading zero which
>> we get from #: instead of a mathematically
>> consistent empty list  of bits.
>>
>
> The problem looks to me, instead, that copy is sensitive to the axes
> of the zero it receives when the argument to powerSet is empty.
>
>   '' # 1 1$0
> |length error
> |   ''    #1 1$0

No, I am using #~

>   ec=: 0:`] @. (1<#)
>   powerSet=: <@#~ ec@(2#:@i...@^#)

   #$powerSet ''
0
   #$powerSet 'abc'
1

Your special case does not produce a list of sets.

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to