Path: utzoo!attcan!uunet!husc6!bu-cs!encore!pierson@mist From: pierson@mist (Dan Pierson) Newsgroups: comp.lang.misc Subject: Expression Based Language Summary: C isn't expression based Message-ID: <4505@xenna.Encore.COM> Date: 28 Dec 88 16:32:49 GMT References: <3300001@uxg.cso.uiuc.edu> <3290002@hpctdls.HP.COM> <9282@ihlpb.ATT.COM> Sender: news@Encore.COM Reply-To: pierson@mist (Dan Pierson) Organization: Encore Computer Corp Lines: 34 In-reply-to: nevin1@ihlpb.ATT.COM (Liber) In article <9282@ihlpb.ATT.COM>, nevin1@ihlpb (Liber) writes: >This really has nothing to do with ":=" vs "=". C is an >expression-based language; Pascal is not (by expression-based I mean >that every operator returns a value that can be used as one of the >parameters for another operator). OK, you get the grumble instead of Peter :-) Since you're defining your own term, I can't flatly say you're wrong, BUT this definition of "expression based" contradicts every other definition I'm familiar with. C and Pascal are both statement based languages, however C has a larger set of legal expressions. BLISS and Lisp are both expression based languages, I.E. everything is an expression and returns a value. If C was an expression based language, the ?: expression would be totally redundant with a normal if statement (of course it would still be more compact). If C was an expression based language the following would be legal: foo = switch (bar) { case 'a': ... case 'b': ... default: ... }; This is not fantasy, the equivalent expressions exist and are useful in BLISS and Lisp. -- dan In real life: Dan Pierson, Encore Computer Corporation, Research UUCP: {talcott,linus,necis,decvax}!encore!pierson Internet: pierson@multimax.encore.com