From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#14278: 24.3.50; doc of `defstruct' Date: Sat, 21 Aug 2021 16:50:24 +0200 Message-ID: <8735r226of.fsf@gnus.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24020"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 14278@debbugs.gnu.org To: "Drew Adams" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 21 16:51:22 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mHSLB-0005v7-TU for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Aug 2021 16:51:21 +0200 Original-Received: from localhost ([::1]:55790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mHSLA-0004mq-I3 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Aug 2021 10:51:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHSKt-0004kY-5W for bug-gnu-emacs@gnu.org; Sat, 21 Aug 2021 10:51:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54362) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mHSKs-0008E3-SA for bug-gnu-emacs@gnu.org; Sat, 21 Aug 2021 10:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mHSKs-0002CX-GU for bug-gnu-emacs@gnu.org; Sat, 21 Aug 2021 10:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Aug 2021 14:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14278 X-GNU-PR-Package: emacs Original-Received: via spool by 14278-submit@debbugs.gnu.org id=B14278.16295574378413 (code B ref 14278); Sat, 21 Aug 2021 14:51:02 +0000 Original-Received: (at 14278) by debbugs.gnu.org; 21 Aug 2021 14:50:37 +0000 Original-Received: from localhost ([127.0.0.1]:37672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHSKT-0002Ba-7R for submit@debbugs.gnu.org; Sat, 21 Aug 2021 10:50:37 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:45698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHSKR-0002BG-PC for 14278@debbugs.gnu.org; Sat, 21 Aug 2021 10:50:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=2FkZpmlLQ79WFy9nrxdLWaDhx+BjuFex7u5FN5CRTK4=; b=XRtz7P4wN4gocTeRhtO7pPFQVC ElpDryK3kV8D0yMS9etRv/aevzD2hwCVmFcBrvTQ+snPBB5tekHZd3Ua+N7tsr9qa33pmKIhE1/av cLCFFcvD73cg616k8MIZlbig68s9rE/qygbiXuZwFzC+B3YZv/kNrTr0m3pzye7sSRhA=; Original-Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mHSKG-00040V-V2; Sat, 21 Aug 2021 16:50:29 +0200 In-Reply-To: (Drew Adams's message of "Fri, 26 Apr 2013 13:00:51 -0700") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:212364 Archived-At: "Drew Adams" writes: > The doc string says "Each SLOT may instead..." - instead of what? It > forgets to say that a slot can be a symbol. Now fixed. "Drew Adams" writes: > 1. The manual says that each element of SLOT, if not a symbol, is a list > (SLOT-NAME DEFAULT-VALUE SLOT-OPTIONS...). But the doc string says it is (SLOT > SLOT-OPTS...), forgetting DEFAULT-VALUE altogether. This was already fixed. > 2. The manual does not say what each element of SLOT-OPTIONS is. The > doc string at least says that SLOT-OPTS is a list of key value pairs. > Both manual and doc string would be better off saying that > SLOT-OPT[ION]S is a plist, and describe what the keys and values of > the plist can be. This was fixed in 2019. > 3. The same problems reported originally for SLOTS exist also for NAME. It > speaks of OPTION without giving that term any relation to OPTIONS. I think that's clear enough. > 4. The doc string does not say that NAME can be a symbol. Fixed now. > The manual says that NAME can be a list of a symbol followed by > "struct options" (it should presumably say "structure options", since > that is the term used elsewhere in the node). Ditto. > But the manual does not say that a structure option here is either a > KEYWORD or a pair (KEYWORD VALUE). In this case the doc string is > more complete (assuming it is correct here) - the manual provides no > help with this. Already fixed. > 5. It is misleading and confusing to write "NAME may instead take the > form (NAME OPTIONS...)". That sounds like a recursive definition, > allowing for, say, NAME to be (foo (foo (foo ...) bar))). Use two > different names: NAME and NAME1 or something, else it is impossible to > know when you are referring to the parameter and when you are > referring to one of its parts. I think this is clear enough as is. "Drew Adams" writes: > 6. The manual says "(The SLOTS may begin with a string which documents the > structure type.)". The doc string says nothing about this. Fixed now. > 7. Does this mean that SLOTS can begin with a string or each element of SLOTS > (each slot) can begin with a string? (Another problem with trying to make > "SLOTS" do double-duty in the doc. Clarified. > 9. The doc should say, if it is true (as in Common Lisp), that no part of the > defstruct options is evaluated (unlike the case for SLOTS). I don't think that there's any confusion possible here. "Drew Adams" writes: > 10. It is not a good idea to use as the illustrative example one that has a slot > named "name". So much possible confusion with parameter NAME, etc. > > In the simplest case, NAME and each of the SLOTS are symbols. > ^^^^ > For example, > > (cl-defstruct person name age sex) > ^^^^ True; I've adjusted the examples now. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no