couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filipe David Manana <fdman...@apache.org>
Subject Re: svn commit: r1062772 - /couchdb/trunk/src/couchdb/couch_rep_db_listener.erl
Date Tue, 25 Jan 2011 17:41:42 GMT
On Tue, Jan 25, 2011 at 5:31 PM, Benoit Chesneau <bchesneau@gmail.com> wrote:
>
> Is there any reason you are using named table here ? Why not just use
> ets ids ? Also why using macros ?
>

Yes. Not using the IDs returned by ets:new/2 because that means saving
them in the state and having to pass them to every helper function.
Like this, it makes the code shorter by not passing so many parameters
to each function.
Macros are used because: if you need to change the value (ets table
name), you'll only do it in one place.



-- 
Filipe David Manana,
fdmanana@gmail.com, fdmanana@apache.org

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

Mime
View raw message