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

Hi!

On Tue 29 Apr 2014 18:33, Doug Evans <xdje42@gmail.com> writes:

> On Sun, Apr 27, 2014 at 6:17 AM, Andy Wingo <wingo@pobox.com> wrote:
>>
>> [...]
>>   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.)

(This SMOB case is egregious because the smob is being accessed with
pair macros -- using macros is fine of course.)

> 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?

One can guard macros in #ifdef BUILDING_LIBGUILE, and it's possible to
deprecate them as well by #defining them to invoke SCM_DEPRECATED
functions.  So in short, as a user, you would know if we wanted to
deprecate something, and anything that's there is fair game,
technically.

So that's the minimum API stability barrier.  The higher barrier is
appearing in the documentation.

> [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.]

This might be a good idea.  Of course deprecation churn is still
unpleasant, so it would have to be a case of actively getting in the way
of some other Guile hacking before SCM_SETCDR could be deprecated in
favor of the (inline) function versions.

Cheers,

Andy
-- 
http://wingolog.org/



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

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-29 16:33 Identifying what's usable in installed headers [was Re: RFC: Foreign objects facility] Doug Evans
2014-04-29 18:33 ` Andy Wingo [this message]
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=878uqougsc.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    --cc=xdje42@gmail.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).