From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/44039 Path: main.gmane.org!not-for-mail From: prj@po.cwru.edu (Paul Jarc) Newsgroups: gmane.emacs.gnus.general Subject: Re: where does this belong? Date: Wed, 27 Mar 2002 11:06:28 -0500 Organization: What did you have in mind? A short, blunt, human pyramid? Sender: owner-ding@hpc.uh.edu Message-ID: References: <87k7rypaoi.fsf@inanna.rimspace.net> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1017245284 24291 127.0.0.1 (27 Mar 2002 16:08:04 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 27 Mar 2002 16:08:04 +0000 (UTC) Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16qFy0-0006Ja-00 for ; Wed, 27 Mar 2002 17:08:04 +0100 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 16qFwm-0002Bi-00; Wed, 27 Mar 2002 10:06:48 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 27 Mar 2002 10:06:54 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id KAA06117 for ; Wed, 27 Mar 2002 10:06:42 -0600 (CST) Original-Received: (qmail 27097 invoked by alias); 27 Mar 2002 16:06:31 -0000 Original-Received: (qmail 27092 invoked from network); 27 Mar 2002 16:06:31 -0000 Original-Received: from multivac.student.cwru.edu (HELO multivac.cwru.edu) (qmailr@129.22.96.25) by gnus.org with SMTP; 27 Mar 2002 16:06:31 -0000 Original-Received: (qmail 29580 invoked by uid 500); 27 Mar 2002 16:06:52 -0000 Original-To: ding@gnus.org In-Reply-To: <87k7rypaoi.fsf@inanna.rimspace.net> (Daniel Pittman's message of "Wed, 27 Mar 2002 21:27:57 +1100") Mail-Copies-To: nobody Mail-Followup-To: ding@gnus.org Original-Lines: 38 User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/20.7 (i386-redhat-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:44039 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:44039 Daniel Pittman wrote: > I agree with Kai -- the right place for this is the `cl' package, > because I can't see the difference between this and the `defstruct' > routine... Well, the most significant difference is that I didn't know about cl's defstruct. :) Now that I do, I see that mine is much smaller: (defmacro nnmaildir--defstruct (name members) "Defines NAME-new, NAME-get-MEMBER, and NAME-set-MEMBER macros." (let ((index 0) (namesym name) member) (setq name (symbol-name namesym)) (eval `(defmacro ,(intern (concat name "-new")) () ,(concat "Creates a new \"" name "\" structure.") '(make-vector ,(length members) nil))) (mapcar (lambda (membersym) (setq member (symbol-name membersym)) (eval `(defmacro ,(intern (concat name "-get-" member)) (,namesym) ,(concat "Returns the \"" member "\" member of a \"" name "\" structure.") (list 'aref ,namesym ,index))) (eval `(defmacro ,(intern (concat name "-set-" member)) (,namesym ,membersym) ,(concat "Sets the \"" member "\" member of a \"" name "\" structure.") (list 'aset ,namesym ,index ,membersym))) (setq index (1+ index))) members) nil)) But I don't think I understand what the cl defstruct does, exactly. Can someone point me to an example use? paul