MUD-Dev
mailing list archive
[ Other Periods
| Other mailing lists
| Search
]
Date:
[ Previous
| Next
]
Thread:
[ Previous
| Next
]
Index:
[ Author
| Date
| Thread
]
Re: [MUD-Dev] Languages
[Chris L:]
:A key part of C's use of braces is implicit in the base design of the
:language (and obvious when looking at the BNF diagram). In C, any place
:that a statement can be used (in a non-expression context), a pair of
:braces containing one or more statements can be used instead. Its a
:slightly subtle and very pleasing piece of orthogonality, and is why:
[Example deleted]
Yep, that's true. However, it is also the cause of some of the problems
in C. It can be a pain to see something like this filling up some of your
window:
}
}
}
}
}
I find myself getting lost a lot less often if it is instead:
fi;
od;
od;
fi;
corp;
The compiler can recover a lot better, too, and often report errors more
reliably/understandably. This is one of those language-religion things
that everyone has their own view on. Food for endless debate! :-)
:There are lots of other more interesting examples, such as creating very
:locally scoped automatics:
No reason you can't do that with the keyword stuff - they can introduce a
new scope as well. I can't resist adding that
if a < b then
f();
g();
fi;
has one less token in it than
if (a < b) {
f();
g();
}
:-) (And three more characters, although they are not shifted.)
--
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA
- Thread context:
- Re: [MUD-Dev] Languages, (continued)
- Re: [MUD-Dev] Languages,
Jon A. Lambert jlsysinc#ix,netcom.com, Sun 18 May 1997, 00:32 GMT
- Re: [MUD-Dev] Languages,
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA, Mon 19 May 1997, 00:17 GMT
- Re: [MUD-Dev] Languages,
Jeff Kesselman jeffk#tenetwork,com, Mon 19 May 1997, 03:25 GMT
[ Other Periods
| Other mailing lists
| Search
]