From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Subject: Elisp programming style Date: Thu, 27 Oct 2011 20:03:22 +0200 Message-ID: <86obx2gvmd.fsf@googlemail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:37330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJUIk-00018b-51 for emacs-orgmode@gnu.org; Thu, 27 Oct 2011 14:03:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJUIi-0005We-RN for emacs-orgmode@gnu.org; Thu, 27 Oct 2011 14:03:38 -0400 Received: from lo.gmane.org ([80.91.229.12]:58695) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJUIi-0005W0-JO for emacs-orgmode@gnu.org; Thu, 27 Oct 2011 14:03:36 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RJUIg-0005DL-L0 for emacs-orgmode@gnu.org; Thu, 27 Oct 2011 20:03:34 +0200 Received: from e178054000.adsl.alicedsl.de ([85.178.54.0]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 27 Oct 2011 20:03:34 +0200 Received: from quintfall by e178054000.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 27 Oct 2011 20:03:34 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi List, doing some Elisp programming (in an orgmode context) recently, the following question with regards to the 'accepted programming style' for Elisp concerned me: How independent and self-sustained should helper functions be? I found some redundancy in elisp code, e.g. several (main and helper) functions that do exactly the same thing to extract the same specific args out of an argument list. My first reaction was, to factor out this extraction into the main function, and then call the helper functions from inside a (let ...) environment where the extracted args are stored in a local variable. But then I recognised, that the helper functions cannot be called independently anymore, but only make sense when called from this one main function with its local bindings. Is there a kind of convention in a case like this? Like: "Make every function, even a helper function, independent, and don't care about redundancy"? Just being curious cheers -- Thorsten