Path: utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!usc!apple!voder!pyramid!decwrl!wuarchive!cs.utexas.edu!retgers!aramis.rutgers.edu!paul.rutgers.edu!sparky.rutgers.edu!gaynor From: gaynor@sparky.rutgers.edu (Silver) Newsgroups: comp.lang.c Subject: Re: Assignment in test: OK? Message-ID: Date: 20 Sep 90 10:27:28 GMT References: <1698@m1.cs.man.ac.uk> <535@macuni.mqcc.mq.oz> <2605@idunno.Princeton.EDU> Organization: Rutgers Univ., New Brunswick, N.J. Lines: 41 gaynor@sparky.rutgers.edu (Silver, Moi) wrote: > If I had my way, assignment would be `<-' and equality, `='. newc@macuni.mqcc.mq.oz (JamesPW) responds: > So > if (a<-1) { > ... > } > takes on a whole new meaning ... (and always succeeds!) Yeah, longest token matched. I kind of ignored syntactic ambiguity for the purposes of the discussion. Personally, I seperate operators of lower precedences from their arguments, which would make your example would read "if (a <- 1) ..." if assignment had been intended, and "if (a < -1) ..." if less-than had been intended. `<-' so much better connotes assignment than `=' that I'll stick to me guns here. It'c more important to me to get the appearance of a left arrow; that the characters `<' and `-' hap`en to give this appearance when the former immediately preceds the latter is a convenience. (It's damn unfortunate that left- and right-arrows are not part of the ascii character set. They have enough meaning beyond any other graphical connotations that a good case could be made for them. But that's life.) Not that ansi committees and compiler writers are not going to trip over themselves in a flurry to accommodate a minority preference, hee hee! But on a more serious note, simple ol' cpp doesn't accommodate this user's preference either. Many'll say that it's not a good idea to modify the language with cpp. Well, by writing functions and creating data types, one is enhancing (read "modifiing") the language. I would take this further if I could without a severe amount of effort. subbarao@phoenix.Princeton.EDU (Kartik Subbarao) responds: > My My -- You must be an S programmer, where <- IS the assignment operator. > But now how do I say ``If a is less then -1''? Above. Yes, I've programmed in S. However, I've held this opinion long before my escapades with S. I feel that S is a woof in many respects, but at least the authors picked my preferred assignment operator appearance. Regards, [Ag] gaynor@paul.rutgers.edu