Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!bellcore!texbell!nuchat!sugar!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.lang.misc Subject: Re: Expression Based Language Message-ID: <2583@ficc.uu.net> Date: 29 Dec 88 20:12:33 GMT References: <3300001@uxg.cso.uiuc.edu> <3290002@hpctdls.HP.COM> <4505@xenna.Encore.COM> Organization: Xenix Support Lines: 45 In article <4505@xenna.Encore.COM>, pierson@mist (Dan Pierson) writes: > 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 :-) Grumble away. > 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. You're right. However I once modified a version of the small-C compiler to make 'C' a completely expression-based language. The changes are really very minor (at least for that case... I don't know quite how full 'C' would take it). > 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). The small-C I was working with didn't have '?:', one reason I went to the trouble. The other reason was I'd just read the BCPL book by Colin Whitby-Strevens. While I was making anonymous integer arrays, I went over the edge into algol territory. > If C was an expression based language the following would be legal: [ foo = switch(bar) {...} ] Well, if I'd had a switch statement it would have been. > This is not fantasy, the equivalent expressions exist and are useful > in BLISS and Lisp. And, I believe, Algol. Anyway, it was loads of fun. -- Peter da Silva, Xenix Support, Ferranti International Controls Corporation. Work: uunet.uu.net!ficc!peter, peter@ficc.uu.net, +1 713 274 5180. `-_-' Home: bigtex!texbell!sugar!peter, peter@sugar.uu.net. 'U` Opinions may not represent the policies of FICC or the Xenix Support group.