Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #11590

Re: minor language RFE(s)

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: minor language RFE(s)
Date 2015-10-08 11:44 -0400
Organization ITS, Case Western Reserve University
Message-ID <mailman.29.1444319096.4386.bug-bash@gnu.org> (permalink)
References <5615ACEF.4040804@tlinx.org>

Show all headers | View raw


On 10/7/15 7:38 PM, Linda Walsh wrote:

> I was thinking ... lets say we had 1 or 2 abbreviation
> keywords, at least 1 being "int=declare -i",
> and ease-of-use "my=declare"
> 
> that could then allow the "declare" of the 'for' iterator
> as local, in-line.
> 
> i.e. instead of predeclaring them w/'declare -i' or 'declare'
> one could write:
> 
>   for((int i=0; i<10; ++i)); do : done
> 
> or 2)
> 
>   for int i in {1..10}; do : done
>   for my i in {a..z}; do : done

These change the syntax of the shell in incompatible ways.  The
arithetic `for' command takes arithmetic expressions, not shell
commands, and the `for' command takes a name (identifier), not a
shell command.  Aside from any syntactic sugar (`int', `my'), these
are not consistent with how the shell grammar is formed, and this
isn't a good enough reason to change the grammar that dramatically.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: minor language RFE(s) Chet Ramey <chet.ramey@case.edu> - 2015-10-08 11:44 -0400

csiph-web