From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Tue, 28 Aug 2012 14:44:40 -0400 To: 9fans@9fans.net Message-ID: <5538fcd345a73fc294c6ee568f2fcdb4@kw.quanstro.net> In-Reply-To: <3330200.XJjoRb8JbZ@blitz> References: <68ce90976b22bdb0929ccccafef4b7d0@kw.quanstro.net> <3330200.XJjoRb8JbZ@blitz> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] rc's shortcomings (new subject line) Topicbox-Message-UUID: b1c23896-ead7-11e9-9d60-3106f5b1d025 >=20 > switch/case would make helluva difference over nested if/if not, if > defaulted to fall-through. maybe you have an example? because i don't see that. if not works fine, and can be nested. case without fallthrough is also generally what i want. if not, i can make the common stuff a function. > variable scoping (better than subshel) would help writing larger > scripts, but that's not necessarily an improvement ;-) something > similar to LISP's `let' special form, for dynamic binding. there is variable scoping. you can write x=3D() y=3D() cmd cmd can be a function body or whatever. x and y are then private to cmd. you can nest redefinitions. =20 x=3D1 y=3D2 {echo first $x $y; x=3Da y=3Db {echo second $x $y; x=3D=CE=B1= y=3D=CE=B2 {echo third $x $y}; echo ret second $x $y}; echo ret first $x= $y} first 1 2 second a b third =CE=B1 =CE=B2 ret second a b ret first 1 2 you should try the es shell. es had let and some other scheme-y features. let allows one to do all kinds of tricky stuff, like build a shell debugger in the shell, but my opinion is that es was more powerful and fun, but it didn't buy enough because it didn't really expand on the essential nature of a shell. what can one do to manipulate processes and file descriptors. - erik