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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,79bbf7e359159d0d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-09 20:28:05 PST Path: supernews.google.com!sn-xit-03!supernews.com!nntp.cs.ubc.ca!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.news.rcn.net!rcn!wn4feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc04-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <3AD27DC6.76D6D565@worldnet.att.net> From: James Rogers X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: newbie can't get exceptions to work! References: <25%y6.2364$jz.201607@www.newsranger.com> <3ACDB29E.45B91316@earthlink.net> <9ao1if$cq9$1@taliesin.netcom.net.uk> <3ACFC902.115624A1@mindspring.com> <9aps7l$2g5$4@taliesin.netcom.net.uk> <3AD1E164.2E2CB0B4@mindspring.com> <9atp4i$mnh$3@taliesin.netcom.net.uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 10 Apr 2001 03:25:54 GMT NNTP-Posting-Host: 12.74.129.203 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 986873154 12.74.129.203 (Tue, 10 Apr 2001 03:25:54 GMT) NNTP-Posting-Date: Tue, 10 Apr 2001 03:25:54 GMT Organization: AT&T Worldnet Xref: supernews.google.com comp.lang.ada:6692 Date: 2001-04-10T03:25:54+00:00 List-Id: Ayende Rahien wrote: > > That is a syntax problem, there are number of IDEs out there that would mark > what { the } belongs too. If you are using VC, there are macros to do this. > They are quite convient. This is a particularly C way of expressing convenience. A syntax problem is convenient because tools are available to deal with it. I find it much more convenient to avoid the problem altogether. > I find the operators clear, you just had to memorize a dozen or so, and that > is it. > I think it's just a matter of personal dislike for C's syntax. Personally, I > would love to work with C style Ada. I find the C syntax for dealing with pointers to be excessively convenient, as defined above. A pointer to an int is defined as: int *iptr; At the same time, the value pointed to by iptr is referenced as *iptr. This is clearly convenient. Now let's discuss pointers and structs: struct mystruct { int foo; float bar; } struct mystruct myinstance; struct mystruct *myptr; Now, let's have myptr reference myinstance: myptr = &myinstance; How do we now access the "foo" field in the struct? Through the myinstance variable we use simple "." notation: myinstance.foo Through myptr we have two choices for syntax: (*myptr).foo myptr->foo This is clearly a very convenient syntax. It gets even more convenient when mixing pointers and arrays in C: int a[10]; int *pa; pa = &a[0]; *pa = 50; *(++pa) = 51; *(pa++) += 90; Let's see how convenient this is: First we assigned 50 to a[0], then we assigned 51 to a[1], then we added 90 to a[1] and incremented pa. Finally, let's look at the ultimate C convenience: pointers to functions. float f(); /* f is a function returning float. */ float *f(); /* f is a function returning a pointer to a float.*/ float (*f)(); /* f is a pointer to a function returning float. */ float *(*f)(); /* f is a pointer to a function returning a pointer to a float. */ float (*(*f)())(); /* f is a pointer to a function returning a pointer to a function returning float */ Now, I must say I have never found this kind of convenience in Ada. Jim Rogers Colorado Springs, Colorado USA