Re: [Pharo-dev] powerSet

2015-10-24 Thread stepharo
We tried to port this code to python and I learned that we cannot have a set containing a set :( and other uglies like len(str) but not str.len() Stef Le 22/10/15 22:58, stepharo a écrit : Hi I was programming an exercise with one of my son (well in Python arghh) and I end it up

Re: [Pharo-dev] powerSet

2015-10-23 Thread Stephan Eggermont
On 22-10-15 23:25, Ferlicot D. Cyril wrote: Want would be the uses of this method? Show how to run out of memory real quickly? Demonstrate why you want generators? Stephan

Re: [Pharo-dev] powerSet

2015-10-23 Thread Cédrick Béler
Hi all, just bouncing on this subject as we had this interesting discussions some time ago: http://forum.world.st/Another-extension-proposal-gt-subsets-td107678.html Cheers, Cédrick

Re: [Pharo-dev] powerSet

2015-10-23 Thread monty
ro <steph...@free.fr> > To: "Pharo Development List" <pharo-dev@lists.pharo.org> > Subject: [Pharo-dev] powerSet > > Hi > > I was programming an exercise with one of my son (well in Python > arghh) > and I end it up doing it in Pharo

Re: [Pharo-dev] powerSet

2015-10-23 Thread Nicolas Cellier
Sent: Thursday, October 22, 2015 at 4:58 PM > > From: stepharo <steph...@free.fr> > > To: "Pharo Development List" <pharo-dev@lists.pharo.org> > > Subject: [Pharo-dev] powerSet > > > > Hi > > > > I was programming an exerci

Re: [Pharo-dev] powerSet

2015-10-23 Thread stepharo
Hi, I propose a simpler implementation: 4 in: [ :e | (1 to: e) combinations ] ;) I'm do not think that my son is allowed to use combination in python too. did you check the implementation of combinations :)? Stef Vincent Le 2015-10-22 23:25, Ferlicot D. Cyril a écrit : Le 22/10/2015

Re: [Pharo-dev] powerSet

2015-10-23 Thread stepharo
Hi, Want would be the uses of this method? Apparently this is something really common on sets, you get all the subparts combinations. Stef

Re: [Pharo-dev] powerSet

2015-10-23 Thread Sven Van Caekenberghe
> On 23 Oct 2015, at 09:41, stepharo wrote: > >> Hi, >> >> Want would be the uses of this method? > > Apparently this is something really common on sets, you get all the subparts > combinations. > > Stef https://en.wikipedia.org/wiki/Power_set The empty set should

[Pharo-dev] powerSet

2015-10-22 Thread stepharo
Hi I was programming an exercise with one of my son (well in Python arghh) and I end it up doing it in Pharo (I'm save now). The idea was to write one function that computes the powerset powerset(4) = a Set(a Set(1) a Set(1 2) a Set(3) a Set(2) a Set(1 3) a Set(2 3) a Set(1 2 3)

Re: [Pharo-dev] powerSet

2015-10-22 Thread vincent.blondeau
Hi, I propose a simpler implementation: 4 in: [ :e | (1 to: e) combinations ] Vincent Le 2015-10-22 23:25, Ferlicot D. Cyril a écrit : Le 22/10/2015 22:58, stepharo a écrit : Hi I was programming an exercise with one of my son (well in Python arghh) and I end it up doing it in Pharo