couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <>
Subject Re: code style
Date Thu, 20 Jan 2011 13:59:30 GMT
+1 on moving it to include/ though.

The deeper in I get, the less OTP like couchdb looks to me... :)


On Thu, Jan 20, 2011 at 1:57 PM, Adam Kocoloski <> wrote:
> I'd go a little further.  I think CouchDB should have two include files:
> include/couch_db.hrl (I'd prefer couch.hrl but I think we might be stuck w/ this)
> src/couch_int.hrl (name is not important)
> The first one would contain all record definitions needed to interact with CouchDB from
Erlang.  The second would contain macro definitions and records that are not supposed to
be exported.  Moving couch_db.hrl to include/ would eventually allow other applications to
point to couch_db.hrl using the -include_lib directive instead of specifying the absolute
path to the header.  Regards,
> Adam
> On Jan 20, 2011, at 8:29 AM, Benoit Chesneau wrote:
>> Actually we are using ?b2l/?l2b and some other macros to make the code
>> shorter and ease our development. All these macros are in the main
>> include file couch_db.hrl used everywhere in the code.
>> Since this include will be likely used in CouchDB plugins created by
>> users, I would like to have these kind of macros separated in their
>> own include file. Something common in C world. The main reason is to
>> not pollute namesspacing in external plugins and let them import only
>> what they need, ie couchdb types/records.
>> What do you think about it? Also, not related but maybe it could be a
>> good practice to enforce the use of these macros in all the couchdb
>> codebase like suggest filippe.
>> Any thoughts ?
>> - benoît

View raw message