unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Marius Vollmer <mvo@zagadka.de>
Cc: guile-devel@gnu.org
Subject: Re: API naming bugs
Date: Fri, 30 Dec 2005 21:27:43 +0200	[thread overview]
Message-ID: <873bkawfkg.fsf@zagadka.de> (raw)
In-Reply-To: <1135557850.8094.8.camel@localhost.localdomain> (Andy Wingo's message of "Sun, 25 Dec 2005 19:44:10 -0500")

Andy Wingo <wingo@pobox.com> writes:

> 1) functions that take C types normally are named scm_c_*. There are a
> few exceptions though:

The rule is that scm_c_foo is mostly the same as scm_foo, only with a
different calling convention that is easier for C.  For example, we
have scm_vector_length and scm_c_vector_length.  The former is exactly
'vector-length' and returns the length as a SCM value, while the
latter returns the length as a size_t.

Functions named scm_to_foo and scm_from_foo are concerned with
converting the representation of a value between the SCM and foo
types.  The names are a bit hackish since the scm_ prefix is actually
part of the meaning: "SCM to foo".

The viewpoint of this set of functions is that on one side everything
is represented as SCM and we don't need to say what sub-type of SCM is
actually required or produced.  For example, it simply is scm_to_int,
not scm_number_to_int or scm_exact_integer_to_int or even
scm_exact_integer_that_fits_into_int_to_int ;-).

>  - scm_from_locale_symbol[n] -- here's a confusing name, perhaps
> scm_c_symbol_from_locale_string is more apt

I agree that this is not totally self-describing since there is no
'symbol' type in C.  We silently make the assumption that C-side
symbols would be nul-terminated arrays of characters, just like
strings.

>  - scm_frame_begin, unwind_handler, etc -- should change because there
> is also a SCM-based scm_frame interface

Yeah, that's unfortunate.  we have two things that are termed a
"frame": he things dealt with by scm_frame_begin, etc, and the frames
of a captured stack.  When designing the scm_frame_begin stuff, I
didn't think about those "other" frames, and when I finally noticed
that there is a terminology overlap, ... I refused to think too much
about it since I wanted to use the nice name for my stuff as
well... Hmm.  Ideally, I think the captured stack frames should be
called "stack frames".

Opinions?

> 2) NEWS talks about SCM_FRAME_WIND_EXPLICITELY, but code is (correctly)
> EXPLICITLY

Yep, that's my permanent spelling mistake.  Sometimes I think it is
easier to change the English orthography than to fix my typos.
Thanks!

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2005-12-30 19:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-26  0:44 API naming bugs Andy Wingo
2005-12-30 19:27 ` Marius Vollmer [this message]
2005-12-30 19:54   ` Neil Jerram
2006-01-28 22:54     ` Marius Vollmer

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=873bkawfkg.fsf@zagadka.de \
    --to=mvo@zagadka.de \
    --cc=guile-devel@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).