From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Abou Samra Newsgroups: gmane.lisp.guile.devel Subject: Re: Feature request: Ability to document variables like defvar in elisp Date: Wed, 2 Nov 2022 09:28:35 +0100 Message-ID: <890c5ce4-8191-54a6-dcd3-3c4b0f846415@abou-samra.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9626"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 To: Jacob Hrbek , "guile-devel@gnu.org" Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed Nov 02 09:29:03 2022 Return-path: Envelope-to: guile-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 1oq97P-0002OP-3R for guile-devel@m.gmane-mx.org; Wed, 02 Nov 2022 09:29:03 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oq977-0007vF-0A; Wed, 02 Nov 2022 04:28:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oq974-0007ur-TZ for guile-devel@gnu.org; Wed, 02 Nov 2022 04:28:42 -0400 Original-Received: from mout.kundenserver.de ([212.227.126.134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oq973-0004nM-6e for guile-devel@gnu.org; Wed, 02 Nov 2022 04:28:42 -0400 Original-Received: from [172.20.10.5] ([37.169.130.64]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.168]) with ESMTPSA (Nemesis) id 1N3Gok-1oyZ8x15ik-010PbM; Wed, 02 Nov 2022 09:28:37 +0100 Content-Language: en-US In-Reply-To: X-Provags-ID: V03:K1:TFi8/bDv11xo9Vl03o8UVBF0Toz9qgDvJTx0xpKobPgp4WzRjFA A25rRHJXymttTiXpDEtILEJGhJxE+ozB0ChnStvQzjDcTUYs3pB3L/t8yA9+uIcbbI+P7qw t5SgO2RYcvqgjCgfJCvBKzltgULVrv766+ybmWd5Tf29bJOitu1hQYxgRolsi7YFFbvCWZP jn0hR6iishvK1BwMuTuBg== X-UI-Out-Filterresults: notjunk:1;V03:K0:fMbFPytIxwQ=:mMjtbUCS59BRTY7EAzqsvu 2M0suwcO0QdKjIZEl1I8BDt6EwWeSZmqQfkt3SbKINGoHA4cO5gdP0oNBBcwZNBc2+75hF+YE s+d3IXM5nDySjzIhItqtz/UbgiO9DEJ8M+xLi5z4mZaGB5GruIevWS8r5wdsLRICWL9ZT5Tuc TN7aJUNFOR9ghE3jB+IPvi/Q5W+y4qaz2H/GKt91fIrUo+u1h4YAGc1VJqwj5GaXnOGfeHQH1 WdZPWeWKjD79sId3AaRezRTbZVqDHlDVsf1TP1hbD0deDm2bIeKKuS77Z8AjOa8/T6CYwyEEq GwgqFgFVwYGHz2y3Hz9PVrJ2d2EtzkMWc3OV2allXcd2Lnouo9kqZ4l1v3Mst3qVs5ScBlnxG Lm1XPjUKhGx84SWdonVj25EmEGjK+tmc6YEH2kCqBfmV2jUycM1b1BIDI+BOnFc1LF0ck+oXR vtZKjU6lnMnHcW7SRtH44dz9WF/SH5JdptWDwvMCaory2655SSmzhrs+TAGaQGDBG+gcRXeqc 3jR4NNo5cK6vkvAVzpIheDln4wEp+Q5Nz2n5JHqfv3ZigVwBF8ubQNqUjEadeLUiV0/cfC57r kuiXfA58OUVYrqHSZxbIP2mETqTvwdau5sXqa/3aZ1RXTMjVcfqy9IY7Q0G8Jxfl20OtpdpuA Ao+ujbeuYdSdKBgJkS7az9u4tai7JmtySXHNyMShDg1kgSVeJccANDK2y60D9mkIU6Y+DhPN0 IQ6xep720rwSFnYqC6ox8rDOl/0FCj52urph2EnzzbqaNfZ9wzkRcEMFG6Zv2PLSMQfo7EeC Received-SPF: none client-ip=212.227.126.134; envelope-from=jean@abou-samra.fr; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "guile-devel" Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:21460 Archived-At: Le 02/11/2022 à 02:08, Jacob Hrbek a écrit : > The ability to document variables is critical for many projects such > as libfive where the variables is used to declares functional computer > aided design structure and other projects where variables influence > the workflow. > > Thus proposing to change the 'define' behavior for variables to implement: > >     (define variable default-value docstring) >                                                    ^^^^^^ > > Where docstring is optional and in case it's provided to call for example: > > (set-procedure-property! variable 'documentation docstring) The problem is that in Scheme, you cannot attach metadata to immediate values. According to the Scheme standards and the Guile documentation, (define a 5) (define b 5) (eq? a b) => may be #t or #f (eq? a a) => may be #t or #f So it's considerably more complicated than using an object property, because that would not work reliably for variables defined to immediates like numbers and characters. Instead you would need to attach the metadata to the name you're defining the variable to, like Elisp does, but unlike Guile does with procedures right now, and it's not as simple in Scheme due to lexical scoping. Best, Jean