Re: [Pharo-project] About Dictionary #at:ifAbsentPut:

2011-10-05 Thread Henrik Sperre Johansen
On 05.10.2011 01:59, Nicolas Cellier wrote: 2011/10/5 Michael Robertsm...@mjr104.co.uk: I find the thread a bit confused in the sense Dictionary *new* at: x ifAbsentPut: y does not make sense (is academic), because the new dictionary will never have x as a key. So why profile it and use that

Re: [Pharo-project] About Dictionary #at:ifAbsentPut:

2011-10-05 Thread Henrik Sperre Johansen
On 05.10.2011 11:19, Henrik Sperre Johansen wrote: On 05.10.2011 01:59, Nicolas Cellier wrote: However, maybe Mariano is searching for tight inner loop optimization (we can only guess, because he didn't tell, he should have). In this case, using ifFalse: is good: because it is inlined by

Re: [Pharo-project] About Dictionary #at:ifAbsentPut:

2011-10-05 Thread Philippe Marschall
On 10/04/2011 12:52 PM, Mariano Martinez Peck wrote: Hi guys. If I tell you the selector is Dictionary #at:ifAbsentPut: what would you expect the second parameter to be? A block of course, like #at:ifAbsent: Cheers Philippe

Re: [Pharo-project] About Dictionary #at:ifAbsentPut:

2011-10-05 Thread Camillo Bruni
Partly off topic: use http://www.squeaksource.com/SMark.html for your benchmarks! it's as easy as writing unit tests :) best cami On 2011-10-05, at 11:27, Henrik Sperre Johansen wrote: On 05.10.2011 11:19, Henrik Sperre Johansen wrote: On 05.10.2011 01:59, Nicolas Cellier wrote: However,

[Pharo-project] About Dictionary #at:ifAbsentPut:

2011-10-04 Thread Mariano Martinez Peck
Hi guys. If I tell you the selector is Dictionary #at:ifAbsentPut: what would you expect the second parameter to be? the value. So, one would do: Dictionary new at: #foo ifAbsentPut: 4 But if you see Dictionary at: key ifAbsentPut: aBlock Return the value at the given key. If key is

Re: [Pharo-project] About Dictionary #at:ifAbsentPut:

2011-10-04 Thread Sven Van Caekenberghe
On 04 Oct 2011, at 12:52, Mariano Martinez Peck wrote: Hi guys. If I tell you the selector is Dictionary #at:ifAbsentPut: what would you expect the second parameter to be? the value. So, one would do: Dictionary new at: #foo ifAbsentPut: 4 But if you see Dictionary at: key

Re: [Pharo-project] About Dictionary #at:ifAbsentPut:

2011-10-04 Thread Mariano Martinez Peck
On Tue, Oct 4, 2011 at 1:08 PM, Sven Van Caekenberghe s...@beta9.be wrote: On 04 Oct 2011, at 12:52, Mariano Martinez Peck wrote: Hi guys. If I tell you the selector is Dictionary #at:ifAbsentPut: what would you expect the second parameter to be? the value. So, one would do:

Re: [Pharo-project] About Dictionary #at:ifAbsentPut:

2011-10-04 Thread Norbert Hartl
Am 04.10.2011 um 13:33 schrieb Mariano Martinez Peck: On Tue, Oct 4, 2011 at 1:08 PM, Sven Van Caekenberghe s...@beta9.be wrote: On 04 Oct 2011, at 12:52, Mariano Martinez Peck wrote: Hi guys. If I tell you the selector is Dictionary #at:ifAbsentPut: what would you expect the

Re: [Pharo-project] About Dictionary #at:ifAbsentPut:

2011-10-04 Thread Schwab,Wilhelm K
-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] About Dictionary #at:ifAbsentPut: On 04 Oct 2011, at 12:52, Mariano Martinez Peck wrote: Hi guys. If I tell you the selector is Dictionary #at:ifAbsentPut: what would you expect the second parameter to be? the value. So, one would do

Re: [Pharo-project] About Dictionary #at:ifAbsentPut:

2011-10-04 Thread Henrik Sperre Johansen
On 04.10.2011 12:52, Mariano Martinez Peck wrote: Hi guys. If I tell you the selector is Dictionary #at:ifAbsentPut: what would you expect the second parameter to be? the value. So, one would do: Dictionary new at: #foo ifAbsentPut: 4 But if you see Dictionary at: key ifAbsentPut: aBlock

Re: [Pharo-project] About Dictionary #at:ifAbsentPut:

2011-10-04 Thread Michael Roberts
I find the thread a bit confused in the sense Dictionary *new* at: x ifAbsentPut: y does not make sense (is academic), because the new dictionary will never have x as a key. So why profile it and use that as reasoning?... whereas myDict at:x ifAbsentPut: y is more interesting. In my

Re: [Pharo-project] About Dictionary #at:ifAbsentPut:

2011-10-04 Thread Nicolas Cellier
2011/10/5 Michael Roberts m...@mjr104.co.uk: I find the thread a bit confused in the sense Dictionary *new* at: x ifAbsentPut: y does not make sense (is academic), because the new dictionary will never have x as a key. So why profile it and use that as reasoning?... whereas myDict at:x

Re: [Pharo-project] About Dictionary #at:ifAbsentPut:

2011-10-04 Thread Nicolas Cellier
2011/10/5 Nicolas Cellier nicolas.cellier.aka.n...@gmail.com: 2011/10/5 Michael Roberts m...@mjr104.co.uk: I find the thread a bit confused in the sense Dictionary *new* at: x ifAbsentPut: y does not make sense (is academic), because the new dictionary will never have x as a key. So why

Re: [Pharo-project] About Dictionary #at:ifAbsentPut:

2011-10-04 Thread Nicolas Cellier
2011/10/5 Nicolas Cellier nicolas.cellier.aka.n...@gmail.com: 2011/10/5 Michael Roberts m...@mjr104.co.uk: I find the thread a bit confused in the sense Dictionary *new* at: x ifAbsentPut: y does not make sense (is academic), because the new dictionary will never have x as a key. So why