Path: utzoo!attcan!uunet!pyrdc!pyrnj!rutgers!cmcl2!lanl!jlg From: jlg@lanl.gov (Jim Giles) Newsgroups: comp.lang.fortran Subject: Re: i++, i+=1, i=i+1 Message-ID: <3629@lanl.gov> Date: 15 Sep 88 17:04:52 GMT References: <13566@mimsy.UUCP> Organization: Los Alamos National Laboratory Lines: 16 From article <13566@mimsy.UUCP>, by chris@mimsy.UUCP (Chris Torek): > Also agreed. Convenience, however, makes all the difference. I, as > a reader, would much rather see as an English description the phrase > `add 1 to i' than `evaluate i, evaluate the integer constant 1, add > the values together, and store the result in the location named by i'. My english description of 'i = i + 1' _is_ "add 1 to i". the difference between that and 'i += 1' is purely textual. It's easy to write a preprocessor to switch the later to the former. Such a preprocessor needn't have _any_ semantic knowledge of the target language. It need only look for '+=' and replace it with '= _X_' where _X_ is whatever token preceeds the '+='. In other words, as far as functionality goes, '+=" doesn't do a damn thing. J. Giles Los Alamos