From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Taylan Kammer Newsgroups: gmane.lisp.guile.user Subject: Re: srfi-64 apathetic test-error Date: Thu, 24 Oct 2019 18:50:01 +0200 Message-ID: References: <1571805467.17453.2.camel@librehacker.com> <5d7fb138-a870-826f-2a68-a539c90da813@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="158844"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 Cc: christopher@librehacker.com To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Oct 24 19:50:32 2019 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iNhFj-000f5X-Mp for guile-user@m.gmane.org; Thu, 24 Oct 2019 19:50:27 +0200 Original-Received: from localhost ([::1]:49346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNhFi-00025X-DM for guile-user@m.gmane.org; Thu, 24 Oct 2019 13:50:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34173) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNgJJ-0006Z6-7s for guile-user@gnu.org; Thu, 24 Oct 2019 12:50:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNgJH-0001Mk-Ny for guile-user@gnu.org; Thu, 24 Oct 2019 12:50:04 -0400 Original-Received: from mail-ed1-x541.google.com ([2a00:1450:4864:20::541]:39794) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNgJH-0001MR-H2 for guile-user@gnu.org; Thu, 24 Oct 2019 12:50:03 -0400 Original-Received: by mail-ed1-x541.google.com with SMTP id l25so7936148edt.6 for ; Thu, 24 Oct 2019 09:50:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=wlRdX+za6m9BThLk6j32ec190FwdMOCHsGHK2egJBIA=; b=JAdOaNqwES1FsqDufFyuw+GG0o0xVzpIJc70ro4wFnDBsksUHQ/jaNda5zDi0vfEob 28T22331WZoDDNX89pzH4Y1FPnE4qtwoS+zkX16xdxlONyQFoiDMyQSJNA3+lssjNP9A sNS+R6zwgFghpAhh5shT6QPCoCXhWHVHRWjgoUsShlq/+X1856N13P9FK7xyPcw8KvSv 1fL8cFP0waYrQfb2Mib0gkzFx649RRc2Kepl0puSQeX0FasegkvXD8qT1091/DMc3rZ0 2vAyFDPCW7zN3AjFNAE6HeuFJOP/mZ/tpsc6DDHBY5NYqoD7hEHY+KDRtfkYZh84t177 vGnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=wlRdX+za6m9BThLk6j32ec190FwdMOCHsGHK2egJBIA=; b=RzaXid7aA+MC7tQGgar3KVr38AYIN9F3He7+WCJmVe/yd3IfqhDeBxtiPclpF8Z2h6 khjJ9eOQFxXtcrFHVUXN9LCZ9WPFsVsML1UG234X5QYthjQlF9ejmjwlv518gDyXxTuh kMBNrBwKRRxb1H1XLyOCZLOqec6DVMq4h9Z0EIE/HBO9xtVzMKZ0mkBypMz1JUDgNYJX uvoAq6pyulRKMA/z+eSQEAw/a7/1lntVAATCQF9GUvrvP+7zgC5NmgtHk5l2WOYN05y3 QZN7v2yGU3JgeOHLY9hDwurGzkVUdxnhwHfuqCDKWcvQLdRIeYct65UbzYi6fgIsRqHl Be7Q== X-Gm-Message-State: APjAAAXyEIeJyAZ91i7I8XA8h9lWewlu6H8Kqtl/UrRpnlZdlbQvYbsU iFvIVF4oBeovahWQFyYeXoVYnJg4 X-Google-Smtp-Source: APXvYqxJMB/goCM4agZpDa3NgFgxdCAFwoDMM1QbO7xknT1AeRLh8hH9i8hnhc/GTLJ34lSIaEMuzA== X-Received: by 2002:a05:6402:13c5:: with SMTP id a5mr25572483edx.106.1571935802416; Thu, 24 Oct 2019 09:50:02 -0700 (PDT) Original-Received: from [192.168.16.136] (p50975d3f.dip0.t-ipconnect.de. [80.151.93.63]) by smtp.gmail.com with ESMTPSA id oh23sm69673ejb.9.2019.10.24.09.50.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Oct 2019 09:50:01 -0700 (PDT) In-Reply-To: <5d7fb138-a870-826f-2a68-a539c90da813@gmail.com> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::541 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 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.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:15828 Archived-At: Sorry, I said something wrong in my previous email. The SRFI-64 specification does not mention the possibility of providing an arbitrary predicate. That's a feature supported by my R7RS-based implementation of SRFI-64: https://github.com/TaylanUB/scheme-srfis/tree/master/srfi/64 (The file 'execution.body.scm' contains most of the logic.) I've tried to figure out what the reference implementation supports but the code is overly complicated. There's a comment saying "TODO: decide how to specify expected error types for Guile" which makes me think it doesn't support Guile that well. I think it doesn't actually use the "error-type" information at all in the case of Guile and just matches all errors it catches and considers them correct. See lines 800 to 818 here: http://git.savannah.gnu.org/cgit/guile.git/tree/module/srfi/srfi-64/testing.scm Last time I suggested Guile to adopt my SRFI-64 implementation, it was argued against on the grounds that it's not been around as long as the reference implementation and therefore possibly less stable. Maybe I should try again, because IMO the reference implementation is written in a terrible style that makes it very difficult to comprehend and improve. - Taylan On 24.10.2019 18:18, Taylan Kammer wrote: > On 23.10.2019 06:37, Christopher Howard wrote: >> Hi, I was just wondering: `test-error' from (srfi srfi-64) gives a pass >> if it catches an exception, but it doesn't seem to care whether or not >> the exception caught matches what you told it to expect. Is this a bug? > > The (test-error ...) form takes an optional "error-type" operand. It > can be an arbitrary predicate (one-argument procedure that returns a > Boolean value) which tests if the error is the expected kind. > > See here for a complete documentation of the SRFI-64 API: > > https://srfi.schemers.org/srfi-64/srfi-64.html > > - Taylan >