From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: New lisp library -- cell.el Date: Fri, 28 Feb 2020 22:30:47 -0500 Message-ID: References: <875zfqejtm.wl-all_but_last@163.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="21046"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Zhu Zihao Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 29 04:31:37 2020 Return-path: Envelope-to: ged-emacs-devel@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 1j7sqn-0005Nn-8f for ged-emacs-devel@m.gmane-mx.org; Sat, 29 Feb 2020 04:31:37 +0100 Original-Received: from localhost ([::1]:56842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7sqm-0005Kj-AO for ged-emacs-devel@m.gmane-mx.org; Fri, 28 Feb 2020 22:31:36 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48146) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7sqI-0004uI-1r for emacs-devel@gnu.org; Fri, 28 Feb 2020 22:31:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7sqG-0000kX-F1 for emacs-devel@gnu.org; Fri, 28 Feb 2020 22:31:05 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:20451) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j7sqG-0000kE-90 for emacs-devel@gnu.org; Fri, 28 Feb 2020 22:31:04 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 1DC6744EECB; Fri, 28 Feb 2020 22:31:03 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 4F9BD44EEA5; Fri, 28 Feb 2020 22:31:01 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1582947061; bh=G5X6lxdsWXTrq2z+ChPrIKV0tNnPBqfbHsveXeiJKco=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=TifGmv0VTeSm0uOrzQeFCDjc8Y3jUebEQRIegJ6gi4MnqOyCw6P2jcgpwSYW+U742 yjBwzFiCoAWqSgJCQtr6DLxrvDiO6mrbZxGsxIHoqvPQB5mhw4ut1CQ6ZshKdDP/yN eICQPL1u9c6egPtREJtN5fJMi4A84qEQYqVTpbqFpjdWkTj6dnKaeW9icIspmvG2fV ARAsnXg0c2dGJt2B2u9+frBYjcQHMtww2AA5iJ2rQSCcZMFfrlyX4VyiX8qbWttnpF QgFhN6WsptIA1T+QbS5Ob0u9E5v30pTNl7X/Jk53bx1UGwrVpEILRL/bGXfNgmutc7 T5a7gqk1SknBQ== Original-Received: from pastel (unknown [216.154.50.221]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B7EF11203B6; Fri, 28 Feb 2020 22:31:00 -0500 (EST) In-Reply-To: <875zfqejtm.wl-all_but_last@163.com> (Zhu Zihao's message of "Sat, 29 Feb 2020 00:51:49 +0800") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:245116 Archived-At: > I tend to keep None variant a singleton of cell-option. nil is over-overloaded > in Lisp programming. For example, if we want to store a nullable value in the > slot of cl-struct and we use nil as none. It's hard to differentiate "Slot is > unintialized" and "Slot is initialized with None". The problem here is the concept of uninitialized. Always arrange your constructors to initialize all fields and the problem disappears. >> Why bother with those indirections? > Docstring generated by `cl-defstruct` may not suitable for us. An alias to make > a meaningful doc. Ah, that makes sense. You might like to put a short comment to explain it. > Or should we use (put 'cell-box-inner 'function-documentation ".....")? I think that would be worse. Stefan