From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Attila Lendvai Newsgroups: gmane.lisp.guile.devel Subject: Re: Define works different when Compile and Eval Date: Wed, 19 Jun 2024 09:53:28 +0000 Message-ID: References: <875xu5i9qr.fsf@trop.in> 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="11726"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-devel@gnu.org To: Andrew Tropin Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed Jun 19 11:54:20 2024 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 1sJs1E-0002nY-01 for guile-devel@m.gmane-mx.org; Wed, 19 Jun 2024 11:54:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJs0r-0000sa-4J; Wed, 19 Jun 2024 05:53:57 -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 1sJs0i-0000ps-0b for guile-devel@gnu.org; Wed, 19 Jun 2024 05:53:50 -0400 Original-Received: from mail-4317.proton.ch ([185.70.43.17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sJs0e-0001VE-EJ for guile-devel@gnu.org; Wed, 19 Jun 2024 05:53:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail2; t=1718790814; x=1719050014; bh=yqitwYy2KCFBgeYWewlFyp6Ch9paExQczIXQfnKei6Q=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=QnyHwb+OB7Rpsp7gZac9o3VAILvu017HOx/9K9BuDo3o6H5uYGVj8cZyuKkGwk9g8 xF56ZLuH6VHYhTejvqtuL+HF+WfHH6FKjLGlhk0QMmXXT9QHqTEDvCpWZVevo+4ftA zcJCucdXHfPpoz5BRNAnY66CvQ4y8r5/w88gP/Wote2U7Y2AmBj6asDzh3OB0OX6B8 7qC1s4rp0JjmvZb/2CVG5w2jGtdp42R6TWrH94AY00O2pfDNb/YLnjRtPx1F7Th34b mbywSVXCaQ1ePxdM7nc+6Y3a9wXY/IyN+nTKliXnrHL8DdS2A+vV7fv/NYK/kuQEhx IYfENOit1R+wA== In-Reply-To: <875xu5i9qr.fsf@trop.in> Feedback-ID: 28384833:user:proton X-Pm-Message-ID: f122c97976e1c717c9ee9a00c947865c84f58241 Received-SPF: pass client-ip=185.70.43.17; envelope-from=attila@lendvai.name; helo=mail-4317.proton.ch 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:22450 Archived-At: > (define (test-eval teval) > (teval '(define a 1)) if you want this^ to be actually defined while compilation is happening (i.e. in the compilation stage; see staged computing), then you n= eed to use an (eval-when (expand) ...) wrapper around it. https://www.gnu.org/software/guile/manual/guile.html#Eval-When compile does not evaluate (aka load) the definitions, it only compiles them= . alternatively, you yourself can explicitly call the lambda returned by comp= ile. -- =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9CA politician is someone asking you to trust them more with power t= han they trust you with freedom...=E2=80=9D =09=E2=80=94 Kelly Diamond