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-Thread: 103376,243dc2fb696a49cd X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Sat, 02 Oct 2004 18:32:31 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1700922.2nPlMsa4Ny@linux1.krischik.com> <1636756.M7hCqjsVMv@linux1.krischik.com> <415c36c0$0$91010$39cecf19@news.twtelecom.net> <4c2ec8a8.0410012335.dcf9001@posting.google.com> Subject: Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl) Date: Sat, 2 Oct 2004 18:33:41 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-YBHQRu5IaZ714H20+yRxXCSr3CTn3zdB762AUNIVf+C8xIx87+DULrNQxRZ3nsDK48mxx5JBF/pMRe1!r5U77a9GvXGpRPD6PkCgt6NSoDh7DfkowVuvVhOd9blTw+y0nBr6b3OO9O725SwyuVD+avA4SLY0 X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.19 Xref: g2news1.google.com comp.lang.ada:4583 Date: 2004-10-02T18:33:41-05:00 List-Id: "K" wrote in message news:4c2ec8a8.0410012335.dcf9001@posting.google.com... ... > than to maintain code like this: > > read_order(DatabaseReader& reader, Order& order) > { > order.number = reader["ORDER.NUMBER"]; > order.customer_number = reader["ORDER.CUSTOMER"]; > order.acceptance_date = parse(reader["ORDER.ACCEPTED"]); > ... > } It's orthogonal to your original point, but Ada contains features to make it impossible to forget to modify some section of code when components are added. That mitigates any needed duplication to some extent. procedure Read_Order (Reader : DatabaseReader_Type; Order : in out Order_Type) is begin Order := (Number => Reader("Order.Number"), Customer_Number => Reader("Order.Customer"), ...); end Read_Order; If a component is added to Order, the compiler will complain if this aggregate is not updated. I'd probably use an enumeration type to map the names of the fields in order to bring completeness checking to that side of the equation as well. But I admit that I still can't figure out what it is that this "pointer to member" does that is different than taking an access of a component. The only thing that Ada doesn't have here is an equivalent to "void", which is of course about safety - all access types have to have a designated type. Randy.