Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 81832 invoked from network); 27 Sep 2010 18:07:20 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 Sep 2010 18:07:20 -0000 Received: (qmail 32185 invoked by uid 500); 27 Sep 2010 18:07:19 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 32150 invoked by uid 500); 27 Sep 2010 18:07:19 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 32142 invoked by uid 99); 27 Sep 2010 18:07:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Sep 2010 18:07:19 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fdmanana@gmail.com designates 209.85.215.180 as permitted sender) Received: from [209.85.215.180] (HELO mail-ey0-f180.google.com) (209.85.215.180) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Sep 2010 18:07:13 +0000 Received: by eya25 with SMTP id 25so2057251eya.11 for ; Mon, 27 Sep 2010 11:06:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; bh=3ySFd4Odwhrxu44TbeoT3I4ZQ7pEQrjQPAd1sRyPSb0=; b=Fd6gHeAUT90GPgYZdPb7nsJ0mRobdXS3zOdiwnTBuWpe0BN89ob4wrHniJ9iF4Kq1q 5mec8mlu+6fVU5QQ8cRNXYdzIZ6bzAYX9vDXHQmAmW9zeLG1MUvFNIwYk7L1CztLpRdw ES3NZW0mUywLNz5pum1GYs4bQrTRQcpCanA2k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=jnp+TaO3tuCAkMSlHHkoPSeRn8P3aLQ8u4aGoyMasaMtNqA/Uc+dmn7PYrTL1KF0iO ptaLt4eLhCJR2CR5W45A5x04j5xrOn7r645eAzps1xqZUS+8QLfpWbrZFE+DwlXm2kIz R0ZagdmYwLzJUv/W5Ml+S59BDdy/EH37BaLHI= MIME-Version: 1.0 Received: by 10.213.13.142 with SMTP id c14mr6368838eba.84.1285610809203; Mon, 27 Sep 2010 11:06:49 -0700 (PDT) Sender: fdmanana@gmail.com Received: by 10.213.104.131 with HTTP; Mon, 27 Sep 2010 11:06:49 -0700 (PDT) In-Reply-To: References: Date: Mon, 27 Sep 2010 19:06:49 +0100 X-Google-Sender-Auth: 2LJQ0HdLBfrYEf9X-n-z_LcqeEU Message-ID: Subject: Re: adding new macro to couch_db.hrl From: Filipe David Manana To: dev@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Sep 27, 2010 at 7:04 PM, Adam Kocoloski wrote= : > I don't like "get" because it clashes with the auto-imported erlang:get (= for the process dictionary). > > Any reason to prefer a macro over an -import statement? Just to avoid doing the import everywhere and I still consider get_value too long :P > > Adam > > On Sep 27, 2010, at 1:47 PM, Filipe David Manana wrote: > >> Hi, >> >> I'm getting tired of typing couch_util:get_value(......). It also >> consumes too much horizontal space. It's probably the most used >> function from couch_util. >> I'm thinking of adding a new macro in couch_db.hrl, like: >> >> -define(value(Key, List), couch_util:get_value(Key, List)). >> >> -define(value(Key, List, Default), couch_util:get_value(Key, List, Defau= lt)). >> >> Or maybe naming the macro just "get". >> >> Anyone against it? >> >> >> cheers >> >> -- >> Filipe David Manana, >> fdmanana@gmail.com, fdmanana@apache.org >> >> "Reasonable men adapt themselves to the world. >> =C2=A0Unreasonable men adapt the world to themselves. >> =C2=A0That's why all progress depends on unreasonable men." > > --=20 Filipe David Manana, fdmanana@gmail.com, fdmanana@apache.org "Reasonable men adapt themselves to the world. =C2=A0Unreasonable men adapt the world to themselves. =C2=A0That's why all progress depends on unreasonable men."