Re: PIZZA time again :-)

From: dawn <dawnwolthuis_at_gmail.com>
Date: 2 Sep 2005 11:52:07 -0700
Message-ID: <1125687127.352684.178590_at_z14g2000cwz.googlegroups.com>


mAsterdam wrote:
> Paul wrote:
> > mAsterdam wrote:
> >
> >>Assume
> >>1. there is a meaningful (or at least consequential)
> >>difference between:
> >>
> >> toppings([salami, mozarella, onions]).
> >> and
> >> toppings([mozarella, onions, salami]).
> >
> > Of course there is. If you had the onions at the bottom, they would't
> > cook right, although as a BOM for billing, there's no problem.
>
> So, you agree assumption 1 has value. Good.
>
> 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.

I can imagine an interleave function that alternates ingredients from both lists and yields a pizza with salami on it twice (I think I'll pass on it, however). --dawn

>
> Should
>
> merge([[salami, buttonmushroom, mozarella, onions][salami, artichoke,
> mozarella]], M).
>
> succeed with
> M = [salami, buttonmushroom, artichoke, mozarella, onions]
> M = [salami, artichoke, buttonmushroom, mozarella, onions]
>
> or just the first one (because of the order of the lists)?
Received on Fri Sep 02 2005 - 20:52:07 CEST

Original text of this message