unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Doug Evans <xdje42@gmail.com>
To: Andy Wingo <wingo@pobox.com>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Identifying what's usable in installed headers [was Re: RFC: Foreign objects facility]
Date: Tue, 29 Apr 2014 09:33:04 -0700	[thread overview]
Message-ID: <CAP9bCMT1ibawK14WMn0Od7+n6T-an9M+hH2D8M_KGwiMmc-DNw@mail.gmail.com> (raw)

On Sun, Apr 27, 2014 at 6:17 AM, Andy Wingo <wingo@pobox.com> wrote:
> Hi,
>
> SMOBs have a few problems.
>
> [...]
>   7) There is legacy code out there that uses e.g. SCM_SETCDR to set
>      smob fields.  (This is terrible, but it exists:
>      https://github.com/search?q=SCM_SETCDR+smob&ref=cmdform&type=Code
>      for an example.)

Hi.
While it's on my mind I thought I'd write it down.

While function declarations are markable as being internal/external in
published headers (SCM_INTERNAL vs SCM_API), macros are not.
IWBN to solve this problem for macros too.  If it's in a header and a
user can get it to work, s/he may just use it - some macros are indeed
usable, so how does one easily know while reading headers (users will
do that a lot) which are legitimately usable and which are not?

There are various ways to solve this, I don't have a strong opinion on
that, but IWBN to solve it.
Setting aside moving internal things to separate headers (which feels
more expensive than it's worth), one could just wrap them in
appropriate #ifs.

[P.S. I'm not sure if SCM_SETCDR is still intended to be usable, I
wouldn't mind deprecating it, and only publishing the function
versions.  I can imagine it being ubiquitous enough in existing code
that that's not possible, even if one wanted to.  At any rate that's a
separate discussion.  Its presence in the foreign object discussion
just reminded me of macros in headers.]



             reply	other threads:[~2014-04-29 16:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-29 16:33 Doug Evans [this message]
2014-04-29 18:33 ` Identifying what's usable in installed headers [was Re: RFC: Foreign objects facility] Andy Wingo
2014-05-02 11:44 ` Ludovic Courtès
2014-05-02 18:34   ` Doug Evans
2014-05-02 23:19     ` Ludovic Courtès
2014-05-03  4:18       ` Doug Evans
2014-05-05 16:03         ` Ludovic Courtès

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=CAP9bCMT1ibawK14WMn0Od7+n6T-an9M+hH2D8M_KGwiMmc-DNw@mail.gmail.com \
    --to=xdje42@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=wingo@pobox.com \
    /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).