Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!cmcl2!yale!husc6!think!nike!ucbcad!ucbvax!decvax!decwrl!glacier!mips!hansen From: hansen@mips.UUCP Newsgroups: net.lang Subject: Re: Discussion on removing punctuation in programming languages Message-ID: <720@mips.UUCP> Date: Fri, 10-Oct-86 15:42:56 EDT Article-I.D.: mips.720 Posted: Fri Oct 10 15:42:56 1986 Date-Received: Sat, 11-Oct-86 21:27:37 EDT References: <7796DMB@PSUVMA> Organization: MIPS Computer Systems, Sunnyvale, CA Lines: 31 > As a side note does any language allow the mathematically normal syntax of > IF (4 < x < 8) THEN blabla > > I don't think so, but why not? > > dave brosius > dmb at psuvma.bitnet Yes. I have implemented a language where this is permitted. In fact, it will accept expressions of this kind of arbitrary length, such as (a < b < c <= d), which is equivalent to (a < b) & (b < c) & (c <= d). The only reason against implementing it is that it is harder to optimize the expression. For example, if it is known that (b < c) is true, the expression above reduces to (a < b) & (c <= d), which can only be represented clearly by explicitly inserting the AND operator. If the expression is limited to three terms, of course, this doesn't happen. The construct is mostly useful just for its expressive power. It's shorter to write (4 < (x+(y*z)) < 6) than to write (4 < (x+(y*z))) & ((x+(y*z)) < 6), though it is straightforward, using common subexpression optimization, to make either form generate equivalent code. -- Craig Hansen | "Evahthun' tastes MIPS Computer Systems | bettah when it ...decwrl!mips!hansen | sits on a RISC"