Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!umcp-cs!chris From: chris@umcp-cs.UUCP (Chris Torek) Newsgroups: net.lang.c Subject: Re: Precedent for use of = Message-ID: <2324@umcp-cs.UUCP> Date: Thu, 10-Jul-86 02:13:27 EDT Article-I.D.: umcp-cs.2324 Posted: Thu Jul 10 02:13:27 1986 Date-Received: Fri, 11-Jul-86 21:41:44 EDT References: <1645@brl-smoke.ARPA> <2208@umcp-cs.UUCP> <2158@ihlpg.UUCP> Reply-To: chris@maryland.UUCP (Chris Torek) Organization: University of Maryland, Dept. of Computer Sci. Lines: 60 >>In article <1645@brl-smoke.ARPA> JUNG_E%SITVXA.BITNET@WISCVM.WISC.EDU writes: Careful with the quotes; the `>>' text is mine, not JUNG_E%SITVXA.BITNET's. (The >>> text is his.) >>>Practically every language uses the equals sign, "=", to test for >>>equality, not as an assignment operator. (Here I listed some languages, and tallied:) >>Well, 5 to 3 in favour of `= for equality', though APL and Mesa are >>perhaps special cases: back-arrow is not available for assignment on >>my H19. In article <2158@ihlpg.UUCP> tainter@ihlpg.UUCP (Tainter) replies: >ADD: > Assignment Equality > ---------- --------- > mathematics > logic >--j.a.tainter Imprimus, the context is really computer languages. Secondus, both mathematics and logic are very broad fields, and saying `mathematics uses ``='' for equality' is like saying `physics uses ``c'' for the speed of light': true in many instances but by no means universal. Tertius, this whole discussion is getting boring. For those of you who prefer := for assignment and `=' for equality, just compile all your C code to .o files with the following `pascalcc' shell script. It can be extended, if necessary, to do most everything that /bin/cc does. : pascalcc - compile C code with Pascal-esque assignment / equality comp=/lib/ccom c2=/bin/cat tf=/tmp/pascalcc.$$ trap "rm -f $tf" 0 1 2 3 15 for i do case "$i" in -O) c2=/lib/c2;; -c) ;; *.c) if cc -E "$i" | sed -e 's/\([^:]\)=/\1==/' -e 's/:=/=/' | $comp | $c2 > $tf; then if as -o `echo "$i" | sed -e 's/\.c$//'`.o $tf; then : else exit $? fi else exit $? fi;; *) echo "$0: cannot handle file name \`$i'" 1>&2 exit 1;; esac done -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1516) UUCP: seismo!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@mimsy.umd.edu