From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pierpaolo Bernardi Newsgroups: gmane.lisp.guile.user Subject: Re: cond clause does not allow definitions Date: Thu, 23 May 2024 16:59:05 +0200 Message-ID: References: <5d1be852da93dd324fdbcaa24ed1b444@aleph0.info> <9ff8d2d644823f62e416047582433d2b@aleph0.info> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11891"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Jeronimo Pellegrini , guile-user To: Damien Mattei Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Thu May 23 16:59:54 2024 Return-path: Envelope-to: guile-user@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 1sA9v8-0002vh-1O for guile-user@m.gmane-mx.org; Thu, 23 May 2024 16:59:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sA9ug-0003gU-8k; Thu, 23 May 2024 10:59:26 -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 1sA9uc-0003fr-Kt for guile-user@gnu.org; Thu, 23 May 2024 10:59:23 -0400 Original-Received: from mail-vk1-xa35.google.com ([2607:f8b0:4864:20::a35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sA9uY-0004GH-Tk for guile-user@gnu.org; Thu, 23 May 2024 10:59:21 -0400 Original-Received: by mail-vk1-xa35.google.com with SMTP id 71dfb90a1353d-4df4016b3c9so2165420e0c.1 for ; Thu, 23 May 2024 07:59:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716476357; x=1717081157; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Xr9OSLtQ1OY+IB//1JWZz5pRTc0qv2TgCyOydIS9O4w=; b=ZaOTCMMhbh1s0q9+Vq9KC3elbIH79VHoYEfYdrAJfA7f293za4mF01XqgBRFm1mSvi s7i2W3rM3fOCGPSiAXB79lmz+juiXSop+rwI6OXXstJpxewxBzkNEBbPFfjWPZiWoqIZ UriFPi+xVxfS4YXUGpRbga/7g41rqrAKRHVSN3B1vyNso9msa87gdjdzWMwPrfYnB1Q5 /TTSSWV8BsnhI+3FQrtKN2bh7gwXiTwJzkigPMPAXNUYrkMs98/PZvMs52/enmckaugo YR/L1x2peE2zwlKYFn7DKkQAO6NjI3lsbtt1z3XbkHsuXYK4qjpXVVWkw976oNeqSrVp l73A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716476357; x=1717081157; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xr9OSLtQ1OY+IB//1JWZz5pRTc0qv2TgCyOydIS9O4w=; b=sTgma0FqGaedEz+r/FUzaGhS3f1VQ6y5dsL5pddm6JleOTmjvr9w92desUaiX14m0G 9egYEcQRjAdK0di5tMaTn2DvHkqU1qAyz21wDqPiwNQU0IjUHvqJWAs6c8PxmcfThff9 g6WK0B/P2eUU+eh9SBaH3GiWXiGX/xrry93tMHWroBiO+VHrf+lIxF7kEDWmJn5wM7cm esw0sSqsaSv9MuTwNEnbd+cjC4J3ZzEVGV44sfhQQrsvjyCs+L5gwlSLBFDrH3bODTed 4HDtw9SyIj7n7Poh4qB7hnof6GQnbCyglgQqhkhAsA2IYBXUOQaJoPHJ1PDYDeJbQ313 b42Q== X-Forwarded-Encrypted: i=1; AJvYcCWCxBD9Rm3Hwe8frOVmuAvbjo9vOsrj2PHKhCXYdvebEVfIwV9GV95yxIPK39UpvbyONi62Vjh4ACpQGwkY4/ynLFs= X-Gm-Message-State: AOJu0Yy5rIPx5Mw3hvYo0O0zyNqUqcp5A1on3fIDvaX7A6sUM8jF4Xiw dYRjUcihBcjTNO93Qp4u5TJoBF/tFn1HXYIlb/vRRaU302qwhPy6irZyWJNqZ2dzXknauNd4kmo 0KiqA0N42LVvJsxenaxJ++zrkw+I= X-Google-Smtp-Source: AGHT+IGxCdz2zWhRBAW2s1KAQXTckt1vaxhJT10RBRjd3iMkP0ZWtSrFsHPIoLuDLFMcywnoG/ugIRLpQXKqrZYQLko= X-Received: by 2002:a05:6102:c53:b0:485:ce2d:90db with SMTP id ada2fe7eead31-489032bb53dmr5168555137.12.1716476357420; Thu, 23 May 2024 07:59:17 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::a35; envelope-from=olopierpa@gmail.com; helo=mail-vk1-xa35.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19687 Archived-At: On Thu, May 23, 2024 at 4:25=E2=80=AFPM Damien Mattei wrote: > On Thu, May 23, 2024 at 12:37=E2=80=AFAM Jeronimo Pellegrini wrote: >> On 2024-05-22 18:07, Pierpaolo Bernardi wrote: >> > In chez: >> > >> >> (cond (else (define x 7) x)) >> > 7 >> >> x >> > 7 >> > >> > which looks like a bug to me. > yes i spent many hours debugging to understand why > (cond (else (define y 7) y)) worked and not (cond (#t (define x 7) x)) I had and explanation from Jamie Taylor. The implementations which behave like Chez, are probably using the example definition of the cond syntax given in appendix B of the R6 report, which expands (cond (else result1 result2 ...)) into (begin result1 result2 ...). Given the splicing nature of begin, when the cond is in a context valid for definitions we have the weird result above. https://github.com/cisco/ChezScheme/issues/835