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: define anywhere Date: Sun, 06 Jun 2021 10:09:22 +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="4515"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.5.0-alpha0-519-g27a961944e-fm-20210531.001-g27a96194 To: "Damien Mattei" , guile-user Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Jun 06 10:10:14 2021 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 1lpnrJ-0000pk-LW for guile-user@m.gmane-mx.org; Sun, 06 Jun 2021 10:10:14 +0200 Original-Received: from localhost ([::1]:60374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpnrI-0003Uz-Ir for guile-user@m.gmane-mx.org; Sun, 06 Jun 2021 04:10:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpnqw-0003UQ-Id for guile-user@gnu.org; Sun, 06 Jun 2021 04:09:50 -0400 Original-Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:36203) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpnqs-0002qI-EX for guile-user@gnu.org; Sun, 06 Jun 2021 04:09:50 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 8DADC18CD; Sun, 6 Jun 2021 04:09:44 -0400 (EDT) Original-Received: from imap43 ([10.202.2.93]) by compute5.internal (MEProxy); Sun, 06 Jun 2021 04:09:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.se; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type:content-transfer-encoding; s=fm3; bh=c6U9B 8nfu13WCKjGmtwDCQRzrFpiaZN4ZWMMjf8eK28=; b=MiBvQAttmsEVS2XJiAJCJ DoK5i3evjSuq87/xn98ivFptXaqQGcviVTgn6AyDV6hIODHT59LQ/v0d2WGJUpdY zB714LrRlJ6JmyOhDXYg2nPkDEZv8J9e5fV5sp8zQ5osNB/rYDNRCwMqQ1VPnA+m L7WbaIfy8giOhin6EDIo8ien4vfc6FekLI9AW9cjXi/IK2CTXFnYXid0x3eQcS0+ GcGtSP8Gy+LoO4PIe3yVHxAzqXL54/CzF3rMcHSQKgURbpvhobUi8J0IXZiBP1Gp e4D+vdlxy1sassrQ3UVdGZwcAfedL5SYhnTxm8x94mHggXTfXlgqEnpKIQn2094B g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=c6U9B8nfu13WCKjGmtwDCQRzrFpiaZN4ZWMMjf8eK 28=; b=HSGhZTYAxfO4Kkfm75Xw6gUymt5AJl50TlSsxD/bqPNRmUnynJQxvs1+Z CQMuwtmO05TsfgEYzo6T3iyX/MlgCjTgeRl+r7VwDSghpOkcj3Pi33IKo8cPk2Tz MlKKRbuqdXpx0rnVf05x+NYAqOQTINOJnWdxh6VdgIh/NNiViinwyawsRT2s3BUr 6CXYbJCZs1k8blKFy0HR5RosWa7XRMdVlFsd9EHMKzu4VL9N/qdgBuVfwP4lFsbQ kVxTgXWoljzrkAXpcP2dj9KJRVW8Ykq/EdPNYVEeszBHz6xxeNjwp6sxn/eaLD0T +tULkh2Fq+Ec7MJYQiWaWUukQNw/w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedthecutefuodetggdotefrodftvfcurf hrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefofgggkfgjfhffhffvufgtgfesthhqredtreerjeenucfhrhhomhepnfhinhhushgp uehjnphrnhhsthgrmhcuoehlihhnuhhsrdhinhhtvghrnhgvthesfhgrshhtmhgrihhlrd hsvgeqnecuggftrfgrthhtvghrnhepfedvjeetgefhfefggeetgefgieelgeffgefgjeeu geevtdeflefgfeevkedthfeinecuffhomhgrihhnpehsrhdrhhhtpdhrvgguughithdrtg homhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehl ihhnuhhsrdhinhhtvghrnhgvthesfhgrshhtmhgrihhlrdhsvg X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id 76BCAAC0062; Sun, 6 Jun 2021 04:09:43 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: Received-SPF: pass client-ip=64.147.123.19; envelope-from=linus.internet@fastmail.se; helo=wout3-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, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 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" Xref: news.gmane.io gmane.lisp.guile.user:17578 Archived-At: Note however, that I seem to have forgotten when and unless. also: cond = has no support for the extended "test guard =3D> lambda" form. Neither d= o I believe that the any "special" case form is supported. If there is a= ny interest whatsoever, I can implement it when I have time. The code produced is NOT the same as guile3 does for internal defines, h= owever.=20 (define a 2) (define b 3) (display "hej") (define c 3) (+ a b c) becomes ONE letrec under gulie3, whereas my library turns it into (letrec ((a 2) (b 3)) (display "hej") (letrec ((c 3)) (+ a b c))) That should be an easy fix, again if there is any interest. --=20 Linus Bj=C3=B6rnstam On Sat, 5 Jun 2021, at 17:23, Linus Bj=C3=B6rnstam wrote: > I implemented this hack before guile 3 got defines in function bodies:= =20 > https://hg.sr.ht/~bjoli/guile-define >=20 > Even I guile 3 it allows a more liberal placement of define, but it=20= > won't work for things like bodies of imported macros (like match) > --=20 > Linus Bj=C3=B6rnstam >=20 > On Sat, 5 Jun 2021, at 00:27, Damien Mattei wrote: > > hello, > > i'm was considering that i want to be able to define a variable=20 > > anywhere in > > code, the way Python do. Few scheme can do that (Bigloo i know) > > ( the list here is not exact: > > https://www.reddit.com/r/scheme/comments/b73fdz/placement_of_define_= inside_lambda_bodies_in/ > > ) > > is it possible in guile to do it? i do not know, so could it be add= ed=20 > > to > > the language specification for future release? > >=20 > > regards, > > Damien > >=20 >=20 >=20