From unknown Sun Jun 22 13:37:29 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10163: Incomplete/vague section of Guile Manual Resent-From: Ryan Fox Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 30 Nov 2011 01:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 10163 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 10163@debbugs.gnu.org X-Debbugs-Original-To: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.132261709728483 (code B ref -1); Wed, 30 Nov 2011 01:39:02 +0000 Received: (at submit) by debbugs.gnu.org; 30 Nov 2011 01:38:17 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RVZ7n-0007PK-GK for submit@debbugs.gnu.org; Tue, 29 Nov 2011 20:38:16 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RVYnh-0006uO-MS for submit@debbugs.gnu.org; Tue, 29 Nov 2011 20:17:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RVYnf-0000VY-Ob for submit@debbugs.gnu.org; Tue, 29 Nov 2011 20:17:28 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:50749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVYnf-0000VU-LJ for submit@debbugs.gnu.org; Tue, 29 Nov 2011 20:17:27 -0500 Received: from eggs.gnu.org ([140.186.70.92]:50763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVYne-0008H0-4T for bug-guile@gnu.org; Tue, 29 Nov 2011 20:17:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RVYnc-0000Uv-Ay for bug-guile@gnu.org; Tue, 29 Nov 2011 20:17:26 -0500 Received: from mail-bw0-f41.google.com ([209.85.214.41]:48210) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVYnc-0000Uf-0n for bug-guile@gnu.org; Tue, 29 Nov 2011 20:17:24 -0500 Received: by bke17 with SMTP id 17so124393bke.0 for ; Tue, 29 Nov 2011 17:17:22 -0800 (PST) Received: by 10.205.122.76 with SMTP id gf12mr1806057bkc.26.1322615842259; Tue, 29 Nov 2011 17:17:22 -0800 (PST) Received: from mail-bw0-f41.google.com (mail-bw0-f41.google.com [209.85.214.41]) by mx.google.com with ESMTPS id h7sm454805bkw.12.2011.11.29.17.17.19 (version=SSLv3 cipher=OTHER); Tue, 29 Nov 2011 17:17:21 -0800 (PST) Received: by bke17 with SMTP id 17so124320bke.0 for ; Tue, 29 Nov 2011 17:17:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.13.70 with SMTP id b6mr53764737bka.78.1322615838562; Tue, 29 Nov 2011 17:17:18 -0800 (PST) Received: by 10.204.62.3 with HTTP; Tue, 29 Nov 2011 17:17:18 -0800 (PST) Date: Tue, 29 Nov 2011 20:17:18 -0500 Message-ID: From: Ryan Fox Content-Type: multipart/alternative; boundary=00151750da4a3b58e904b2e97f30 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -6.6 (------) X-Mailman-Approved-At: Tue, 29 Nov 2011 20:38:14 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) --00151750da4a3b58e904b2e97f30 Content-Type: text/plain; charset=ISO-8859-1 Hello, In section 5.7.1.4, "Writing Guile Primitives for Dia" at http://www.gnu.org/software/guile/manual/guile.html, the description of the square_p() implementation is incomplete. It uses a macro call to ensure that the SCM value is a shape, but does not explain what that implementation is: /* Check that arg is really a shape SMOB. */ SCM_VALIDATE_SHAPE (SCM_ARG1, shape); The explanation merely states: "SCM_VALIDATE_SHAPE is a macro that you should define as part of your SMOB definition: it checks that the passed parameter is of the expected type." After some searching, I was able to figure out that the function scm_assert_smob_type() is probably the intended behaviour for this. However, there was no indication of this in the description. As a side note: I'm a new Schemer, so perhaps this isn't idiomatic, but would it make more sense to use the SCM_SMOB_PREDICATE macro instead? This way, you can simply return false for any type, even if it isn't a shape. Asking if a number is a shape (for example) doesn't strike me as particularly exceptional or incorrect. Thanks, Ryan Fox --00151750da4a3b58e904b2e97f30 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello,
In section=A05.7.1.4, "Writing Guile Primitives for Dia"= ; at=A0http= ://www.gnu.org/software/guile/manual/guile.html, the description of the= square_p() implementation is incomplete. It uses a macro call to ensure th= at the SCM value is a shape, but does not explain what that implementation = is:

/* Check that arg is really a shape SMOB. */
SCM_VALIDATE_SHAPE (SCM= _ARG1, shape);

The explanation merely states:
"SCM_VALIDATE_= SHAPE=A0is a macro that you should define as part of your SMOB definition: = it checks that the passed parameter is of the expected type."

