Re: [Pharo-users] Comparison for SequencableCollection

2015-08-03 Thread jtuc...@objektfabrik.de
Am 04.08.15 um 00:22 schrieb webwarrior: We're drifting too much into philosophy here. Meaning of this, meaning of that... Thanks. I'd love to be clever enough to be a philosopher. I'd argue there is no intrinsic meaning in statements such as "string A is less than string B". But it is usefu

Re: [Pharo-users] Comparison for SequencableCollection

2015-08-03 Thread Ben Coman
On Mon, Aug 3, 2015 at 12:04 AM, Peter Uhnák wrote: >> (a b c) = (b a c) if a = b >> >> (a b c) < (b a c) if a < b >> The semantics are well defined. A comparison between sequenceable collections compares each element in sequence. This makes intutive sense. > Since you mentioned JavaScript, you

Re: [Pharo-users] Comparison for SequencableCollection

2015-08-03 Thread webwarrior
We're drifting too much into philosophy here. Meaning of this, meaning of that... I'd argue there is no intrinsic meaning in statements such as "string A is less than string B". But it is useful to have order defined on set of words and character strings in general. Lexicographic order has some

Re: [Pharo-users] Comparison for SequencableCollection

2015-08-03 Thread jtuc...@objektfabrik.de
Am 02.08.15 um 15:23 schrieb webwarrior: On 02.08.2015 15:44, jtuchel [via Smalltalk] wrote: > I'd say it is questonable if SequenceableCollections should be > comparable by default. > > is (a b c) equal or lower than (b a c) ? > Doesn't this depend heavily on what is in the Collection and what

Re: [Pharo-users] Comparison for SequencableCollection

2015-08-02 Thread Joachim Tuchel
I think nobody's arguing that comparison of Collections is wrong per se. It's just that such an extension should not be part of the core libraries, or put differently, Smalltalk should not be extended in that direction, because the assumptions about what may or may not be the meaning of comparin

Re: [Pharo-users] Comparison for SequencableCollection

2015-08-02 Thread webwarrior
Your use case (comparing containers using pluggable comparison for items) is pretty common. And what I was suggesting won't solve that problem. However, it will make sequencable collections with comparable items comparable. That's it. If we have comparison defined for Point, why not have it fo

Re: [Pharo-users] Comparison for SequencableCollection

2015-08-02 Thread Peter Uhnák
On Sun, Aug 2, 2015 at 6:44 PM, webwarrior wrote: > > On 02.08.2015 19:02, Peter Uhnák [via Smalltalk] wrote: > > > (a b c) = (b a c) if a = b > > > > (a b c) < (b a c) if a < b > > The semantics are well defined. > > > > > > Since you mentioned JavaScript, you should know that you ca

Re: [Pharo-users] Comparison for SequencableCollection

2015-08-02 Thread webwarrior
On 02.08.2015 19:02, Peter Uhnák [via Smalltalk] wrote: > (a b c) = (b a c) if a = b > > (a b c) < (b a c) if a < b > The semantics are well defined. > > > Since you mentioned JavaScript, you should know that you can't compare > arrays with ==, because it does object comparison. > >

Re: [Pharo-users] Comparison for SequencableCollection

2015-08-02 Thread Peter Uhnák
> > (a b c) = (b a c) if a = b (a b c) < (b a c) if a < b > The semantics are well defined. Since you mentioned JavaScript, you should know that you can't compare arrays with ==, because it does object comparison. No. Sorted collection maintains order of its elements, and I'm talking > about or

Re: [Pharo-users] Comparison for SequencableCollection

2015-08-02 Thread Alexandre Bergel
> I'd say it is questonable if SequenceableCollections should be comparable by > default. +1 Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.

Re: [Pharo-users] Comparison for SequencableCollection

2015-08-02 Thread webwarrior
No. Sorted collection maintains order of its elements, and I'm talking about order on [the set of] sequencable collections On 02.08.2015 15:46, jtuchel [via Smalltalk] wrote: > Am 02.08.15 um 14:11 schrieb webwarrior: > > I was surprised when discovered that in Pharo comparison is not > defined

Re: [Pharo-users] Comparison for SequencableCollection

2015-08-02 Thread webwarrior
On 02.08.2015 15:44, jtuchel [via Smalltalk] wrote: > I'd say it is questonable if SequenceableCollections should be > comparable by default. > > is (a b c) equal or lower than (b a c) ? > Doesn't this depend heavily on what is in the Collection and what the > meaning of the Sequence of two Collec

Re: [Pharo-users] Comparison for SequencableCollection

2015-08-02 Thread jtuc...@objektfabrik.de
Am 02.08.15 um 14:11 schrieb webwarrior: I was surprised when discovered that in Pharo comparison is not defined for lists, arrays and similar datastructures. Because in almost every programming language (F#, Python, Javascript just to name few) you can compare lists, arrays, etc. By convention,

Re: [Pharo-users] Comparison for SequencableCollection

2015-08-02 Thread jtuc...@objektfabrik.de
I'd say it is questonable if SequenceableCollections should be comparable by default. is (a b c) equal or lower than (b a c) ? Doesn't this depend heavily on what is in the Collection and what the meaning of the Sequence of two Collections is? So I'd say there is not much use in putting compa

[Pharo-users] Comparison for SequencableCollection

2015-08-02 Thread webwarrior
I was surprised when discovered that in Pharo comparison is not defined for lists, arrays and similar datastructures. Because in almost every programming language (F#, Python, Javascript just to name few) you can compare lists, arrays, etc. By convention, the ordering is lexicographical, just like