| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: PIZZA time again :-)
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.
>
Perhaps it should do the same thing as a sort on a set where no ordering has been defined - ?
>> > both lists and yields a pizza with salami on it twice (I think I'll
> > I can imagine an interleave function that alternates ingredients from
>
I'd like plenty of mozarella, olives (black or green), tomatoes, and maybe even some pepperoni on either a whole wheat crust or a thin crust -- oh, and pineapple too. The ordering does make a difference, as does the city in which I'm eating the pizza -- in Chicago I'm OK with reversing the order and adding sausage to the pizza. I'm sitting in the biggest pork producing county in the U.S. right now and people order pizza with "swine" on it here.
I talked students through a pizza example from the Head Frist Design Patterns book last year -- a fun book for anyone wanting to teach or learn OO design patterns.
cheers! --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 - 15:29:09 CDT
![]() |
![]() |