Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 28 Feb 2013 02:53:09 -0600 Date: Thu, 28 Feb 2013 08:53:08 +0000 From: lipska the kat <"nospam at neversurrender dot co dot uk"> Organization: Trollbusters 3 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120410 Thunderbird/11.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: BlueJ don't know what i did wrong References: <638ed624-9eba-44eb-bcbf-68466e5bb5f1@googlegroups.com> <42d76fca-d365-4030-ae8c-07a806eab87c@googlegroups.com> <1wtai7dd80h80$.6rbtwoyou3gh.dlg@40tude.net> <5q6dnc3pF_HJzLfMnZ2dnUVZ7s-dnZ2d@bt.com> <77afaabf-ec0f-46d6-b3ea-d8f186dbf7e4@googlegroups.com> <512c2745$0$289$14726298@news.sunsite.dk> <3a2dnXBuTbOY4rHMnZ2dnUVZ8iWdnZ2d@bt.com> <0I%Ws.96474$Ln.24770@newsfe22.iad> <672dncokKZ13AbHMnZ2dnUVZ8oadnZ2d@bt.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 56 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-5OLp14x/fUlUCTE4HbAKQsHlA+htbQYTldltXrr5udLMeVJvNR2r0Xx3iqKD2v+tJdOOIyNnUK6pNKn!YLV2clbKcE0DZDXU7ZudfhzI1knCrwYhNzfN0k1jRNDq5eF3J0x7o6yT07YqLbXm0uUyxXtzu28= X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3930 Xref: csiph.com comp.lang.java.programmer:22610 On 28/02/13 02:40, Arved Sandstrom wrote: > On 02/27/2013 08:24 AM, lipska the kat wrote: >> On 27/02/13 10:45, Arved Sandstrom wrote: >>> On 02/26/2013 07:30 AM, lipska the kat wrote: >>>> On 26/02/13 09:59, Arved Sandstrom wrote: >>>>> On 02/26/2013 05:23 AM, lipska the kat wrote: [snip] > I'm happy with the definition that for example Knuth or Sedgwick use > (and about a million other people), where a deque is called a > generalization of a queue or a stack. The reason a deque is called a > generalization of a queue or a stack is because it is in fact more > general than a queue or a stack, and combines features of both. > > Since a whole raft of CS authorities and other programming commentators > are happy to call the deque a generalization of a queue or stack when > writing about data structures, I'm pretty happy to accept this as a > definition. Yep, I agree, my stubborn determination to prove you wrong about this issue clouded my judgment. On this I concede. I am human, I am imperfect, I make mistakes. However I simply cannot agree with your assertion that "a deque is not a queue, but a queue is a deque." Enter the following into your favorite IDE java.util.Queue queue = null; java.util.Deque deque = null; queue = deque; //This compiles: Because we can store a reference to a Deque into a //reference to a Queue, a Deque *is a* Queue deque = queue; //This does not compile: Because we can't store a reference //to a Queue into a reference to a Deque, a Queue *is not* a Deque If a Queue were a Deque then we could call Deque methods on a Queue Can we call Deque methods on a Queue? well I can't, can you? I'd be interested to hear your thoughts on this. lipska -- Lipska the Kat©: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun