rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* (no subject)
@ 1997-03-04 16:20 erik quanstrom
  1997-03-04 16:28 ` if Suggestion Mark K. Gardner
  0 siblings, 1 reply; 3+ messages in thread
From: erik quanstrom @ 1997-03-04 16:20 UTC (permalink / raw)
  To: mkgardne, rc

>However, I find myself wanting to have an optional else-if clause in the if statement.

huh? this is output from rc-1.4 on sgi

; if (true) {
        echo if
} else if (false) {
        echo else if
} else {
        echo else fallthrough
}
if
; if (false) {
        echo if
} else if (false) {
        echo else if
} else {
        echo else fallthrough
}
else fallthrough
;  if (false) {
        echo if
} else if (true) {
        echo else if
} else {
        echo else fallthrough
}
else if


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: if Suggestion
  1997-03-04 16:20 erik quanstrom
@ 1997-03-04 16:28 ` Mark K. Gardner
  0 siblings, 0 replies; 3+ messages in thread
From: Mark K. Gardner @ 1997-03-04 16:28 UTC (permalink / raw)
  To: quanstro; +Cc: rc

OOPS! (He said as he wipes the egg off of his face.) I guess I had
better avoid posting until I have had a chance to wake up.

IF does indeed work as Erik says. No change necessary.

-- 
Mark K. Gardner (mkgardne@cs.uiuc.edu)
University of Illinois at Urbana-Champaign
Real-Time Systems Laboratory
-- 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* if Suggestion
@ 1997-03-04 14:57 Mark K. Gardner
  0 siblings, 0 replies; 3+ messages in thread
From: Mark K. Gardner @ 1997-03-04 14:57 UTC (permalink / raw)
  To: rc

Since Byron is beginning work on a new official version of RC, I would
like to make a suggestion about the if statement.

One of the things which attracted me to RC initially was its "more
C-like syntax than csh". However, I find myself wanting to have an
optional else-if clause in the if statement. I realize that there are
other ways of expressing the same control flow, but either they look
very cumbersome to me (nested if statements) or I get lost in
complexity of expressions connected by && and ||. Is it heresy to
suggest that we add an optional else-if to the if statement? I am not
opposed to the keyword "elsif" (as used in several other languages) to
avoid the dangling else problem. (There goes the likeness to C!)

-- 
Mark K. Gardner (mkgardne@cs.uiuc.edu)
University of Illinois at Urbana-Champaign
Real-Time Systems Laboratory
-- 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-03-04 16:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-03-04 16:20 erik quanstrom
1997-03-04 16:28 ` if Suggestion Mark K. Gardner
  -- strict thread matches above, loose matches on Subject: below --
1997-03-04 14:57 Mark K. Gardner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).