[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] Closure concept in bash

From: Peng Yu
Subject: Re: [Help-bash] Closure concept in bash
Date: Tue, 31 Jan 2012 15:21:02 -0600

On Tue, Jan 31, 2012 at 12:40 PM, Bob Proulx <address@hidden> wrote:
> Peng Yu wrote:
>> The conclusion is that bash doesn't have closure.
> Correct.  Full stop.  Proceed no further.
>> As of now, I think that closure is missing in bash and it could be a
>> useful feature to be added.
>> Bash need not be a language lacking advanced languages features. Bob
>> mentioned perl, python etc. These language can never beat bash in
>> terms calling shell commands. It will be cool to merge some good
>> features from other languages to bash to make bash better.
> But this MUST NOT HAPPEN.  Bash /does not/ implement functions in the
> same way as these other languages.  If bash were to change so that it
> did implement these features then IT WOULD NO LONGER be the shell.  It
> would be SOMETHING ELSE.  It would be incompatible with forty years of
> shell scripts.

I don't see why closure can not live with current features of bash.
JavaScript has both local, global variables and closure. I don't think
that you statement that bash will be broken if closure is added is
necessarily true. So I will ignore your any further arguments down
below unless you can prove you statement.

Also, my philosophy is that no language is static, to improve
languages it is worthwhile to scrutinize the pros and cons of various
features. Many languages have changed dramatically over the last a few
years. Many code written for older versions has to be updated to catch
up with latest development. There is no reason that bash should not be
improved just because bash should be 100% backward compatible.

I'd like to contribute to bash by raising questions to discuss various
potential features. No matter whether they will accepted or not, I
believe it worthwhile for discussion, isn't it?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]