From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matt Wette Newsgroups: gmane.lisp.guile.devel Subject: Re: new function Date: Sun, 19 Sep 2021 07:43:17 -0700 Message-ID: <89eacc31-9476-fc52-ef22-a4de293fce2c@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10323"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sun Sep 19 16:43:35 2021 Return-path: Envelope-to: guile-devel@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 1mRy2Z-0002Uh-5c for guile-devel@m.gmane-mx.org; Sun, 19 Sep 2021 16:43:35 +0200 Original-Received: from localhost ([::1]:41580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRy2X-0005VI-P3 for guile-devel@m.gmane-mx.org; Sun, 19 Sep 2021 10:43:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRy2M-0005Us-3Z for guile-devel@gnu.org; Sun, 19 Sep 2021 10:43:22 -0400 Original-Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:45825) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mRy2K-0006zU-OS for guile-devel@gnu.org; Sun, 19 Sep 2021 10:43:21 -0400 Original-Received: by mail-pj1-x1034.google.com with SMTP id mv7-20020a17090b198700b0019c843e7233so7085942pjb.4 for ; Sun, 19 Sep 2021 07:43:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=affT3tk4t21wvixZU6WOkoVQsSr8pYC5Qve2fa5Gqdo=; b=KsnNbIpVBgOLoLR83aiyCOvJFshssTDTcwy4EI3natheDsQoppWZtGfTpZCcN27qvh wcZ+PJ59kfyPpJTgIhNNj3VVTUBLLsRWccz86nCpcvBVZX3sHjdulvc3LQLJVVX74ge6 jbnc6dxD2dxD/IIC+nDTz663mMTkdJw1FQ9S9GyrnTYL4g9Fabf/KB7dRzC77hEq2Nlw 0NEwA8Now2kJLGfNojoXlpox5rXHdNE3gfiOMB1+DLxDWhW6TO4bKWTpTsY2IFM5tOaA QEM+2no+r+W7VZRQ15sb6ryweG3EvEHpa/+O9JeUQGuH3IVduo4bNJwpZidpRH/EqJ/t v/iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=affT3tk4t21wvixZU6WOkoVQsSr8pYC5Qve2fa5Gqdo=; b=iK/lRDGlswEkGqj1lzUCJ8xUn356TiTxjX/xoe++5jhhuJcczfMNAJPECGCitoONf5 b59TyzOvgyMBeWrw1PWJ0dh8FV2jsncJAVceGJP2C2FTBB3por6J+5hecD3J4flI3NL1 /9R67z3z8uYz8ExNjmArJKSD5cBBiNlBYvQm4zTK8uJQTrTXU8vfCTnpGUsnl4JtpJ5e e7YecYJQbGlhiji72+kdOphBmBjEZLrDdN12btjAPwY2C+plkiA1iSWkQo8uI/WoFCSp rHTWNljSkJYaA3MMbW28umVLq07d/PmPBYuXoiPaeHdw6ZlfEplhrhYjUDvcEZuDxQIs mlGQ== X-Gm-Message-State: AOAM530VWNbVdTBeTFQovxWygA7U2fLvmhJyLIMstJFiBcuUsvNo1+Pa 4LWSOPSUy5AsEis/ev5dyi6BcRrluus= X-Google-Smtp-Source: ABdhPJwBluHPwY/2GUY9ILMwkjTbX6FWOIg4OXixXSrBoJHZROBWXJa8PZC/UFBIzQ4hcs/2DS3Mfw== X-Received: by 2002:a17:902:b193:b029:11a:a179:453a with SMTP id s19-20020a170902b193b029011aa179453amr18305432plr.69.1632062598927; Sun, 19 Sep 2021 07:43:18 -0700 (PDT) Original-Received: from [192.168.2.163] (64-52-176-132.championbroadband.com. [64.52.176.132]) by smtp.gmail.com with ESMTPSA id y22sm10678664pju.41.2021.09.19.07.43.18 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 19 Sep 2021 07:43:18 -0700 (PDT) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=matt.wette@gmail.com; helo=mail-pj1-x1034.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, NICE_REPLY_A=-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-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20865 Archived-At: On 9/19/21 7:41 AM, Matt Wette wrote: > On 9/19/21 12:54 AM, Damien Mattei wrote: >> hello, >> i'm developing an extension to Scheme >> and i need a procedure or macro that define a variable only if it is >> not bind and if it is just set! it. >> >> I can not do it in Guile or any Scheme,and i'm desperately searching >> a way to do that. I finally conclude that it can be done only by >> adding it in the language. >> >> Can someone include a such function in Guile next release? >> i know guile have a predicate defined? to test binfing of a vairable >> but writing a macro with it is not possible because define can be >> used in an expression context. >> >> Thank in advance for any help >> Damien > > Check the manual. > > scheme@(guile-user)> (define-once a 1) > scheme@(guile-user)> (define-once a 2) > scheme@(guile-user)> a > $1 = 1 > scheme@(guile-user)> > Sorry.  I misread your post.   How about this: mwette$ guile scheme@(guile-user)> (define-once a 1) scheme@(guile-user)> (define-once a 2) scheme@(guile-user)> a $1 = 1 scheme@(guile-user)> (define a 1) scheme@(guile-user)> (define a 2) scheme@(guile-user)> a $2 = 2 scheme@(guile-user)>