From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Kastrup Subject: Re: [PATCH] Supplant the "while case ... break ;; esac" idiom Date: Mon, 24 Sep 2007 16:10:36 +0200 Message-ID: <86fy14taqr.fsf@lola.quinscape.zz> References: <853ax5mb1j.fsf@lola.goethe.zz> <85myvdktb3.fsf@lola.goethe.zz> <20070924060521.GB10975@glandium.org> <85k5qgk295.fsf@lola.goethe.zz> <86ejgowl5g.fsf@lola.quinscape.zz> <20070924080134.GA9112@artemis.corp> <20070924080436.GB9112@artemis.corp> <87ps08s3zt.fsf@catnip.gol.com> <20070924113556.GI8111@void.codelabs.ru> <87k5qgrxcu.fsf@catnip.gol.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Mon Sep 24 16:18:41 2007 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1IZolh-0000DU-Bi for gcvg-git-2@gmane.org; Mon, 24 Sep 2007 16:18:37 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751988AbXIXOSb (ORCPT ); Mon, 24 Sep 2007 10:18:31 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751935AbXIXOSb (ORCPT ); Mon, 24 Sep 2007 10:18:31 -0400 Received: from main.gmane.org ([80.91.229.2]:42781 "EHLO ciao.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751905AbXIXOSa (ORCPT ); Mon, 24 Sep 2007 10:18:30 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IZohw-0003BC-3q for git@vger.kernel.org; Mon, 24 Sep 2007 14:14:44 +0000 Received: from pd95b0fdb.dip0.t-ipconnect.de ([217.91.15.219]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 24 Sep 2007 14:14:44 +0000 Received: from dak by pd95b0fdb.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 24 Sep 2007 14:14:44 +0000 X-Injected-Via-Gmane: http://gmane.org/ X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: pd95b0fdb.dip0.t-ipconnect.de User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) Cancel-Lock: sha1:tK2ziHh3akALUEYzt26DyNbWvfA= Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: Johannes Schindelin writes: > Hi, > > On Mon, 24 Sep 2007, Miles Bader wrote: > >> Eygene Ryabinkin writes: >> >> The comment "... holds only for a shell where [ is a builtin" doesn't >> >> make any sense to me >> > >> > The 'while case ...' construct does not invoke any external commands. >> > The 'while test ...' too, but only when 'test' is builtin. When >> > 'test' is the external binary you get one additional fork/exec per >> > each cycle. >> >> In practice that's not an issue though -- every reasonable shell has >> test as a builtin these days, so the "works when test is not a builtin" >> criteria is really important only for robustness. > > AAAAAAAAAAAAAARRRRRGGGHHHHHHHHHHHH! > > _Exactly_ the same reasoning can be said about the old code: _every_ > reasonable shell can grok the code that used to be there! There are no known shells that would not grok the proposed code, and the BSD shells don't grok the "code that used to be there". So what point is there in preserving compatibility with some mystical non-specified shell while breaking compatibility with actually existing shells? And by using a less human-readable idiom, to boot? -- David Kastrup