Re: generic equivalence partition

2005-02-26 Thread Erik Max Francis
Xah Lee wrote: ... sorry for the latching on on this broadside issue, but it is impotant ... You made a typo in that last word there. Obviously you meant to write an _e_ instead of an _a_. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53

Re: generic equivalence partition

2005-02-26 Thread Xah Lee
People, ... sorry for the latching on on this broadside issue, but it is impotant ... here's are some germane points from another online discussion: the bug-reporting issue has came up so many times by so many people i thought i'd make a comment of my view. when a software is ostensibly incorre

Re: generic equivalence partition

2005-02-26 Thread Xah Lee
folks: when using google to post a reply, it sometimes truncates the subject line. i.e. [perl-python] is lost. This software error is obvious, they could not have not noticed it. another thing more egregious is that google _intentionally_ edit with people's posts. (e.g. they change email address

Re: generic equivalence partition

2005-02-26 Thread Xah Lee
# the following solution is submitted by # Sean Gugler and David Eppstein independently # 20050224. @def parti(aList, equalFunc): @result = [] @for i in range(len(aList)): @for s in result: @if equalFunc( aList[i], aList[s[0]] ): @s.append(i) @

Re: [perl-python] generic equivalence partition

2005-02-25 Thread Paul Moore
David Eppstein <[EMAIL PROTECTED]> writes: > In article <[EMAIL PROTECTED]>, > "Xah Lee" <[EMAIL PROTECTED]> wrote: > >> parti(aList, equalFunc) >> >> given a list aList of n elements, we want to return a list that is a >> range of numbers from 1 to n, partition by the predicate function of >> e

Re: [perl-python] generic equivalence partition

2005-02-24 Thread Michael Spencer
David Eppstein wrote: In article <[EMAIL PROTECTED]>, "Xah Lee" <[EMAIL PROTECTED]> wrote: given a list aList of n elements, we want to return a list that is a range of numbers from 1 to n, partition by the predicate function of equivalence equalFunc. In the worst case, this is going to have to

Re: [perl-python] generic equivalence partition

2005-02-24 Thread David Eppstein
In article <[EMAIL PROTECTED]>, David Eppstein <[EMAIL PROTECTED]> wrote: > def parti(aList,equalFunc): > eqv = [] > for i in range(len(aList)): > print i,eqv > for L in eqv: > if equalFunc(aList[i],aList[L[0]]): > L.append(i) >

Re: [perl-python] generic equivalence partition

2005-02-24 Thread David Eppstein
In article <[EMAIL PROTECTED]>, "Xah Lee" <[EMAIL PROTECTED]> wrote: > parti(aList, equalFunc) > > given a list aList of n elements, we want to return a list that is a > range of numbers from 1 to n, partition by the predicate function of > equivalence equalFunc. (a predicate function is a funct

Re: [perl-python] generic equivalence partition

2005-02-24 Thread John Machin
On Thu, 24 Feb 2005 17:48:47 -0800, Bryan <[EMAIL PROTECTED]> wrote: >Xah Lee wrote: >> another functional exercise with lists. >> >> Here's the perl documentation. I'll post a perl and the translated >> python version in 48 hours. >> >> =pod >> >> parti(aList, equalFunc) >> >> given a list aL

Re: [perl-python] generic equivalence partition

2005-02-24 Thread Bryan
Xah Lee wrote: another functional exercise with lists. Here's the perl documentation. I'll post a perl and the translated python version in 48 hours. =pod parti(aList, equalFunc) given a list aList of n elements, we want to return a list that is a range of numbers from 1 to n, partition by the pred

[perl-python] generic equivalence partition

2005-02-24 Thread Xah Lee
another functional exercise with lists. Here's the perl documentation. I'll post a perl and the translated python version in 48 hours. =pod parti(aList, equalFunc) given a list aList of n elements, we want to return a list that is a range of numbers from 1 to n, partition by the predicate funct