From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Linus_Bj=C3=B6rnstam?= Newsgroups: gmane.lisp.guile.user Subject: Re: cond clause does not allow definitions Date: Fri, 24 May 2024 16:27:51 +0200 Message-ID: References: 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="9520"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.11.0-alpha0-480-g515a2f54a-fm-20240515.001-g515a2f54 To: "Damien Mattei" , guile-user Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri May 24 16:28:53 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 1sAVud-0002Il-V0 for guile-user@m.gmane-mx.org; Fri, 24 May 2024 16:28:52 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAVuB-0001d3-7Y; Fri, 24 May 2024 10:28:23 -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 1sAVu7-0001Zm-Vg for guile-user@gnu.org; Fri, 24 May 2024 10:28:21 -0400 Original-Received: from wfhigh5-smtp.messagingengine.com ([64.147.123.156]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sAVu5-0002MR-9J for guile-user@gnu.org; Fri, 24 May 2024 10:28:19 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.west.internal (Postfix) with ESMTP id 43C8B1800125; Fri, 24 May 2024 10:28:13 -0400 (EDT) Original-Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Fri, 24 May 2024 10:28:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.se; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1716560892; x=1716647292; bh=sxDBF+KSifl1tbWkxTSGvUSfna1+K1HgdrAaqVYUVps=; b= qAn4uAKH1sIa56yk1n0+tCu0Ht4UXxg0frTJhB79huzXD5OKanBcNgpGVgONEqqN Og7NolykTGPYaRAza3tZGHoX4tdUI1sGmQ+b3wHYljctWMjlKYqG89di1QnijJed fJS7PeL3bPnIXpQEY0foMxxdLDL0gvTrnR9pvl5aHCGuUVHMuDj43nOJ0Ef79/MX mgRsStEuFTA0sHbQcXg7P/K5//z7pY3WwovdrNdV7cbmV8ppOIaQD0SKXH9+neIu tlUhY8UbBvCeGjCz+SOHPLMTyRCdCjiRvQp7Ws9bkZPjCO48vgThcUfdQhfYunK7 +ng3T9V12bTIPMmj06Xo8Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1716560892; x= 1716647292; bh=sxDBF+KSifl1tbWkxTSGvUSfna1+K1HgdrAaqVYUVps=; b=S Gc1T698NCFsr2DgjehrN64AM1wSbFuws3NuuwQCdBIvNE7A+8fSlt0By0NELkhaQ KGVobBQNqeOPLSOf6JJO4gqs5al52fzVtmBGczNObsDVLMSwzyPHUac+LjFBCidg E/RFoMQn2TtuJJ/IVtEJhC30AuqAO/EQNX9+CeEFuxifA92ix8hKBTk4doUy3foK IEIBNWUGqlsU5EGymVSn5NfTNHH2V8zrwMWfEsqDYuAyyPYSrturgAz2fpG459Uf /lyH2bT5vGo21MW6HhE3AajULvhwP8LHCFqEu3lGqvMbXVbsSacC38vwW6wrxRfd xKrtVbs9u8SQ4A67r/5BQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdeikedgjeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpefnihhn uhhsuceujhpnrhhnshhtrghmuceolhhinhhushdrihhnthgvrhhnvghtsehfrghsthhmrg hilhdrshgvqeenucggtffrrghtthgvrhhnpeeffffhleefuedvleefgeffveetgeeitddv fffhlefhhefgkeeuheeileegudeljeenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehlihhnuhhsrdhinhhtvghrnhgvthesfhgrshhtmhgrihhl rdhsvg X-ME-Proxy: Feedback-ID: i57f3436d:Fastmail Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id A2D41B6008D; Fri, 24 May 2024 10:28:12 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: Received-SPF: pass client-ip=64.147.123.156; envelope-from=linus.internet@fastmail.se; helo=wfhigh5-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_PASS=-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:19691 Archived-At: I submitted a patch that expanded definition context to more places (con= d, case, when, unless etc). I dont know what happened to that. I submitt= ed it while moving and promptly forgot about it after some discussion. -- Linus Bj=C3=B6rnstam On Wed, 22 May 2024, at 21:26, Damien Mattei wrote: > scheme@(guile-user)> (cond (#t (define x 7) x)) > While compiling expression: > Syntax error: > unknown file:7:10: definition in expression context, where definitions= are > not allowed, in form (define x 7) > > but it is allowed in else clause: > scheme@(guile-user)> (cond (else (define x 7) x)) > $4 =3D 7 > > not really logic > > it is allowed in Kawa and Racket but they are not scheme references > the R5RS and R7RS talk about 'clause' without more information > > is it normal for Guile to consider clause for cond to be an expression > context and not a definition context? > > should not be better to consider definition context? that would allow = more > possibilities.