From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 13 15:11:41 2013 Received: (at submit) by debbugs.gnu.org; 13 Jul 2013 19:11:41 +0000 Received: from localhost ([127.0.0.1]:53150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uy5EK-00005E-Ao for submit@debbugs.gnu.org; Sat, 13 Jul 2013 15:11:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44347) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uy4wN-0007wW-FV for submit@debbugs.gnu.org; Sat, 13 Jul 2013 14:53:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uy4wF-0003CE-TJ for submit@debbugs.gnu.org; Sat, 13 Jul 2013 14:53:02 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:43640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uy4wF-0003C8-QL for submit@debbugs.gnu.org; Sat, 13 Jul 2013 14:52:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uy4wC-0007pT-Sp for bug-guile@gnu.org; Sat, 13 Jul 2013 14:52:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uy4wA-0003BW-CV for bug-guile@gnu.org; Sat, 13 Jul 2013 14:52:56 -0400 Received: from primfilat.com ([71.19.154.166]:45794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uy4wA-0003BG-6H for bug-guile@gnu.org; Sat, 13 Jul 2013 14:52:54 -0400 Received: from [192.168.0.2] (unknown [46.18.41.120]) by primfilat.com (Postfix) with ESMTPSA id 006547B8F9 for ; Sat, 13 Jul 2013 20:58:52 +0200 (CEST) Message-ID: <51E1A1FD.8000104@primfilat.com> Date: Sat, 13 Jul 2013 20:52:45 +0200 From: Josep Portella Florit User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 MIME-Version: 1.0 To: bug-guile@gnu.org Subject: my-or macro in documentation X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 13 Jul 2013 15:11:38 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -4.0 (----) Hi! The my-or example macro in the documentation has a subtle bug. (letrec-syntax ((my-or (syntax-rules () ((my-or) #t) ((my-or exp) exp) ((my-or exp rest ...) (let ((t exp)) (if exp exp (my-or rest ...))))))) (my-or #f "rockaway beach")) In the third rule t is bound to exp, presumably to use t instead of exp to prevent evaluating exp multiple times, but t is never used and exp is used again. This is the bug in action: scheme@(guile-user)> (letrec-syntax ((my-or (syntax-rules () ((my-or) #t) ((my-or exp) exp) ((my-or exp rest ...) (let ((t exp)) (if exp exp (my-or rest ...))))))) (my-or (display "*") 1)) ***scheme@(guile-user)> I'm sure you already know how to fix it :-) (letrec-syntax ((my-or (syntax-rules () ((my-or) #t) ((my-or exp) exp) ((my-or exp rest ...) (let ((t exp)) (if t t (my-or rest ...))))))) (my-or #f "rockaway beach")) Josep From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 13 20:41:55 2013 Received: (at 14859-done) by debbugs.gnu.org; 14 Jul 2013 00:41:55 +0000 Received: from localhost ([127.0.0.1]:53485 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UyANu-0005AR-G0 for submit@debbugs.gnu.org; Sat, 13 Jul 2013 20:41:54 -0400 Received: from world.peace.net ([96.39.62.75]:51144 ident=hope3) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UyANr-0005AE-OM for 14859-done@debbugs.gnu.org; Sat, 13 Jul 2013 20:41:52 -0400 Received: from 209-6-120-240.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com ([209.6.120.240] helo=tines.lan) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1UyANk-0001qS-Fc; Sat, 13 Jul 2013 20:41:44 -0400 From: Mark H Weaver To: Josep Portella Florit Subject: Re: bug#14859: my-or macro in documentation References: <51E1A1FD.8000104@primfilat.com> Date: Sat, 13 Jul 2013 20:41:24 -0400 In-Reply-To: <51E1A1FD.8000104@primfilat.com> (Josep Portella Florit's message of "Sat, 13 Jul 2013 20:52:45 +0200") Message-ID: <87d2qm6ki3.fsf@tines.lan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 14859-done Cc: 14859-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: 0.0 (/) Hi! Josep Portella Florit writes: > The my-or example macro in the documentation has a subtle bug. > > (letrec-syntax ((my-or > (syntax-rules () > ((my-or) > #t) > ((my-or exp) > exp) > ((my-or exp rest ...) > (let ((t exp)) > (if exp > exp > (my-or rest ...))))))) > (my-or #f "rockaway beach")) > > In the third rule t is bound to exp, presumably to use t instead of exp > to prevent evaluating exp multiple times, but t is never used and exp is > used again. Indeed! This was reported shortly after the 2.0.9 release, and has been fixed in the stable-2.0 branch. http://bugs.gnu.org/14203 http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commitdiff;h=e006d87ba5942b6e49b39b951413dfe63785a398 Thanks! Mark From unknown Sat Aug 16 19:17:14 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 11 Aug 2013 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator