From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Abou Samra Newsgroups: gmane.lisp.guile.user Subject: Source location behavior differs in REPL and script? Date: Sun, 24 Jul 2022 14:26:38 +0200 Message-ID: <8929ae87-e67f-e538-8c42-ee537fac8a55@abou-samra.fr> 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="10041"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 To: Guile User Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Jul 24 14:28:25 2022 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 1oFaif-0002SI-FP for guile-user@m.gmane-mx.org; Sun, 24 Jul 2022 14:28:25 +0200 Original-Received: from localhost ([::1]:34214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oFaid-0002bM-Uu for guile-user@m.gmane-mx.org; Sun, 24 Jul 2022 08:28:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFah6-0001kf-M5 for guile-user@gnu.org; Sun, 24 Jul 2022 08:26:48 -0400 Original-Received: from mout.kundenserver.de ([212.227.126.131]:59807) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFah4-0000Xo-VJ for guile-user@gnu.org; Sun, 24 Jul 2022 08:26:48 -0400 Original-Received: from [192.168.1.128] ([82.65.251.18]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.168]) with ESMTPSA (Nemesis) id 1M6DSi-1o8xvU21Xc-006cEu for ; Sun, 24 Jul 2022 14:26:40 +0200 Content-Language: en-US X-Provags-ID: V03:K1:r+Nyr0gYcRFRsTHUCH6+1gfUjl5RmR3E0tw9IqMu8+GP5sHor7X e8oktj4Krf+GIIVElLidj2j/bqNSsCVJohRiHheDcw/4V6YhbU7MZyi7a0f4HPBvfqPPf9V kodY1s7eQ7cUrUewruCeYgXcMYVCU7HUP7cfUuXuxmCWEuUwNcwpQp1eBIGqlJ3/8S9LP68 BXOitXqOkEXUUSy+gUI8A== X-UI-Out-Filterresults: notjunk:1;V03:K0:GDkOw/9vn94=:AuRXcmsCuYZ9EgP7Mi/Ne/ C1BMlgtGcE0+KUzllZa1ZYQGAYmSMv9WY12EgBNQ+UD1IXkKlRWQHfHtYeYRi6eUJfRofI+Ue 1ZKfIKTrE36dDiQ0cUfv7x0NacWweYTiN89m3cFYSvlwqgX1oon+8Z1SDouKY790QHZaPwJx9 PnCv5n6DSvWq2Sw1ulUKTGIdQqzDM7LVpjgr0MBd0Nd+JrTsca8B4KN8dvVGZK7ffAdImjp+1 /rMFP8KNJUuFC/5uNvaF1Q8rimOJSsk4DxHu9ZPTerDGdZDpqoLT2MzClFmBobjWzp0CtsEMa UV5svzDmcmjsuVUe6+uMvOcyBwegnkELoCImNWnp3JNA7VkZHNafxQQoRj9SXZyad3CtE/+dA z/uz5YM4l+yp8+KT0imfIac4XflB8/+1k3pBa6bn6sK4SZfAh0f7yHmUMbqxkpKyn9I89RR0N VthbFWcxpd0UcqfHMmFrO/aiQY1gqj8+fcK82K2xzutJAQKkTEPlc0T72zzbvwvFQyNsQU2Za PcmY7kDXvdk88BIdTRs8YUeqdxNJo3KZvj4Nd0qiloLl4v6GfEmWHv6lQuMDkjF0icNjArXZr lztwOlgHdr24mS0FEtI+UycsSRvBRbYkpJsZSPz9FuEyl2jetM+eJVyqIp2A9/Ty4NgjIOPA4 7sIz4l8l+DFgXbpGHI6oTcX0STPy6iIWGWvXQ0SW6Byr2ztKQ4dxiTyWLlv4PzdGTvuO3PDK4 AQ/rWdRSDy8mJ5oj8oHFe9B/iKOx4rAFq1nDeQ== Received-SPF: none client-ip=212.227.126.131; envelope-from=jean@abou-samra.fr; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" Xref: news.gmane.io gmane.lisp.guile.user:18451 Archived-At: Hi, For context, I'm trying to fix issues with source locations from embedded Scheme code in LilyPond. Essentially, with Guile 2.2, errors are displayed without any source location info because the evaluator doesn't provide them. The compiler does, so I'm investigating whether we can use it. So far, I've been experimenting in the REPL, and tearing my hair because I couldn't get locations to work. My test started to become inconvenient to modify in the REPL at some point, so I switched to putting that code in a .scm file. To my great surprise, that made locations suddenly work. Example: (use-modules (system base compile)) (define code-str   " (begin   (debug-disable 'backtrace)   (define (func1 x)     (func2 x)     (func2 x)     (func2 x))   (define (func2 x)     (display (func3 x))     (write (func3 x))     (map write (func3 x)))   (define (func3 x)     (error \"Oops\"))   (func1 #f))   ") (define code-synt   (call-with-input-string    code-str    (lambda (port)      (set-port-filename! port "fake.scm")      (read-syntax port)))) (compile code-synt) When I paste this in the REPL, the given error is ice-9/boot-9.scm:1685:16: In procedure raise-exception: Oops When I put it in tests.scm and run "guile3.0 tests.scm", the error is fake.scm:15:4: In procedure func1: Oops When I put it in a LilyPond file, the result is Oops (without any location info at all). Does anyone have a clue about what causes these differences? Is it expected? Should I report it as a bug? Also, is there a workaround? Thanks, Jean