"Paul" <-> writes:
> I sometimes think it would be nice if c had an 'also' statement,
> which meant that 'if a preceeding condition was true, do this as well'.
>
> This might save some untidy work-around, or much worse, copy-
> pasting. Let me know if you have a nice neat alternative.
>
> Here's an example of reading a book on weekends, but not weekdays.
> Naturally, there could be many more things done on a weekend.
>
> P.
>
> if (Day == Saturday)
> {
> WalkInPark();
> }
> else if (Day == Sunday)
> {
> AttendChurch();
> }
> also
> {
> ReadABook();
> }
> else
> {
> GoToWork();
> }
See if you can get your church to meet in the park. Even better, if the
park provides seating and sufficient light for reading (which, I guess
would be a prerequisite for holding church services there), your
conditional expression becomes trivial. If the provisions of the C
language are not a good fit to your lifestyle, it is probably simpler to
change your lifestyle than to introduce new keywords into C.
Tony
|