unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Ryan Fox <ryan@rcfox.ca>
To: 10163@debbugs.gnu.org
Subject: bug#10163: Incomplete/vague section of Guile Manual
Date: Tue, 29 Nov 2011 20:17:18 -0500	[thread overview]
Message-ID: <CAGqH21Lf=VGK2So7jce5v7CGCnYpZ09Uyb6_8bbeW_6j0SRMug@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1097 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1288 bytes --]

             reply	other threads:[~2011-11-30  1:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-30  1:17 Ryan Fox [this message]
2011-12-22 14:34 ` bug#10163: Incomplete/vague section of Guile Manual Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGqH21Lf=VGK2So7jce5v7CGCnYpZ09Uyb6_8bbeW_6j0SRMug@mail.gmail.com' \
    --to=ryan@rcfox.ca \
    --cc=10163@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).