unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Identifying what's usable in installed headers [was Re: RFC: Foreign objects facility]
@ 2014-04-29 16:33 Doug Evans
  2014-04-29 18:33 ` Andy Wingo
  2014-05-02 11:44 ` Ludovic Courtès
  0 siblings, 2 replies; 7+ messages in thread
From: Doug Evans @ 2014-04-29 16:33 UTC (permalink / raw)
  To: Andy Wingo; +Cc: guile-devel

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-05-05 16:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).