[erlang-questions] : queues (previously: documentation of data structures)

Raimo Niskanen raimo+erlang-questions@REDACTED
Wed Dec 12 17:02:47 CET 2007


On Tue, Dec 11, 2007 at 03:16:50PM +0100, Andras Georgy Bekes wrote:
> > The killing Con is that one process may keep a megabyte
> > in the queue making this queue performance excruciatingly
> > slow for all other processes due to repeating message
> > queue scans.
> You're right.
> 
> > I saw a bug in your code: myqueue:delete/1 dose not stop the queue
> > process.
> You too.
> I hacked that module in 2 minutes, so I'm happy with that bug :-)
> 
> > > - - add two elements at the begining of the queue
> > queue != dequeue.
> > > - - remove elements from the end of the queue
> > queue != dequeue, so this shouldn't necessarily be possible.
> Everybody is right.
> 
> The module I've written implements a queue. However, the queue module in 
> OTP implements a deque (only with funny function names). Probably this 
> is the source of confusion.
> 
> Anyways, queue:lait/1 should be liat/1 shouldn't it? Both in the doc and 
> impl. (It is the opposite of tail. The opposite of cons/2 is snoc/2, 
> the opposite of head/1 is daeh/1 but lists:reverse("tail") /= "lait").

Oh yes!!! I was tired when I wrote it, then self-blind, and nobody proofread.
If I get a reason to touch the module I will add liat/1, forget about
lait/1 but keep it around for backwards compatibility...

> 
> 	Georgy
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list