Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 90A32429E28 for ; Thu, 17 Nov 2011 06:03:01 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BsjM7AEXGju4 for ; Thu, 17 Nov 2011 06:03:01 -0800 (PST) Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id B885C429E27 for ; Thu, 17 Nov 2011 06:03:00 -0800 (PST) Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31]) by taco2.nixu.fi (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id pAHE2kSG005902; Thu, 17 Nov 2011 16:02:46 +0200 From: Tomi Ollila To: Dmitry Kurochkin , Tomi Ollila , Jameson Graef Rollins , notmuch@notmuchmail.org Subject: Re: [PATCH 0/9] test: (hopefully) better test prerequisites In-Reply-To: <8739dmopcu.fsf@gmail.com> References: <1321494986-18998-1-git-send-email-dmitry.kurochkin@gmail.com> <874ny36rhc.fsf@servo.finestructure.net> <8739dmopcu.fsf@gmail.com> User-Agent: Notmuch/0.9+73~ged20210 (http://notmuchmail.org) Emacs/23.3.1 (i686-pc-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 14:03:01 -0000 On Thu, 17 Nov 2011 17:22:41 +0400, Dmitry Kurochkin wrote: > Hi Tomi. > > On Thu, 17 Nov 2011 14:20:19 +0200, Tomi Ollila wrote: > > > > I.e. dynamically, at run-time, re-create test_emacs function... > > > > Could you please add some human-friendly description on what benefits > the code above has? :) "All problems in computer science can be solved by another level of indirection" > The only change I see (besides code refactoring) is 30sec timeout (BTW > you can replace the list of numbers with "seq 30") instead of infinite > wait loop. Which may be a good, but unrelated change. Can't do `seq 30` it is not portable. BSD world uses different command. > As for re-creating functions dynamically, I find the above code more > complex than the existing one. I think the current code is more > shell-style and easier to understand. Just IMHO. Think it as a function pointer (I should have renamed that as test_emacs_p ;) Shell is hyper-dynamic being (like python). New functionality can be written 'on-the-fly' inside functions (often without eval) Even variables can be referenced as function names. Hmm, even perl4 has this way of working supported... IMHO it is simpler when one get's used to. ... just that the test "framework" needs some refactoring... along the way all of these "practises" should be defined. code style, variable names consistency, etc... You've done good work with this 'prereq' -thing. It's just hard to see the elegance here. I know this very well as I have to maintain my own 'evolutionary' developed code -- when priority is on short-term cost savings over code consistency.. > > Regards, > Dmitry > > > > > Tomi Tomi