From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <68947f82dd2ff93603d7352019e90b28@quanstro.net> From: erik quanstrom Date: Sat, 5 Aug 2006 23:25:06 -0500 To: 9fans@cse.psu.edu Subject: Re: [9fans] rc break In-Reply-To: <44D506BB.2010901@asgaard.homelinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 97a0c0e6-ead1-11e9-9d60-3106f5b1d025 well, td knows more than i, but doesn't this code look ugly without the benefit of a break statement? fn parseargs { endarg = '' { while(! ~ $#argv 0){ switch($argv(1)^$endarg){ case -r earf r usage case -f earf f usage case * endarg = y cmd = ($cmd $argv(1)) Shift argv } } }} wouldn't this be better fn parseargs { while(! ~ $#argv 0){ switch($argv(1)){ case -r earf r usage case -f earf f usage case * break; } } cmd = $argv; } On Sat Aug 5 16:01:54 CDT 2006, noselasd@asgaard.homelinux.org wrote: > erik quanstrom wrote: > > is there some reason that rc has no "break" statement? > The rc paper has some notes on this : > > "... I deleted the builtins export, readonly, break, continue, read, > return, set, times and unset because they seem redundant or only > marginally useful." > > > for example: > > > > for(i in $fu){ > > ... > > if(endcond) > > break; > > } > > > > - erik >