Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!gatech!hubcap!hutch%citron.cs.clemson.edu From: hutch%citron.cs.clemson.edu@hubcap.clemson.edu (David Hutchens) Newsgroups: comp.lang.misc Subject: Re: Learning Ada Message-ID: <6364@hubcap.clemson.edu> Date: 31 Aug 89 19:55:15 GMT References: <6359@hubcap.clemson.edu> Sender: news@hubcap.clemson.edu Reply-To: hutch%citron.cs.clemson.edu@hubcap.clemson.edu Lines: 34 From article <6359@hubcap.clemson.edu>, by billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe,2847,): > From hutch%citron.cs.clemson.edu@hubcap.clemson.edu (David Hutchens): >> Of course there is the classic (from Ada): "Gee I need the cube of X": >> z := x ** 3; >> which, of course (:-) generates the message "Ambiguous Expression". >> >> The beginning student might be slightly confused by the reason: >> "The constant 3 is overloaded (as both integer and short integer) >> and there are 2 distinct ** operators, so the compiler doesn't >> know which to pick!" > > Actually, the compiler does know... [Stuff about special characteristics of the ** operator deleted.] > It is good to see that is "fixed". Of course this introduces a special case into the compiler, and into the minds of the experienced user that I might easily claim is as bad or worse than the "Pre-fixed" version. Now we have several lines in the LRM and several lines of code in correct compilers to solve a stupid little problem. (By the way, I tried this example on several of the early "validated" compilers and they ALL worked the way I stated. I don't happen to know if the compilers were broken at the time or they changed the spec of the language ... but I think the latter.) So I was wrong in the specifics, but even more right in the intent because the designers had to gum up the language specification to get it to work the way people would feel most comfortable. I don't think keywords are the only source of inexperienced user frustration with large languages. - David Hutchens hutch@hubcap.clemson.edu