From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f127842852d2f03a X-Google-Attributes: gid103376,public From: Ted Dennison Subject: Re: About conversions Date: 2000/11/22 Message-ID: <8vgoek$p1r$1@nnrp1.deja.com>#1/1 X-Deja-AN: 696672366 References: <8vb0h9$1ou$1@nnrp1.deja.com> <8vbfds$dih$1@nnrp1.deja.com> <8ve71q$meh$1@nnrp1.deja.com> <3A1AB12E.8780B626@home.com> <8vept5$814$1@nnrp1.deja.com> <8vetq2$bkb$1@nnrp1.deja.com> <8vfjhn$t4e$1@nnrp1.deja.com> X-Http-Proxy: 1.0 x67.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Wed Nov 22 15:24:14 2000 GMT X-MyDeja-Info: XMYDJUIDtedennison Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; m18) Gecko/20001010 Date: 2000-11-22T00:00:00+00:00 List-Id: In article <8vfjhn$t4e$1@nnrp1.deja.com>, Robert Dewar wrote: > In article <8vetq2$bkb$1@nnrp1.deja.com>, > Why is it confusing? Simple, most people think of conversions > as basically function calls, and it is peculiar to have a > function call as an Lvalue. (peculiar in Ada as well, and indeed I prefer to think of them as a kind of in-line compiler directive, in effect saying "think of this object as really being of this type". I generally tell this to others as well, since thinking of it as a function call leads people to the erronious conclusion that the conversion is liable to have some kind of subprogram-like overhead. >From this point of view, *not* allowing it for "out" parameters would be confusing. (And yes, to this way of thinking it is a bit odd that you can't use it on the left side of an assignment). > -14 mod 5 Not a chance. I don't think I've ever needed to use "mod" for negative numbers, so I would definitely have to look it up. That's just a matter of use though. If I had to do it all the time, I'm sure I'd know it just as well as a heavy C coder knows how to properly use the "?" operator. Pretty much the only time I ever use "mod" is to index into circular data structures. Occasionly I'll use it to effect a bit mask on an unsigned value. There's probably a use for applying it to signed values, but I haven't encountered it in 11 years. -- T.E.D. http://www.telepath.com/~dennison/Ted/TED.html Sent via Deja.com http://www.deja.com/ Before you buy.