From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Vladimir Zhbanov Newsgroups: gmane.lisp.guile.user Subject: Re: SRFI-64: test exception symbol Date: Fri, 1 May 2020 22:20:58 +0300 Message-ID: <20200501192058.GA16326@newvzh.lokolhoz> References: <20200430150621.GA16174@newvzh.lokolhoz> <20200430155509.GB16174@newvzh.lokolhoz> <920a5e8d-f1fd-6efa-b57a-9957f76784c6@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="53691"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.10.1 (2018-07-13) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri May 01 21:22:02 2020 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 1jUbEV-000Dqb-T7 for guile-user@m.gmane-mx.org; Fri, 01 May 2020 21:21:59 +0200 Original-Received: from localhost ([::1]:49832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUbEU-0006hh-Up for guile-user@m.gmane-mx.org; Fri, 01 May 2020 15:21:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUbDf-0005r2-Fo for guile-user@gnu.org; Fri, 01 May 2020 15:21:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUbDe-0006CH-KD for guile-user@gnu.org; Fri, 01 May 2020 15:21:07 -0400 Original-Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]:45181) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jUbDe-00069K-1z for guile-user@gnu.org; Fri, 01 May 2020 15:21:06 -0400 Original-Received: by mail-lf1-x12f.google.com with SMTP id f8so4616887lfe.12 for ; Fri, 01 May 2020 12:21:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=03+3Aeb4bEDIQq6YW6m0MyUrUpZRGuioe75OH0DlqWQ=; b=tUH3UymlJ7ymZvahtDm5Fbwt6m1SwofwlW54ex0rvxMa4YMxaWXfSRB0gOIrrcPSeY aBYpYhj7Ruz/hIj6xZOKoWtRf9Az6NiJY+PoYvF8/MpgACWCReOCxq6FS2r+ceQEE3bt /zAmAPj6C4VKR8LWyikCk8xR3Yp4vcN5MVumfiFNHoGONb3GDlC6PeU3cycn7LxjUNZU H//H0YTe3pj3m0lvl+1VG19nvwz2vuYhCrCoXEUeFUtwv4NSz2ax0FGssQm51V2BwfQZ XdqCZJLNenwNgIc7jywz7Ge9EIT2KlCVhZctVT1ALh3e3zrXuHCJdZSFaCm3tj5b2Tx6 Zy3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=03+3Aeb4bEDIQq6YW6m0MyUrUpZRGuioe75OH0DlqWQ=; b=PbT70FCSX4pl89eVTOj5omJWcnSsKDtGYpxs5FLNwDuGwgP/ITIN+A1KrUx99TfReb fYaxHipkBa95z3ekkW9AURehGFM26dDwD0mlWp3ufEL8reMMZgkHOhHw7c0VhPe8E6M9 x2cfWDlUV5bpIyoSWXFXXq787jUMy3HqpkVp1iSISXNiLNvUQZzY6TPP/Bp+9K8bL9Jg zWbpz2yicBoDo0KPJ9HJzIw7vllCAEMItt3rfAklLroK6ifQWK+e9V//XB/VKmk9x7qp 9EhqulAsH9FpaYWWVi5PR0PwiX09XNWZY0J4XeNJbIjXUkWBmtUctMAlrFd6aZYC9LSD KsQw== X-Gm-Message-State: AGi0PuagvdKcQjFJmE6QAmqAUGwCBifWwMn/KpCRg+f2Dj2//QGJ42QO PVsFyP83KGFY4XpGt7rkbAjzPLyX X-Google-Smtp-Source: APiQypI3CP4ERmXA48ezWH/NERZwdtKHBas4oiWUHN4UbQLZbHaFXR0HwFIeFrR3qsTfbqzUOhoGVA== X-Received: by 2002:a19:505c:: with SMTP id z28mr3444913lfj.174.1588360863459; Fri, 01 May 2020 12:21:03 -0700 (PDT) Original-Received: from newvzh.lokolhoz ([95.179.127.224]) by smtp.gmail.com with ESMTPSA id j14sm2773984lfm.73.2020.05.01.12.21.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2020 12:21:02 -0700 (PDT) Original-Received: from vovka by newvzh.lokolhoz with local (Exim 4.92) (envelope-from ) id 1jUbDZ-0006mx-GA for guile-user@gnu.org; Fri, 01 May 2020 22:21:01 +0300 Mail-Followup-To: guile-user@gnu.org Content-Disposition: inline In-Reply-To: <920a5e8d-f1fd-6efa-b57a-9957f76784c6@gmail.com> Received-SPF: pass client-ip=2a00:1450:4864:20::12f; envelope-from=vzhbanov@gmail.com; helo=mail-lf1-x12f.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::12f 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-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16414 Archived-At: Hi Taylan, On Fri, May 01, 2020 at 11:58:41AM +0200, Taylan Kammer wrote: > On 30.04.2020 17:55, Vladimir Zhbanov wrote: > > On Thu, Apr 30, 2020 at 06:06:21PM +0300, Vladimir Zhbanov wrote: > > > Hi, > > > > > > In SRFI-64, is there a way to test what exception raised using > > > test-error() or anything else? I know about looking into test > > > logs (if 'test-error' is used), though that's not what I need. I > > > need a way to be sure a test raises the exception it should raise. > > The test-error form takes two optional operands before the test expression. > It's defined as: > > > > (test-error [[test-name] error-type] test-expr) > > Evaluating test-expr is expected to signal an error. The kind of error is > indicated by error-type. > > If the error-type is left out, or it is #t, it means "some kind of > unspecified error should be signaled". For example: > > (test-error #t (vector-ref '#(1 2) 9)) > > This specification leaves it implementation-defined (or for a future > specification) what form test-error may take, though all implementations > must allow #t. Some implementations may support SRFI-35's conditions, but > these are only standardized for SRFI-36's I/O conditions, which are seldom > useful in test suites. An implementation may also allow > implementation-specific "exception types". For example Java-based > implementations may allow the names of Java exception classes: > > ;; Kawa-specific example > (test-error (vector-ref '#(1 2) 9)) > > An implementation that cannot catch exceptions should skip test-error forms. > > Well, I'm aware of this, thank you :-) > My SRFI-64 implementation allows the error-type operand to be a predicate > (one-argument procedure that returns a Boolean) to allow maximum > flexibility. It's found here: > > https://github.com/TaylanUB/scheme-srfis Thank you, I'd really like to try your implementation together with my code. Though I don't know how :-( The issue with this solution is how I would use the code and integrate it into our project. The first question: supposed that I already have guile installed (together with its own srfi's) and have downloaded your repository, how can I use your modules in my own code then? The second one: how to make your code available for our code in the spread of distributions our project builds on? Probably, there is a way to uniformly integrate some parts of it (e.g. srfi-64) to our project? Or should I require distribution packagers working on packaging of our project to package your code as a some new package, too? Not sure, how to achieve this and if this is possible at all. Any hints? -- Vladimir (λ)επτόν EDA — https://github.com/lepton-eda