On Thu, 17 Nov 2011 17:22:41 +0400, Dmitry Kurochkin <dmitry.kuroch...@gmail.com> wrote: > Hi Tomi. > > On Thu, 17 Nov 2011 14:20:19 +0200, Tomi Ollila <tomi.oll...@iki.fi> 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 _______________________________________________ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch