From owner-cvs-all Thu Jan 3 15: 8:50 2002 Delivered-To: cvs-all@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.22.40]) by hub.freebsd.org (Postfix) with ESMTP id 7867837B416; Thu, 3 Jan 2002 15:08:46 -0800 (PST) Received: from [128.113.24.47] (gilead.acs.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.11.3/8.11.3) with ESMTP id g03N8cC82082; Thu, 3 Jan 2002 18:08:38 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: References: Date: Thu, 3 Jan 2002 18:08:37 -0500 To: Julian Elischer , Matthew Dillon From: Garance A Drosihn Subject: Re: cvs commit: src/share/man/man3 queue.3 Cc: Poul-Henning Kamp , Stephen McKay , John Baldwin , cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, Greg Lehey Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: MIMEDefang 2.1 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At 5:53 PM -0500 1/3/02, Garance A Drosihn wrote: >At 2:00 PM -0800 1/3/02, Julian Elischer wrote: >>We are arguing about TAILQ_FOREACH not CIRCLEQ_FOREACH (Which phk >>deleted anyhow) > >Perhaps another way to address this is to provide another set of >BLAHQ_* macros, which would do exactly what you want (with the absolute >optimal performance characteristics for TAILQ), but write one for each >kind of queue. That way, people could change TAILQ_DIDNT_DO_EACH() to >COOLERQ_DIDNT_DO_EACH(), and if there was no such macro then they'd have >a very large flag telling them to look closer at that section of code. >The problem with your suggestion, as it stands right now, is that you >are writing code which is specific to one kind of queue, but you are >not "hiding" that in a BLAHQ_* macro. While this solution would work >for me, I'll admit that I haven't the slightest idea of a good name for >that macro... Consider, for instance, the TAILQ_FOREACH_REVERSE() macro. It only exists for TAILQ. If I change from a TAILQ to an STAILQ, I will get a compile-time error because there is no STAILQ_FOREACH_REVERSE() macro. If developers have used the queue.h macros correctly, then someone can "almost blindly" change from a TAILQ to an STAILQ, and they don't have to look at every loop in the code to see if someone "Just happened to know" the internals of how to go backwards thru one specific type of queue. *Documenting* how to go backwards for a tailq in the man page is not an appropriate solution, because the result is a bunch of loose C code which is breaking the abstraction of "a generic queue". -- Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message