From unknown Tue Jun 17 22:22:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#50068: Curried definitions lose docstrings Resent-From: Jean Abou Samra Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 15 Aug 2021 10:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50068 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 50068@debbugs.gnu.org X-Debbugs-Original-To: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16290224184481 (code B ref -1); Sun, 15 Aug 2021 10:14:02 +0000 Received: (at submit) by debbugs.gnu.org; 15 Aug 2021 10:13:38 +0000 Received: from localhost ([127.0.0.1]:45787 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFD98-0001AD-8r for submit@debbugs.gnu.org; Sun, 15 Aug 2021 06:13:38 -0400 Received: from lists.gnu.org ([209.51.188.17]:59216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFD94-0001A4-I5 for submit@debbugs.gnu.org; Sun, 15 Aug 2021 06:13:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33440) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mFD94-0004OU-4o for bug-guile@gnu.org; Sun, 15 Aug 2021 06:13:34 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:51361) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mFD92-0007fy-JK for bug-guile@gnu.org; Sun, 15 Aug 2021 06:13:33 -0400 Received: from [192.168.1.130] ([82.65.251.18]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.184]) with ESMTPSA (Nemesis) id 1MnqbU-1mqzsh2Bly-00pM5X for ; Sun, 15 Aug 2021 12:13:29 +0200 From: Jean Abou Samra Message-ID: <531f2e17-3f13-4610-5238-17ff94a2b3fd@abou-samra.fr> Date: Sun, 15 Aug 2021 12:13:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Provags-ID: V03:K1:5vYNwng4Z8KrsiY8MVHaSy0kr+SH5l75ayCsgl+zHgq4bhNWp3h 9LEzFG3ormUTLy1ZogQ/AxhYgs9aks6UoAB6OmqmUbTht5QI1BYvzyWGlnJ8DPVJxQo5G6+ YQpQ7E18GdbWIP7QHdlJW6ynAm/Qf0PsLLU3XSgRjHeBWpiumFWYy1LZ8m5V8v52FIRmaad Bh6UMECOOZToLAy/fwV2Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:AezmCsXvQrs=:K3JAgOqMZ+30QTIaKR18S0 OVzSpxi8nVX27gRQw/hEu6FQTlNgZDBaKj8AyGjmPieBhUzDI203yHBQQ66BDiYHTkfy2JbWn 3QqEz3pJrFH3Glmd/p48yNwlGYJWX9SQ1G4Gzwb630gvOCimr3s/yANQ3xmQXljqOjS12Yyrd +j0wy1rJ5geaB6QrRrupmTqwrwefJj7Xi7lJElx8tQtQsdjWRhkvvs4MJflAu728gEPKMpYUx ++IYUbalwrncg51/cbGW2/vCDolDIyAvr9xtktdw0BjcavKsVP81EZtYAmVE5nFD8BCYw7YKU QrCA5cPQs4VkNLHozxtf4QdlULCYY8h7ngsO060TE9ztegHL+7FhYlZkyfxRV6S62J3cq8OG1 kvEa1ey3455vuTFHq+73u2Kmpxz+fGEkRfaFxqFEohRrlGS35l/W4G7r4sFw0IiFxhFZoQxVJ MhekNsTLJWGbrUBQn2RkwcRLul4AjzdYL3R2T+dAeI8Nh1e7CK8k2WwgZgVoOBl6QqXL0lLqQ 1acbluPHpv9gveY9E9BZQPzNKAa+6AZkrjM/vxGhcFrW2+7azIbDP5ZzT+Zj59ap4fm8Ykj6U 0whzrhnMYsYno1H/6pCejIoCYwT9Y6qMcgm1+M2fzNzSjthrxK9s/ra/HE1ki/CxlN4BJdlWn H9TU1dM60m+nLf/WV4EIQT6nDPnPLK6ni2jjfYFKbQZN54bUx8tgH8fej+oxgWzWwBJOqeoyu BKofEpGLXDNW7VOtp4Ij3d539eid6jpFLL7vH5UqCdUp0dXwzJbXjDr9TCbH3b0WUkchwbWwm XsNBNt+8vXwEiN1LzF8CVxHu2l/Zkh5wWmDKyEIi2tDDb6x7jmbz7JtfEagngLZTYfT8X3b Received-SPF: none client-ip=212.227.17.10; 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, 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-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) When a docstring is used in the body of a curried definition, it ends up on the result of the application of the resulting curried function, not on the function itself. Example: (use-modules (ice-9 curried-definitions)) (define ((curried a) b)   "Docstring of curried"   'whatever) (procedure-documentation curried) => #f (procedure-documentation (curried 'whatnot)) => "Docstring of curried" This is apparently because Guile translates (define ((curried a) b)   ...) to (define (curried a)   (lambda (b)     ...)) which puts the docstring in the body of lambda. Tested with Guile 2.2 and 3.0.5. From unknown Tue Jun 17 22:22:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#50068: [PATCH] In curried definitions, move docstrings to outermost lambda References: <531f2e17-3f13-4610-5238-17ff94a2b3fd@abou-samra.fr> In-Reply-To: <531f2e17-3f13-4610-5238-17ff94a2b3fd@abou-samra.fr> Resent-From: Jean Abou Samra Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 28 Mar 2022 23:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50068 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 50068@debbugs.gnu.org Cc: guile-devel@gnu.org Received: via spool by 50068-submit@debbugs.gnu.org id=B50068.1648509931466 (code B ref 50068); Mon, 28 Mar 2022 23:26:02 +0000 Received: (at 50068) by debbugs.gnu.org; 28 Mar 2022 23:25:31 +0000 Received: from localhost ([127.0.0.1]:59366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYyjr-00007R-2z for submit@debbugs.gnu.org; Mon, 28 Mar 2022 19:25:31 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:55193) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYyjo-000079-J6 for 50068@debbugs.gnu.org; Mon, 28 Mar 2022 19:25:29 -0400 Received: from [10.188.216.67] ([46.193.67.184]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.184]) with ESMTPSA (Nemesis) id 1MEVqu-1nnsyG0gu2-00FxpD; Tue, 29 Mar 2022 01:25:22 +0200 Message-ID: Date: Tue, 29 Mar 2022 01:25:21 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-US From: Jean Abou Samra Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:O+fYQ5i/PuO92di3boOzLYIRvPvvvGgMCGar3qRf8AJr1/I+GPD jyDJiV3NIn3dlNggoIHWgt+sW3JCAE49IA317X7/KN2k7zuuRGAm2VsNUhqcNAIyiGAbkHl fsVZvnnqyxJ2QjN509gay9E2yRp1Re25av3SQP7hAL5Rj5BFqe5OJou91y48G9qYgEHIZ5l Plq6AEAH6alMLyL0BSSDQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:RzZgqL2d7us=:O9yBgGS8e1cuGh0hdpjCnD JJ/1SPiwg7QHtkLQvoofLwOwK9kvjuRIYgG9H6xt1oZUVk5Uu2Sfnn0vawUzLGW4nhjV/5Nnk i4ZARWDSPwerlORaCquKibHMtbbQpfNFfZgGEstugZZ4F5WrRBVuKqmRe8DpDPAtB0rNk4oYs dOvBI8cvhWO1RJLVHFSicKbtc7/FYzZv9CgcS7Ll+a+RA3jTyzKbsNCP5tqonZceSI5zXKTke t31Y4z6KilQoj4NOiSGBDdicDHMZQX9YcrMlKh66gCA+CmCJbt+loPbBisbAkFC3xAPcCHhw4 fGODKjdSFQ8K7oGUs8t8B1MV4cwJXaKUUkopmVXV6wFtMYCAFJUF9Ra6vdsLwQ5HqsQu85qy2 OPc73o/3KQRV4MVixi6u/SvFbMwv8JBZ2nCF2jDnsjejQ/I14nrx7Up0oZbeqALGXzAXUA6eZ BPdpqEV8Et2WtSK0YAhybGTTfl9FKzKtRCW7usbYsdu7E0ezXOgF8jU/53DmNhrjHfh6Mj0uu ve1dVhqvXfP9WTJjd6xfjwQpWb5tv/bWINcX6r+ez0gqChhePTg1iEjgg/23BoJ9um+c1oD1U O2FqFFu8BVPfLB3PQNXS6ROa3s0TjVeK9OPASEV+szfss9LGrkv4nN+/71VDF6d5yrbcduZ4J VZbPPAC2mf90N3gpBpBOB9+OijUTccui3lmFeAu2L4ACjqKv90+cAKUahCI53NaG35DE= X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Please consider the following patch, fixing bug #50068. Best regards, Jean From 79552d2974e9cbcfcf01960aab68cb6824c88972 Mon Sep 17 00:00:00 2001 From: Jean Abou Samra Date: Tue, 29 Mar 2022 00:14:45 +0200 Subject: [PATCH] In curried definitions, move docstrings to outermost lambda This makes the docstring attached to the curried function being defined rather than the result of its application until a function that runs the body is obtained, fixing https://debbugs.gnu.org/cgi/bugreport.cgi?bug=50068 ---  module/ice-9/curried-definitions.scm      | 72 ++++++++++++-----------  test-suite/tests/curried-definitions.test | 56 ++++++++++++++++--  2 files changed, 90 insertions(+), 38 deletions(-) diff --git a/module/ice-9/curried-definitions.scm b/module/ice-9/curried-definitions.scm index 7545338e3..7e758be5e 100644 --- a/module/ice-9/curried-definitions.scm +++ b/module/ice-9/curried-definitions.scm @@ -4,12 +4,12 @@  ;;;; modify it under the terms of the GNU Lesser General Public  ;;;; License as published by the Free Software Foundation; either  ;;;; version 3 of the License, or (at your option) any later version. -;;;; +;;;;  ;;;; This library is distributed in the hope that it will be useful,  ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of  ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  ;;;; Lesser General Public License for more details. -;;;; +;;;;  ;;;; You should have received a copy of the GNU Lesser General Public  ;;;; License along with this library; if not, write to the Free Software  ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -20,38 +20,42 @@               define-public               define*-public)) -(define-syntax cdefine -  (syntax-rules () -    ((_ (head . rest) body body* ...) -     (cdefine head -       (lambda rest body body* ...))) -    ((_ name val) -     (define name val)))) +(define-syntax make-currying-define +  (syntax-rules ::: () +    ((_ currying-name lambda-name) +     (define-syntax currying-name +       (lambda (St-Ax) +         (syntax-case St-Ax () +           ((_ ((head2 . rest2) . rest) docstring body body* ...) +            (string? (syntax->datum #'docstring)) +            ;; Keep moving docstring to outermost lambda. +            #'(currying-name (head2 . rest2) +                docstring +                (lambda-name rest body body* ...))) +           ((_ (head . rest) body body* ...) +            #'(currying-name head +                (lambda-name rest body body* ...))) +           ((_ name val) +            #'(define name val)))))))) -(define-syntax cdefine* -  (syntax-rules () -    ((_ (head . rest) body body* ...) -     (cdefine* head -       (lambda* rest body body* ...))) -    ((_ name val) -     (define* name val)))) +(make-currying-define cdefine lambda) +(make-currying-define cdefine* lambda*) -(define-syntax define-public -  (syntax-rules () -    ((_ (head . rest) body body* ...) -     (define-public head -       (lambda rest body body* ...))) -    ((_ name val) -     (begin -       (define name val) -       (export name))))) +(define-syntax make-currying-define-public +  (syntax-rules ::: () +    ((_ public-name define-name) +     (define-syntax public-name +       (lambda (St-Ax) +         (syntax-case St-Ax () +           ((_ binding body body* ...) +            #`(begin +                (define-name binding body body* ...) +                (export #,(let find-name ((form #'binding)) +                            (syntax-case form () +                              ((head . tail) +                               (find-name #'head)) +                              (name +                               #'name)))))))))))) -(define-syntax define*-public -  (syntax-rules () -    ((_ (head . rest) body body* ...) -     (define*-public head -       (lambda* rest body body* ...))) -    ((_ name val) -     (begin -       (define* name val) -       (export name))))) +(make-currying-define-public define-public cdefine) +(make-currying-define-public define*-public cdefine*) diff --git a/test-suite/tests/curried-definitions.test b/test-suite/tests/curried-definitions.test index b4a1f6509..cd535b162 100644 --- a/test-suite/tests/curried-definitions.test +++ b/test-suite/tests/curried-definitions.test @@ -5,12 +5,12 @@  ;;;; modify it under the terms of the GNU Lesser General Public  ;;;; License as published by the Free Software Foundation; either  ;;;; version 3 of the License, or (at your option) any later version. -;;;; +;;;;  ;;;; This library is distributed in the hope that it will be useful,  ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of  ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  ;;;; Lesser General Public License for more details. -;;;; +;;;;  ;;;; You should have received a copy of the GNU Lesser General Public  ;;;; License along with this library; if not, write to the Free Software  ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -49,7 +49,33 @@      (equal? 444              (primitive-eval '(let ()                                 (define foo 444) -                               foo))))) +                               foo)))) + +  (pass-if "docstring" +    (equal? "Doc" +            (primitive-eval '(let () +                               (define (((foo a) b c) d) +                                 "Doc" +                                 42) +                               (procedure-documentation foo))))) + +  (pass-if "define-public" +    (eqv? 6 +          (primitive-eval '(let () +                             (define-public (((f a) b) c) +                               (+ a b c)) +                             (((f 1) 2) 3))))) + +  ;; FIXME: how to test for define-public actually making +  ;; a public binding? + +  (pass-if "define-public and docstring" +    (equal? "Addition curried." +            (primitive-eval '(let () +                               (define-public (((f a) b) c) +                                 "Addition curried." +                                 (+ a b c)) +                               (procedure-documentation f))))))  (with-test-prefix "define*"    (pass-if "define* works as usual" @@ -81,4 +107,26 @@      (equal? 444              (primitive-eval '(let ()                                 (define* foo 444) -                               foo))))) +                               foo)))) +  (pass-if "docstring" +    (equal? "Doc" +            (primitive-eval '(let () +                               (define* (((f a) b c) #:optional d) +                                 "Doc" +                                 42) +                               (procedure-documentation f))))) + +  (pass-if "define*-public" +    (eqv? 6 +          (primitive-eval '(let () +                             (define*-public (((f a) b) #:optional c) +                               (+ a b c)) +                             (((f 1) 2) 3))))) + +  (pass-if "define*-public and docstring" +    (equal? "Addition curried." +            (primitive-eval '(let () +                               (define*-public (((f a) b) #:key (c 3)) +                                 "Addition curried." +                                 (+ a b c)) +                               (procedure-documentation f)))))) -- 2.32.0 From unknown Tue Jun 17 22:22:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#50068: [PATCH] In curried definitions, move docstrings to outermost lambdas References: <531f2e17-3f13-4610-5238-17ff94a2b3fd@abou-samra.fr> In-Reply-To: <531f2e17-3f13-4610-5238-17ff94a2b3fd@abou-samra.fr> Resent-From: Jean Abou Samra Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 26 Aug 2022 11:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50068 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 50068@debbugs.gnu.org Received: via spool by 50068-submit@debbugs.gnu.org id=B50068.166151163425507 (code B ref 50068); Fri, 26 Aug 2022 11:01:02 +0000 Received: (at 50068) by debbugs.gnu.org; 26 Aug 2022 11:00:34 +0000 Received: from localhost ([127.0.0.1]:52313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRX4k-0006ch-BE for submit@debbugs.gnu.org; Fri, 26 Aug 2022 07:00:34 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:54061) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRX4h-0006Dv-8P for 50068@debbugs.gnu.org; Fri, 26 Aug 2022 07:00:33 -0400 Received: from [192.168.76.94] ([109.209.231.164]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.168]) with ESMTPSA (Nemesis) id 1MA4ja-1oYecU3u9q-00Bb8o for <50068@debbugs.gnu.org>; Fri, 26 Aug 2022 13:00:25 +0200 Message-ID: <269d7888-ffee-92d0-43b8-37c62ffc3084@abou-samra.fr> Date: Fri, 26 Aug 2022 13:00:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Content-Language: en-US From: Jean Abou Samra Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:VsmeFOx7FYWTZbjhCHMmDK6p68/t83mDujVAPBl7h2TgARs0YeY 7vSQUZvFAEt3ZtRGtiQO0Gsp9UHz142rAZytz6mSowtIBcFUrXxeapJyMzW5Gi0GOBfYenB 25o5qnNYIQG3BkkDiTzwfpP2/x20lLZAzBHO6+SVXihnevala16gyh54axucPT0wvXkJU9U lS4cqqrPSlWNOkYYJvSqQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:+aFvC7wxwec=:5ZDdwFu/eNrzhFo/dAqt87 ERl5CBjudDKFzo9rfNopjR8jOSgISx8YwtBRqLoDHvym75XK1GIFmsbx4RyO2mYDVLcYUk0Sp Sv+fl1xXO60iI3KnJDSpf3wZlm8YdKdvYt50ZodhVsHYExFh6oI1j0DLno5DAsxY7QNv0+0BW uDehbeKZkrlk2i9LezFPlLqK9S9XvYyUnPj2iIN7nnT0KShiiIuuy1EkFSHA0S8tPwKM55ZzY QScxyJW8PWTIHZN8pCGkG0taLOwD99UyAQjgS+1YExa5HNoIDb1qRTHeatNIVWckaSs8RHKeT yvlZeaE+rfGpRPR2VUPGY6LbuGW2bOZYZcMc2K3BvQH9Rk2hDGyCcxdp0lNPtQayw4i/yLWVv X2YlIpXvC96piyCjXgI2sY+boeHYn9kcXv6NMTqylIRdEiK5Nb5iHx9UVneOATy0ppMmfsisH gvGaCUHHlj0s/kCNICiAo28cuzsNqzVBfpjVALQdpTsi7LMcXxqgQ6tB6987Sa913qjUDItt0 +Knt8pmue9lC0XCSFAGB5BKlwBdxCWq5EkYJsCfWEn52PuByXFhsaIBD+Fk1m2L2spVJ8zDlm x3AiNJSKB+xPIgqiGh5qawJZ5RshXqgMYH89iSneORC4Lc/wXfngAjkGT6OaYG6HlFN//ecG/ XMRn9CRpY8yHstQHANLhMOt+LFb3EHpviPyLD4cUIesIxEN87vmEbgkLagKJg+4AsOYb2vTzh ouzRJXYHcNji3d2UfCj4+ebC0Pm6aGoySGM+JmRQ038t8PnBOI7aivD9jEc= X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Ping? Could this patch be considered please? From unknown Tue Jun 17 22:22:55 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Jean Abou Samra Subject: bug#50068: closed (Re: bug#50068: [PATCH] In curried definitions, move docstrings to outermost lambdas) Message-ID: References: <45ABDE64-579F-4544-9511-CFAD0EAB3CF3@sarc.name> <531f2e17-3f13-4610-5238-17ff94a2b3fd@abou-samra.fr> X-Gnu-PR-Message: they-closed 50068 X-Gnu-PR-Package: guile Reply-To: 50068@debbugs.gnu.org Date: Mon, 29 Aug 2022 16:11:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1661789462-27698-1" This is a multi-part message in MIME format... ------------=_1661789462-27698-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #50068: Curried definitions lose docstrings which was filed against the guile package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 50068@debbugs.gnu.org. --=20 50068: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D50068 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1661789462-27698-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 50068-done) by debbugs.gnu.org; 29 Aug 2022 16:10:43 +0000 Received: from localhost ([127.0.0.1]:33606 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oShLW-0007C3-MG for submit@debbugs.gnu.org; Mon, 29 Aug 2022 12:10:42 -0400 Received: from mta-08-3.privateemail.com ([198.54.127.61]:61002) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oShLV-0007Bl-3K for 50068-done@debbugs.gnu.org; Mon, 29 Aug 2022 12:10:41 -0400 Received: from mta-08.privateemail.com (localhost [127.0.0.1]) by mta-08.privateemail.com (Postfix) with ESMTP id 1813218001A0; Mon, 29 Aug 2022 12:10:34 -0400 (EDT) Received: from [192.168.1.105] (unknown [51.154.167.214]) by mta-08.privateemail.com (Postfix) with ESMTPA id 6B5731801583; Mon, 29 Aug 2022 12:10:32 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: bug#50068: [PATCH] In curried definitions, move docstrings to outermost lambdas From: lloda In-Reply-To: <269d7888-ffee-92d0-43b8-37c62ffc3084@abou-samra.fr> Date: Mon, 29 Aug 2022 18:10:30 +0200 Content-Transfer-Encoding: 7bit Message-Id: <45ABDE64-579F-4544-9511-CFAD0EAB3CF3@sarc.name> References: <531f2e17-3f13-4610-5238-17ff94a2b3fd@abou-samra.fr> <269d7888-ffee-92d0-43b8-37c62ffc3084@abou-samra.fr> To: Jean Abou Samra X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50068-done Cc: 50068-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Applied in 61d8dab8eafd498306ce618582aab37497df77b4. Thank you! ------------=_1661789462-27698-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 15 Aug 2021 10:13:38 +0000 Received: from localhost ([127.0.0.1]:45787 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFD98-0001AD-8r for submit@debbugs.gnu.org; Sun, 15 Aug 2021 06:13:38 -0400 Received: from lists.gnu.org ([209.51.188.17]:59216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFD94-0001A4-I5 for submit@debbugs.gnu.org; Sun, 15 Aug 2021 06:13:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33440) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mFD94-0004OU-4o for bug-guile@gnu.org; Sun, 15 Aug 2021 06:13:34 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:51361) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mFD92-0007fy-JK for bug-guile@gnu.org; Sun, 15 Aug 2021 06:13:33 -0400 Received: from [192.168.1.130] ([82.65.251.18]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.184]) with ESMTPSA (Nemesis) id 1MnqbU-1mqzsh2Bly-00pM5X for ; Sun, 15 Aug 2021 12:13:29 +0200 To: bug-guile@gnu.org From: Jean Abou Samra Subject: Curried definitions lose docstrings Message-ID: <531f2e17-3f13-4610-5238-17ff94a2b3fd@abou-samra.fr> Date: Sun, 15 Aug 2021 12:13:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Provags-ID: V03:K1:5vYNwng4Z8KrsiY8MVHaSy0kr+SH5l75ayCsgl+zHgq4bhNWp3h 9LEzFG3ormUTLy1ZogQ/AxhYgs9aks6UoAB6OmqmUbTht5QI1BYvzyWGlnJ8DPVJxQo5G6+ YQpQ7E18GdbWIP7QHdlJW6ynAm/Qf0PsLLU3XSgRjHeBWpiumFWYy1LZ8m5V8v52FIRmaad Bh6UMECOOZToLAy/fwV2Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:AezmCsXvQrs=:K3JAgOqMZ+30QTIaKR18S0 OVzSpxi8nVX27gRQw/hEu6FQTlNgZDBaKj8AyGjmPieBhUzDI203yHBQQ66BDiYHTkfy2JbWn 3QqEz3pJrFH3Glmd/p48yNwlGYJWX9SQ1G4Gzwb630gvOCimr3s/yANQ3xmQXljqOjS12Yyrd +j0wy1rJ5geaB6QrRrupmTqwrwefJj7Xi7lJElx8tQtQsdjWRhkvvs4MJflAu728gEPKMpYUx ++IYUbalwrncg51/cbGW2/vCDolDIyAvr9xtktdw0BjcavKsVP81EZtYAmVE5nFD8BCYw7YKU QrCA5cPQs4VkNLHozxtf4QdlULCYY8h7ngsO060TE9ztegHL+7FhYlZkyfxRV6S62J3cq8OG1 kvEa1ey3455vuTFHq+73u2Kmpxz+fGEkRfaFxqFEohRrlGS35l/W4G7r4sFw0IiFxhFZoQxVJ MhekNsTLJWGbrUBQn2RkwcRLul4AjzdYL3R2T+dAeI8Nh1e7CK8k2WwgZgVoOBl6QqXL0lLqQ 1acbluPHpv9gveY9E9BZQPzNKAa+6AZkrjM/vxGhcFrW2+7azIbDP5ZzT+Zj59ap4fm8Ykj6U 0whzrhnMYsYno1H/6pCejIoCYwT9Y6qMcgm1+M2fzNzSjthrxK9s/ra/HE1ki/CxlN4BJdlWn H9TU1dM60m+nLf/WV4EIQT6nDPnPLK6ni2jjfYFKbQZN54bUx8tgH8fej+oxgWzWwBJOqeoyu BKofEpGLXDNW7VOtp4Ij3d539eid6jpFLL7vH5UqCdUp0dXwzJbXjDr9TCbH3b0WUkchwbWwm XsNBNt+8vXwEiN1LzF8CVxHu2l/Zkh5wWmDKyEIi2tDDb6x7jmbz7JtfEagngLZTYfT8X3b Received-SPF: none client-ip=212.227.17.10; 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, 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-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) When a docstring is used in the body of a curried definition, it ends up on the result of the application of the resulting curried function, not on the function itself. Example: (use-modules (ice-9 curried-definitions)) (define ((curried a) b)   "Docstring of curried"   'whatever) (procedure-documentation curried) => #f (procedure-documentation (curried 'whatnot)) => "Docstring of curried" This is apparently because Guile translates (define ((curried a) b)   ...) to (define (curried a)   (lambda (b)     ...)) which puts the docstring in the body of lambda. Tested with Guile 2.2 and 3.0.5. ------------=_1661789462-27698-1-- From unknown Tue Jun 17 22:22:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#50068: [PATCH] In curried definitions, move docstrings to outermost lambdas Resent-From: Jean Abou Samra Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 29 Aug 2022 16:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50068 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: lloda Cc: 50068-done@debbugs.gnu.org Received: via spool by 50068-done@debbugs.gnu.org id=D50068.166178972528240 (code D ref 50068); Mon, 29 Aug 2022 16:16:01 +0000 Received: (at 50068-done) by debbugs.gnu.org; 29 Aug 2022 16:15:25 +0000 Received: from localhost ([127.0.0.1]:33643 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oShQ4-0007LQ-SB for submit@debbugs.gnu.org; Mon, 29 Aug 2022 12:15:25 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:42571) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oShQ2-0007LC-W9 for 50068-done@debbugs.gnu.org; Mon, 29 Aug 2022 12:15:23 -0400 Received: from [10.188.88.236] ([46.193.67.184]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.184]) with ESMTPSA (Nemesis) id 1MysBI-1pOFt10XYI-00w0Dr; Mon, 29 Aug 2022 18:15:09 +0200 Message-ID: Date: Mon, 29 Aug 2022 18:15:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 References: <531f2e17-3f13-4610-5238-17ff94a2b3fd@abou-samra.fr> <269d7888-ffee-92d0-43b8-37c62ffc3084@abou-samra.fr> <45ABDE64-579F-4544-9511-CFAD0EAB3CF3@sarc.name> Content-Language: en-US From: Jean Abou Samra In-Reply-To: <45ABDE64-579F-4544-9511-CFAD0EAB3CF3@sarc.name> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:oCOlCLQUy0s5BgQnvo7VZsuAXU6yDs/FUgWvenB8a1tdZoOBsn/ IcctRN1ksmy9hIQwM229xXGohPptfTdEnGKD6j2r2z1nwflo1mf27KOP+o4lw8nJ37xzFVD tRnm7V1rbCaGWSwzFj8V+FpAUQ8fBpJVPJaKzE3MnBsW2VOaGmMLAMN1Yi2anz5B4aWnWdR 6pR60NzrYkPiojE0A1KXA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:84uSkroUvqw=:MPkXvJ0+tFrwvv4kIz+HR8 r8kyM5duZtsHSvQLpmDFE0HWsjdJhADHTLhW/uNakwo2L95FeyKnRyW2dK89mwJyARRH5gYa6 v/H6jtlJKsQk2OQjh/YbzfV3G07TZ2RdYQprjnsLlT2yCfe4fLFwtstC0JPdCJV9xtntxk4iz eBquOmM2zAM7MaoeGaq7Er2BZWM8XukMSzD7QQmcAW43w+i7gdhwquAJ+y2FJSm6qswq/TtwU OSgxg9Gebh1Nt27vjqaHRwGl2hyyMoeb97Ub7B3Eo/mUACE3woTn7Ts0P7OuO6BaFHQuzVKZ2 G3iEvPQyg5X/zVgAW95ycA9dI0G7ttSeFfd+BhkD6gOGojj6Y3jVJyXQjtanDWbH7hLQKuAeR xvbpWLWz+ZbsPNf3TA1xcIeLxyJen7VvgeXH7HkxwAVO6lcQ/JHp7UOuMDUNCG0rASABuWKv2 fTOFOgKjO48bCUEtNfO0jRiEhLopXYfiF1BQX9ai83XVkrYTtngVrexxyNQtgDRC09HdA0Hev nblWp+blzK1B9pQJsWpdpa0WhXhBZHaEwvzM+vxpjRb0XQU6bt/BB8+B54Tlu1fkHagkiz2Vj nDC9BtWWBHG5JRIxESuex+0WjfVEdWsgbrelBbPEpjnPgMcLBbqbHYOuf+olKhoKeJe4Cb0AY Q/X8r4+uweoJa4e+azU8I6Vb5e3JbkTDwfW6t6VEDE+Alh8mW+DDLm3OL2YZantASl6+AdlUx koPwk+9Z8kKYLJN0t4CpFJReC6r5ERTsFJ1EyA== X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Le 29/08/2022 à 18:10, lloda a écrit : > Applied in 61d8dab8eafd498306ce618582aab37497df77b4. Thank you! Thanks, Iloda!