From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Taylan Kammer Newsgroups: gmane.lisp.guile.bugs Subject: bug#72379: srfi-64: test-approximate does not handle exceptions Date: Wed, 2 Oct 2024 00:31:16 +0200 Message-ID: <2380f595-59e2-4719-84e7-de80d6bc59cc@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24781"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: Tomas Volf <~@wolfsden.cz>, 72379@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Wed Oct 02 00:33:13 2024 Return-path: Envelope-to: guile-bugs@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 1svlQf-0006AW-9Q for guile-bugs@m.gmane-mx.org; Wed, 02 Oct 2024 00:33:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1svlQW-0003yE-9r; Tue, 01 Oct 2024 18:33:04 -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 1svlQU-0003xt-O1 for bug-guile@gnu.org; Tue, 01 Oct 2024 18:33:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1svlQU-0004gK-EN for bug-guile@gnu.org; Tue, 01 Oct 2024 18:33:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:From:References:MIME-Version:Date:To:Subject; bh=82lUWEShZX4gNzYFIwW4o7yO2JjsEbZOBqxR8Cv8aEg=; b=Dews6wcBY/SuDJ6/fmFC7jcA3OwkLe/VxS6ClqDTXO4Mx8GcYdCATDMPGeFW7vbAnYoA4HsM37iovBrlD+qQ61CJSzGi/His2WiB4YrFxK0MTmChGHQy8gudUJiz+FL3HDya42MGHzRF07GiFT7ZBoLcXobZsKkiR6sL5DlsYsXLXYrjLQjKNLh2C9Q00NUn5xYRyzCzm4eTUBqjOkPxmfsvJUSXN1kTMtH0sVBgqfUFlM5roprDNDcKhTtQm4+W+9k7pQdoZMzrp6ixsTBfrDF4iB+9xIZbIv1I8g5cwRo82IfM+vpAav7xbZaKgidnqdG5+fI8OR3dl9dVFA0zHg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1svlQT-0006MW-SK for bug-guile@gnu.org; Tue, 01 Oct 2024 18:33:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Taylan Kammer Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 01 Oct 2024 22:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72379 X-GNU-PR-Package: guile Original-Received: via spool by 72379-submit@debbugs.gnu.org id=B72379.172782194024425 (code B ref 72379); Tue, 01 Oct 2024 22:33:01 +0000 Original-Received: (at 72379) by debbugs.gnu.org; 1 Oct 2024 22:32:20 +0000 Original-Received: from localhost ([127.0.0.1]:54105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svlPo-0006Lt-2A for submit@debbugs.gnu.org; Tue, 01 Oct 2024 18:32:20 -0400 Original-Received: from mail-ej1-f47.google.com ([209.85.218.47]:41702) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svlPm-0006Ll-BI for 72379@debbugs.gnu.org; Tue, 01 Oct 2024 18:32:18 -0400 Original-Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a8a913874b8so69800166b.2 for <72379@debbugs.gnu.org>; Tue, 01 Oct 2024 15:32:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727821878; x=1728426678; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=82lUWEShZX4gNzYFIwW4o7yO2JjsEbZOBqxR8Cv8aEg=; b=aIXpmsVSNoEHkOA4E3heZX11eoTzWBK20MJvPeyTPRKpNf+utNqemfqP7T6Esdq6DU UKU5MXF6cJWloLdx+OXfpxw9SRTXn8Gx7aWO8LXUM6s8q0gn5pYYeyKdgVIkVQo84fWk FIgOV1cu3PeVY7+k8f0zHSauUVZGwi6QqBDhlg1itAJz4VxNKsyxBBPf4q28P451bc83 M8GXT7H8bRhh7fAfABvOT4m6kHOGIqjJO5z3PvUQ9BAsV7mJVOQFSqEMR9Snjn6vIOoK 3p+G9FGLTsFuN778rpBK4tzMxfEUFL+XKjpL0Xam2qtj8LhdzEHAn9n1pab/zNe+POZu 2jDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727821878; x=1728426678; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=82lUWEShZX4gNzYFIwW4o7yO2JjsEbZOBqxR8Cv8aEg=; b=jI5IzoJLR2C4tzWSuiOAUbhzsFgMY1rowqLHlMR9w14aMfyjkeWApgLzBawcf1PJHK r/8pqIPQi2Fawyo/oGjMkDiCvAsyVotfcrPHC4uxUDo5R9in3Mg5tJbr6R39e0JiwQve pk3wxtR4vdBm/4PaZF4EyqGadDUOYl3eyfRQzH3HckHyjN18wWW8JGEYITb+YgaYXGBK WKAj5e3Vh7P0DAwHs7tZqXAFHElhKpG62ZDDWRIQqli/OLbFZA4sT+Jqtz7p+rHOyCht BlAhV1vUY7uE4MYeyXKMgTT0mL4kvmOQAZg5RFhiJTI3uY2en44TYdhS6RwbYtFm6Ee0 JK9Q== X-Forwarded-Encrypted: i=1; AJvYcCUSB01Jx/LDD2w5hhNN8CwwN1bI32GekWMziSRbSeS4LwoR6IYDlxX+KGfMfIV+6In//Y7fVA==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yw36Nz9TRLNDBx7OGbVJgXR0g7qAbPJ4q7uMBAPpxTJ7TjSpIQx TQp+XL+SYdVssDr+zrKn0oo3RiHKyrFoqnH+/PdMUz7nejVlc8ZfyJ583jWSrDw= X-Google-Smtp-Source: AGHT+IHotghnz6OgQjqlt274w3WmKsCdnJB3XAWf0O7rBnYwihELxJb9BYoDHrfxxQG2zP0Q5lEdIA== X-Received: by 2002:a17:907:7b82:b0:a8a:811e:3fd5 with SMTP id a640c23a62f3a-a98f8238d91mr42999466b.4.1727821877721; Tue, 01 Oct 2024 15:31:17 -0700 (PDT) Original-Received: from ?IPV6:2003:106:8f04:c300:95ac:529d:6db3:196b? (p200301068f04c30095ac529d6db3196b.dip0.t-ipconnect.de. [2003:106:8f04:c300:95ac:529d:6db3:196b]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c27c7130sm765184666b.67.2024.10.01.15.31.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Oct 2024 15:31:17 -0700 (PDT) Content-Language: en-US In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:11010 Archived-At: On 30.07.2024 21:51, Tomas Volf wrote: > Hello, > > I think I found a bug in (srfi srfi-64) module shipped with GNU Guile. > > The specification says that: > >> The test also fails if an exception is raised, assuming the implementation has >> a way to catch exceptions. > Guile has a way to catch exceptions. However nevertheless the following does > not lead to 'fail, but an exception being raised: > > (use-modules (srfi srfi-64)) > (test-begin "x") > (test-approximate 1 (throw 'foo) 1) > > Leading to: > > Backtrace: > In ice-9/boot-9.scm: > 1752:10 8 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _) > In unknown file: > 7 (apply-smob/0 #) > In ice-9/boot-9.scm: > 724:2 6 (call-with-prompt _ _ #) > In ice-9/eval.scm: > 619:8 5 (_ #(#(#))) > In ice-9/boot-9.scm: > 2836:4 4 (save-module-excursion _) > 4388:12 3 (_) > In /home/wolf/src/guile-wolfsden/tests/srfi-64/test-approximate-throw.srfi64test: > 7:0 2 (_) > In srfi/srfi-64/testing.scm: > 677:16 1 (_ _ #f) > In unknown file: > 0 (real-part #f) > > ERROR: In procedure real-part: > In procedure real-part: Wrong type argument in position 1: #f > > Have a nice day > Tomas Volf > > Don't know how to fix this in the reference implementation, which Guile uses, and don't want to bother finding out because it's too over-complicated. Works fine with my implementation, with the output noting that the expected value was `1` and that the actual result was an error being raised instead: taylan@wiki ~/src/scheme-srfis $ GUILE_LOAD_PATH=/home/taylan/src/scheme-srfis/guile-srfi-64 guile GNU Guile 3.0.8 Copyright (C) 1995-2021 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> ,use (srfi srfi-64) ;;; note: source file /home/taylan/src/scheme-srfis/guile-srfi-64/srfi/srfi-64.scm ;;;       newer than compiled /usr/lib/x86_64-linux-gnu/guile/3.0/ccache/srfi/srfi-64.go ;;; found fresh local cache at /home/taylan/.cache/guile/ccache/3.0-LE-8-4.6/home/taylan/src/scheme-srfis/guile-srfi-64/srfi/srfi-64.scm.go scheme@(guile-user)> (test-begin "x") Writing log file: x.srfi64.log Test suite begin: x $1 = #t scheme@(guile-user)> (test-approximate 1 (throw 'foo) 1) [FAIL] x: x #f:2: (throw (quote foo)) Expected value: 1 Raised error: #<&compound-exception components: (#<&error> #<&irritants irritants: ()> #<&exception-with-kind-and-args kind: foo args: ()>)> $2 = #f scheme@(guile-user)> - Taylan