After some searching, I was able to figure out that the function=A0scm_= assert_smob_type() is probably the intended behaviour for this. However, th= ere was no indication of this in the description.

As a side note: I&= #39;m a new Schemer, so perhaps this isn't idiomatic, but would it make= more sense to use the=A0SCM_SMOB_PREDICATE macro instead? This way, you ca= n simply return false for any type, even if it isn't a shape. Asking if= a number is a shape (for example) doesn't strike me as particularly ex= ceptional or incorrect.

Thanks,
Ryan Fox

--00151750da4a3b58e904b2e97f30-- From unknown Sun Jun 22 13:37:29 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Ryan Fox Subject: bug#10163: closed (Re: bug#10163: Incomplete/vague section of Guile Manual) Message-ID: References: <87wr9opte3.fsf@pobox.com> X-Gnu-PR-Message: they-closed 10163 X-Gnu-PR-Package: guile Reply-To: 10163@debbugs.gnu.org Date: Thu, 22 Dec 2011 14:37:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1324564622-9867-1" This is a multi-part message in MIME format... ------------=_1324564622-9867-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #10163: Incomplete/vague section of Guile Manual which was filed against the guile package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 10163@debbugs.gnu.org. --=20 10163: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D10163 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1324564622-9867-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 10163-done) by debbugs.gnu.org; 22 Dec 2011 14:36:51 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RdjlH-0002Yj-Nx for submit@debbugs.gnu.org; Thu, 22 Dec 2011 09:36:51 -0500 Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62] helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RdjlB-0002YY-Jd for 10163-done@debbugs.gnu.org; Thu, 22 Dec 2011 09:36:46 -0500 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id E5F2D8796; Thu, 22 Dec 2011 09:34:30 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=ZkLVlSdNyPC6 DeLlZv3S5xKGcUc=; b=fwpLJAQtNXbARUs/ZWgDaJHe8+8kGDT+87tL5gnheXVm i/qAoe8/leGHRJm1SUl9HFWkDzbJVX3nlOzYr/wHYk3Yo+AQp7NmVxQbjg/SfoKv ocahPfOg9bXyqhoroyG3jTuKH4umjyaEBi4bFwNqEMx8zShYHIBPy4Vfoj9BpFs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=xcqfgh 38yIZ4BGiMj7hcjy7V7+5nsj6lyk+Pqv0OC1R3yDnOoY4te0Ptez+tWPXafz+R/1 SxOUB12p84BVVFRLffpzdzc8UA9CLUvk0iRQtx6O3UyINrvUI4bchZ2YBaX1RdjL 5seDIsDpwzNXYZpOs3rQQZyi16DXKi9PwTpNM= Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id DFED38795; Thu, 22 Dec 2011 09:34:30 -0500 (EST) Received: from badger (unknown [184.174.165.119]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 7C4878794; Thu, 22 Dec 2011 09:34:30 -0500 (EST) From: Andy Wingo To: Ryan Fox Subject: Re: bug#10163: Incomplete/vague section of Guile Manual References: Date: Thu, 22 Dec 2011 09:34:28 -0500 In-Reply-To: (Ryan Fox's message of "Tue, 29 Nov 2011 20:17:18 -0500") Message-ID: <87wr9opte3.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Pobox-Relay-ID: 0EFDCB0A-2CAA-11E1-8FE5-65B1DE995924-02397024!a-pb-sasl-sd.pobox.com X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 10163-done Cc: 10163-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) Hi Ryan, Thanks for the report. On Tue 29 Nov 2011 20:17, Ryan Fox writes: > /* Check that arg is really a shape SMOB. */ > SCM_VALIDATE_SHAPE (SCM_ARG1, shape); > > After some searching, I was able to figure out that the > function=C2=A0scm_assert_smob_type() is probably the intended behaviour f= or > this. However, > there was no indication of this in the description. I changed the example and the text to use scm_assert_smob_type. This entire section could use some modernization and less hand-waving, but that is a larger project. Happy hacking, Andy --=20 http://wingolog.org/ ------------=_1324564622-9867-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 30 Nov 2011 01:38:17 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RVZ7n-0007PK-GK for submit@debbugs.gnu.org; Tue, 29 Nov 2011 20:38:16 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RVYnh-0006uO-MS for submit@debbugs.gnu.org; Tue, 29 Nov 2011 20:17:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RVYnf-0000VY-Ob for submit@debbugs.gnu.org; Tue, 29 Nov 2011 20:17:28 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:50749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVYnf-0000VU-LJ for submit@debbugs.gnu.org; Tue, 29 Nov 2011 20:17:27 -0500 Received: from eggs.gnu.org ([140.186.70.92]:50763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVYne-0008H0-4T for bug-guile@gnu.org; Tue, 29 Nov 2011 20:17:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RVYnc-0000Uv-Ay for bug-guile@gnu.org; Tue, 29 Nov 2011 20:17:26 -0500 Received: from mail-bw0-f41.google.com ([209.85.214.41]:48210) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVYnc-0000Uf-0n for bug-guile@gnu.org; Tue, 29 Nov 2011 20:17:24 -0500 Received: by bke17 with SMTP id 17so124393bke.0 for ; Tue, 29 Nov 2011 17:17:22 -0800 (PST) Received: by 10.205.122.76 with SMTP id gf12mr1806057bkc.26.1322615842259; Tue, 29 Nov 2011 17:17:22 -0800 (PST) Received: from mail-bw0-f41.google.com (mail-bw0-f41.google.com [209.85.214.41]) by mx.google.com with ESMTPS id h7sm454805bkw.12.2011.11.29.17.17.19 (version=SSLv3 cipher=OTHER); Tue, 29 Nov 2011 17:17:21 -0800 (PST) Received: by bke17 with SMTP id 17so124320bke.0 for ; Tue, 29 Nov 2011 17:17:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.13.70 with SMTP id b6mr53764737bka.78.1322615838562; Tue, 29 Nov 2011 17:17:18 -0800 (PST) Received: by 10.204.62.3 with HTTP; Tue, 29 Nov 2011 17:17:18 -0800 (PST) Date: Tue, 29 Nov 2011 20:17:18 -0500 Message-ID: Subject: Incomplete/vague section of Guile Manual From: Ryan Fox To: bug-guile@gnu.org Content-Type: multipart/alternative; boundary=00151750da4a3b58e904b2e97f30 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 29 Nov 2011 20:38:14 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) --00151750da4a3b58e904b2e97f30 Content-Type: text/plain; charset=ISO-8859-1 Hello, In section 5.7.1.4, "Writing Guile Primitives for Dia" at http://www.gnu.org/software/guile/manual/guile.html, the description of the square_p() implementation is incomplete. It uses a macro call to ensure that the SCM value is a shape, but does not explain what that implementation is: /* Check that arg is really a shape SMOB. */ SCM_VALIDATE_SHAPE (SCM_ARG1, shape); The explanation merely states: "SCM_VALIDATE_SHAPE is a macro that you should define as part of your SMOB definition: it checks that the passed parameter is of the expected type." After some searching, I was able to figure out that the function scm_assert_smob_type() is probably the intended behaviour for this. However, there was no indication of this in the description. As a side note: I'm a new Schemer, so perhaps this isn't idiomatic, but would it make more sense to use the SCM_SMOB_PREDICATE macro instead? This way, you can simply return false for any type, even if it isn't a shape. Asking if a number is a shape (for example) doesn't strike me as particularly exceptional or incorrect. Thanks, Ryan Fox --00151750da4a3b58e904b2e97f30 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello,
In section=A05.7.1.4, "Writing Guile Primitives for Dia"= ; at=A0http= ://www.gnu.org/software/guile/manual/guile.html, the description of the= square_p() implementation is incomplete. It uses a macro call to ensure th= at the SCM value is a shape, but does not explain what that implementation = is:

/* Check that arg is really a shape SMOB. */
SCM_VALIDATE_SHAPE (SCM= _ARG1, shape);

The explanation merely states:
"SCM_VALIDATE_= SHAPE=A0is a macro that you should define as part of your SMOB definition: = it checks that the passed parameter is of the expected type."

After some searching, I was able to figure out that the function=A0scm_= assert_smob_type() is probably the intended behaviour for this. However, th= ere was no indication of this in the description.

As a side note: I&= #39;m a new Schemer, so perhaps this isn't idiomatic, but would it make= more sense to use the=A0SCM_SMOB_PREDICATE macro instead? This way, you ca= n simply return false for any type, even if it isn't a shape. Asking if= a number is a shape (for example) doesn't strike me as particularly ex= ceptional or incorrect.

Thanks,
Ryan Fox

--00151750da4a3b58e904b2e97f30-- ------------=_1324564622-9867-1--