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,fc52c633190162e0 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newshub.sdsu.edu!newscon04.news.prodigy.net!prodigy.net!newsdst01.news.prodigy.net!prodigy.com!postmaster.news.prodigy.com!newssvr23.news.prodigy.net.POSTED!4988f22a!not-for-mail From: Newsgroups: comp.lang.ada References: <1172144043.746296.44680@m58g2000cwm.googlegroups.com> <1172161751.573558.24140@h3g2000cwc.googlegroups.com> <546qkhF1tr7dtU1@mid.individual.net> <5ZULh.48$YL5.40@newssvr29.news.prodigy.net> <1175215906.645110.217810@e65g2000hsc.googlegroups.com> <1175230352.808212.15550@e65g2000hsc.googlegroups.com> <1175236212.771445.135460@y66g2000hsf.googlegroups.com> Subject: Re: why learn C? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original Message-ID: NNTP-Posting-Host: 70.134.100.216 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr23.news.prodigy.net 1175387686 ST000 70.134.100.216 (Sat, 31 Mar 2007 20:34:46 EDT) NNTP-Posting-Date: Sat, 31 Mar 2007 20:34:46 EDT Organization: AT&T http://yahoo.sbc.com X-UserInfo1: Q[R_@SBEQJV]SQ@[EZOD]_\@VR]^@B@MCPWZKB]MPXHBTWICYFWUQBKZQLYJX\_ITFD_KFVLUN[DOM_A_NSYNWPFWNS[XV\I]PZ@BQ[@CDQDPCL^FKCBIPC@KLGEZEFNMDYMKHRL_YYYGDSSODXYN@[\BK[LVTWI@AXGQCOA_SAH@TPD^\AL\RLGRFWEARBM Date: Sat, 31 Mar 2007 17:35:19 -0800 Xref: g2news1.google.com comp.lang.ada:14700 Date: 2007-03-31T17:35:19-08:00 List-Id: "Randy Brukardt" wrote in message news:eujrs1$9e$1@jacob-sparre.dk... > wrote in message > news:o2cPh.4026$u03.1786@newssvr21.news.prodigy.net... >> I cannot imagine anyone writing a column >> called "Obfuscated Ada." > > Not a column, perhaps, but surely you could write an interesting article. > Ada has plenty of ways to write something simple in wonderfully long-winded > ways which potentially harm readability. And there are various non-obvious > idioms that are very handy, like using Boolean'Pos to get the effect of a > conditional expression: > > Something : Integer := Boolean'Pos()*Function1 + Boolean'Pos(not > )*Function2; > This does not compare with the possibilities for obfuscation in C++. Further, we know quite a bit about this example early, even though we may not know what its intent is on first reading. I do know that there is no automatic promotion of values. I am confident that Something, as described is of type Integer. I am also secure in understanding that the expression needs to evaluate to a predefined type Integer. Type qualification, Boolean'Pos(...) ensures there is no type mismatch anywhere in the expression. In other words, one can easily reason about the expression without knowing its details. Richard Riehle