From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: sidhu1f Newsgroups: gmane.lisp.guile.user Subject: Re: Error in error? Date: Thu, 22 Sep 2022 04:47:59 +0530 Message-ID: References: <4d5e13c9-bca7-bbf6-8a39-58160096a895@telenet.be> 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="19892"; mail-complaints-to="usenet@ciao.gmane.io" Cc: linus.internet@fastmail.se, maximedevos@telenet.be To: Guile user Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Thu Sep 22 01:21:40 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 1ob92C-00051g-BR for guile-user@m.gmane-mx.org; Thu, 22 Sep 2022 01:21:40 +0200 Original-Received: from localhost ([::1]:45384 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ob92B-0007hp-9i for guile-user@m.gmane-mx.org; Wed, 21 Sep 2022 19:21:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55368) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ob8yv-0003zS-NG for guile-user@gnu.org; Wed, 21 Sep 2022 19:18:19 -0400 Original-Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]:41915) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ob8yt-0002dq-6z for guile-user@gnu.org; Wed, 21 Sep 2022 19:18:17 -0400 Original-Received: by mail-pf1-x435.google.com with SMTP id l65so7501097pfl.8 for ; Wed, 21 Sep 2022 16:18:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date; bh=p9eFZR7Gxypv/vZ7ZWMYxCrwtippEQw2vnL2MHrK01o=; b=QODWVeoPoW9kqDR/GbHIIm+u+8+ZMdAcGEHPaiY9gNlIR+J+j2DCMP/X25cZvHz389 k0fx49JsZyN0o9zqWWWTuxJfM0bQRKtYPQA/DrfrTwZaSMxyoaJx4SmymIlCYcDbamSk e5WjQwxcZLHA/oGnnrPglRYdJNDUL2kJuCPc8AZxTjX75SWjkoTwTspuZrgy1mBt1fwt vZW3TS5smnhKFh4KfM1q7gFXNLgPjOBUrANt8FuULZRK2U8vUzh0jofsVHY8Q5SO5+yz Ri4/sXs2A8AFhDa7dGdxRQZ/E7sSl7OJ9o6ZXromzQjj0WqDHRmqtv1LuKodEiqXd7dD vgeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=p9eFZR7Gxypv/vZ7ZWMYxCrwtippEQw2vnL2MHrK01o=; b=izCWFbkOM3vNzDYCtUMm4ggEpjdTX+Auci6a4vC43ubP8KZMD3icxXXiXygDUntsID Ge15+PoYLSYGKn03ViXVrRWrpawd7EIDVLvVp+/Nbq8uallRdKXu82kr85hM7RwfwmtH YdBrr+o7TqmtHKftjP/Q3hcJeqftJ4QWdEw774iQw6MPNVRUU/m9ULKfLWXFAssjPAcL hkj48DLjnHFvqtCHnoksR6JeAk7gbwS4Z0+kcxWp29T1hstfYCHj4qEV08BzBdkiRZ8m sOA+nuDROXlfT4vBPIVeUsd0nBuFIMzrzybMPJQoPz+pL0cKZ/p1RADdKQ4H6e2u6JCU xC7Q== X-Gm-Message-State: ACrzQf0455+dFIOAChTGxaPKhELEXf5JpQ8W8dOE6r8eq7zHM75H7dvg tFeumuLk1NEIKMe/d8oUxPTU+TLtr+apHIfWrFBPwXzDP8M= X-Google-Smtp-Source: AMsMyM6n6P4CQC3nVTT37FZaWvptMEv5XIFg8U4kHpu70FsJyl0iKRJY6awaoMqH6rIg2cOK/07a+6JQ4qyd38heqTE= X-Received: by 2002:a62:3384:0:b0:538:58ab:8fee with SMTP id z126-20020a623384000000b0053858ab8feemr449359pfz.7.1663802290958; Wed, 21 Sep 2022 16:18:10 -0700 (PDT) In-Reply-To: <4d5e13c9-bca7-bbf6-8a39-58160096a895@telenet.be> Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=sidhu1f@gmail.com; helo=mail-pf1-x435.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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:18600 Archived-At: On Fri, 19 Aug 2022 19:46:11 +0530, Linus Bj=C3=B6rnstam wrote: > > The error I find in the manual is: > > Scheme Procedure: error msg arg =E2=80=A6 > > Raise an error with key misc-error and a message constructed by displ= aying msg and writing arg .... > > Where are you getting your info? On Sat, 20 Aug 2022 02:09:59 +0530, Maxime Devos wrote: > > (scm-error 'misc-error 'the-procedure-name "foo ~a" '("args") '()) > > The documentation in the manual is a bit confusing -- as 'scm-error' > is mentioned right after 'error', you might easily read "message > constructed by displaying msg and writing arg" as "it displays and > writes using 'format' on msg and the arg ...". Some room for > improvement there. You are both correct. My motivation was to use the assert macro from guile-libs (www.nongnu.org/guile-lib/doc/ref/debugging.assert/). In assert.scm (version 0.2.7), the error procedure invocation on line 62 uses "~a". So should this invocation be replaced by scm-error instead? My thanks to authors of both responses. Regards sidhu1f On Sat, Aug 20, 2022 at 2:10 AM Maxime Devos wrote= : > > > On 19-08-2022 01:44, sidhu1f wrote: > > According to the guile (version 3.0.7) reference manual, (error "foo > > ~a" 'bar) should output "foo bar" but instead the output is "foo ~a > > bar". Am I missing something or is there a bug in error? > > You might need 'scm-error' instead: > > (scm-error 'misc-error 'the-procedure-name "foo ~a" '("args") '()) > > The documentation in the manual is a bit confusing -- as 'scm-error' is > mentioned right after 'error', you might easily read "message > constructed by displaying msg and writing arg" as "it displays and > writes using 'format' on msg and the arg ...". Some room for improvement > there. > > Greetings, > Maxime >