From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by sourceware.org (Postfix) with ESMTPS id 3774A386F802 for ; Fri, 10 May 2024 21:03:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3774A386F802 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3774A386F802 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::12d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715375004; cv=none; b=gEqj8DBbOCN3qrU+i4BkEAZTmSi7XWWb7POBSA028jZQI5dUIQZE8LDtiUbFvBUmjCTOPeXDQFo5+5kPq//uW30H2nDOQYcY2X21cEz9hFMWumxQ6nrFVQomHf9VMoD1w6tLsAxVrGlTakb1t57UE3okgHlVKuwCnqfBlx/FqpI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715375004; c=relaxed/simple; bh=C2ZhgfuLyl7egr5oduBPB2v+roD9Ccze9Gt2OqiyRac=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=MKC1e17YPjpbtrhT4IC0RDZbNAhpMiaqHF6eenMS9gVjevzn764YmI1qw5fyvgz7vVkG3LQTYzADzkY+t4oflsvfzmOgmzaBYlLKITegorQ45ZF1qismH6/tA+ZHid+GltXOPm/VOoXjh7qq984Vl8j5fQ7T3/J3ryXeFFzNK5U= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-51f0b6b682fso2564903e87.1 for ; Fri, 10 May 2024 14:03:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715374992; x=1715979792; darn=sourceware.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=40v6AX7W69jll/foMEFGuTOYaZ5AuJEIF92b0z63B1k=; b=YYkSGAfvtBq/Tcv94W/I/bZZWM542B8zbdduatPYBP2nv6qK/I3CdNdPfxJr08KQa1 RVVIWe/fcqHR/r0ZJKEnYqKuUZaSUdnThjwvXTT6We/CLiRj/k/+suU6Ie5PHiTEDn1l Cr2luxTNqzYaSjlOAAUoAsOYtIbFkcMvFFGglDUjmVUnMvwkDuPVaLFFts0Pn8v3XagK l7qjy0MGIzYu92/d+tl1P2AvAhiAHY9kDhZpsE8mbpOAYE4ZD/2TIO2/Rz0Sldb9tdpK s5EXJNk1DsII6oI3kr+wf4XM66y4M6wY/uehJdzuiZndLOQVKBEz8d4A61ejpq72EOlq z2Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715374992; x=1715979792; h=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=40v6AX7W69jll/foMEFGuTOYaZ5AuJEIF92b0z63B1k=; b=sNVIk+xfK4IT4CzBMy2pa3RWxF4ODzk7XbzwmXZneeMzLxfbhE678suvxkVJDiQSFI fT2r7t+IC0b8x3l+mtT0YDOPVZEgEJ4bvTNoil2hl4zkfB3PYfy24YMIOAIbvwGX52/l JoY8OjgV/GgDBS4zaCHyyIlQYr3AddZBEnbdWC8m7mNRzSAnvMYBYiUrU7ANPEoeOXjm UEenxM2QMfJJrYcpIWrONAHX4xUYGkUYuEmRU+pTbwzGWfIzeBKLHePkXVyd2NZWwotl y6DURZyTGWvjoSKIwxfr3+25KuojnWkcEpNt4RIgT7Mm4V5vDoblKa3ckReBJJhTiTqh ZyHQ== X-Gm-Message-State: AOJu0YwybFaylS3F+JaLTzPNwNcJ49bIR2hf8PIRKO8PTdlO4xXb9kRY ERO6nxuzPpY88rBAiJKRT2fJ/TX+M/PK0mJli0yx5nE0h+b7nCY8Qjhjptel8n4DwoepK39dUDA 9YdKPTYpjDdh+jo5ES8DSdxWeH9noNw== X-Google-Smtp-Source: AGHT+IHY9C+GYowxqg+i5UnEPSAT+CuZu+KFpWBG44M4w3FQt+s6RPUfbfyow0gaOK74I1LPEcOK41vJABY0fQaDGp8= X-Received: by 2002:a05:6512:344b:b0:51e:2e0a:c38c with SMTP id 2adb3069b0e04-5221016b55amr2531835e87.45.1715374992263; Fri, 10 May 2024 14:03:12 -0700 (PDT) MIME-Version: 1.0 References: <9e584c45-8a18-458b-ba2b-0f27450490d7@bothner.com> In-Reply-To: <9e584c45-8a18-458b-ba2b-0f27450490d7@bothner.com> From: Panicz Maciej Godek Date: Fri, 10 May 2024 23:03:00 +0200 Message-ID: Subject: Re: Evaluating definitions from another thread To: Per Bothner Cc: kawa Content-Type: multipart/alternative; boundary="0000000000001217a106181fddf9" X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --0000000000001217a106181fddf9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable pt., 10 maj 2024 o 22:19 Per Bothner napisa=C5=82(a): > > > On 5/10/24 1:15 PM, Panicz Maciej Godek via Kawa wrote: > > Hi, > > > > I've noticed that when I call > > > > (future (eval '(define x 5))) > > > > then the variable x remains unbound after the execution > > - even though when I invoke (eval '(define x 5)), x gets bound to 5 as > > expected. > > This might work: > > (define x #f) > (future (eval '(set! x 5))) > Thanks, it does the trick for simple cases. I currently scan for the appearance of "define", then extract for the symbol and build a binding, and then evaluate `(set! ,symbol (let () ,expression ,symbol)) but if I wanted to handle a more general case (such as a begin form containing some definitions), I'd probably need to implement something closer to a full evaluator, which makes me wonder whether the above behavior (with variables not being bound from other threads) is actually desired? --0000000000001217a106181fddf9--