|
From: | GNU bug Tracking System |
Subject: | [debbugs-tracker] bug#10163: closed (Incomplete/vague section of Guile Manual) |
Date: | Thu, 22 Dec 2011 14:37:02 +0000 |
Your message dated Thu, 22 Dec 2011 09:34:28 -0500 with message-id <address@hidden> and subject line Re: bug#10163: Incomplete/vague section of Guile Manual has caused the debbugs.gnu.org bug report #10163, regarding Incomplete/vague section of Guile Manual to be marked as done. (If you believe you have received this mail in error, please contact address@hidden) -- 10163: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10163 GNU Bug Tracking System Contact address@hidden with problems
--- Begin Message ---Subject: Incomplete/vague section of Guile Manual Hello, Date: Tue, 29 Nov 2011 20:17:18 -0500
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
--- End Message ---
--- Begin Message ---Subject: Re: bug#10163: Incomplete/vague section of Guile Manual Date: Thu, 22 Dec 2011 09:34:28 -0500 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Hi Ryan, Thanks for the report. On Tue 29 Nov 2011 20:17, Ryan Fox <address@hidden> 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 scm_assert_smob_type() is probably the intended behaviour for > 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 -- http://wingolog.org/
--- End Message ---
[Prev in Thread] | Current Thread | [Next in Thread] |