chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Open question on C binding style


From: Jim Ursetto
Subject: Re: [Chicken-users] Open question on C binding style
Date: Thu, 17 Jul 2008 00:08:12 -0500

On Wed, Jul 16, 2008 at 9:54 PM, Kon Lovett <address@hidden> wrote:
> 1) When there is a one to one mapping between a Scheme variable/constant & a
> C variable/macro-constant/constant/enum should the Scheme symbol naming
> mirror the C naming? Should the C 'SOME_C_LIBRARY_MACCONST' identifier be
> mapped to the Scheme 'SOME_C_LIBRARY_MACCONST', or some Scheme'ish
> 'some-c-library-macconst'?

> 2) A C procedure binding name:  'some_c_func' -> 'foreign-some-c-func' ,
> 'some_c_func', 'C_some_c_func'?

I prefer the scheme style for any exported API.  I use the C style
only for internal stuff which is basically on the bare metal (maybe
using a similar schemely name for a nicer wrapper), or when I really
want to warn the user this is lowlevel stuff.

Example from socket egg, SO_REUSEADDR -> so/reuseaddr (low-level
integer value), and socket-reuse-address (high-level procedure).  Here
I did not happen to use "SO_REUSEADDR" verbatim, though that would
have been acceptable.  I just don't like shouting.

In short, it depends on the egg.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]