From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Doug Evans Newsgroups: gmane.lisp.guile.devel Subject: Identifying what's usable in installed headers [was Re: RFC: Foreign objects facility] Date: Tue, 29 Apr 2014 09:33:04 -0700 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1398789201 3968 80.91.229.3 (29 Apr 2014 16:33:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Apr 2014 16:33:21 +0000 (UTC) Cc: guile-devel To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Apr 29 18:33:16 2014 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WfAxy-0005HT-5L for guile-devel@m.gmane.org; Tue, 29 Apr 2014 18:33:10 +0200 Original-Received: from localhost ([::1]:51170 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfAxx-00077e-Oi for guile-devel@m.gmane.org; Tue, 29 Apr 2014 12:33:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfAxt-00071w-Tm for guile-devel@gnu.org; Tue, 29 Apr 2014 12:33:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WfAxs-0002vW-Un for guile-devel@gnu.org; Tue, 29 Apr 2014 12:33:05 -0400 Original-Received: from mail-yk0-x22e.google.com ([2607:f8b0:4002:c07::22e]:51989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfAxs-0002vQ-Pm for guile-devel@gnu.org; Tue, 29 Apr 2014 12:33:04 -0400 Original-Received: by mail-yk0-f174.google.com with SMTP id 20so402402yks.5 for ; Tue, 29 Apr 2014 09:33:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=y9qeU2iu5PBC+xSl9q1IYxMxl63W+IATb1gFV2CtWB4=; b=K8olFWpRrGTTRtdnY3O+s9W2ACXRRaV6jMvg/wmqaFGWGU4hRNkNhLhYTbqyRgU/eD wYKQ6/SHqKSvQMcumcAQ0bgQPZHRjFtA057fh499i0r703xyvksyhfWVoV130cSRQRJB 59xM3MP7iUCQjWAMu/g2ln4mw8ul8qrVNzM94qtJmb9LyJz4p9VTHbqyeOwrFqVstP4X 8zSDJ7ytx4geDs4quVWSX0jFO9aGk2GOPoPe5yCpB5bPf22JpwIwM3eOvw8JRG35do+8 ZiRQbSDmGLUG3SQ2CS0xNFUpRRM5+SMHIdMnfhlC1fKuPzza2LNqEi1LyVXQIWRxuacU UzQQ== X-Received: by 10.236.87.139 with SMTP id y11mr48479120yhe.27.1398789184368; Tue, 29 Apr 2014 09:33:04 -0700 (PDT) Original-Received: by 10.170.214.130 with HTTP; Tue, 29 Apr 2014 09:33:04 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4002:c07::22e X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:17116 Archived-At: On Sun, Apr 27, 2014 at 6:17 AM, Andy Wingo 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.]