Re: PIZZA time again :-)

From: VC <boston103_at_hotmail.com>
Date: Fri, 2 Sep 2005 17:05:02 -0400
Message-ID: <yu6dnfeK2YHqI4XeRVn-rQ_at_comcast.com>


"mAsterdam" <mAsterdam_at_vrijdag.org> wrote in message news:4318b45c$0$11069$e4fe514c_at_news.xs4all.nl...

> vc wrote:
>> mAsterdam wrote:

>>>dawn wrote:
>>>>mAsterdam wrote:
>>>>
>>>>>>>Assume
>>>>>>>1. there is a meaningful (or at least consequential)
>>>>>>>difference between:
>>>>>>>
>>>>>>> toppings([salami, mozarella, onions]).
>>>>>>> and
>>>>>>> toppings([mozarella, onions, salami]).
>>>
>>>[snip]
>>>
>>>>>Consider
>>>>>
>>>>> merge(ListOfLists, MergedList).
>>>>>
>>>>>Now
>>>>>
>>>>>merge ([[salami, mozarella, onions][mozarella, onions, salami]], M).
>>>>>
>>>>>should fail because salami is before mozarella in the first list,
>>>>>and after it in the second. It can't preserve the order.
>>>>
>>>>I don't know how you define a merge when there isn't
>>>>an ordering defined on the type.
>>>>Is there such a function? Your lists are ordered here,
>>>>but your domain/type is not, unless you choose something
>>>>like alpha order.
>>>
>>>That is another way of asking the same question.
>>>What should 'merge' do when the order is not
>>>in the values (as it would be if we took the
>>>ordering defined on the type) but just in
>>>their position, relative to other values.
>>>It is what I'm trying to find out.
>>
>> Since 'merge' is commonly defined for lists with the same ordering, the
>> function cannot be applied to lists with different orderings,  e.g [a,
>> b] and [b,a,c] (ordering is defined by an element position in the list)
>> clearly cannot be merged.
>
> That is the merge as used in some sorting algorithms, not a merge
> in it's own right. But if you feel more comfortable calling the discussed 
> merge mymerge, truemerge, falsemerge or
> order_preserving_merge - ok.

That is the merge function as used in functional languages like ML, Haskell or Lisp (not pure functional). My response relied on the common usage in those languages.

Now, what is "a merge in its own right" ? Unless one defines 'merge_in_its_own_right', one cannot answer the question what 'merge_in_its_own_right' should do with lists where ordering is defined by an element position. Received on Fri Sep 02 2005 - 23:05:02 CEST

Original text of this message