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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.43.58.137 with SMTP id wk9mr10656717icb.10.1405371068803; Mon, 14 Jul 2014 13:51:08 -0700 (PDT) X-Received: by 10.182.241.227 with SMTP id wl3mr114220obc.7.1405371068669; Mon, 14 Jul 2014 13:51:08 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!h18no666263igc.0!news-out.google.com!bp9ni210igb.0!nntp.google.com!h18no1582140igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 14 Jul 2014 13:51:08 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=71.252.147.203; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 71.252.147.203 References: <53c40435$0$6612$9b4e6d93@newsspool4.arcor-online.net> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <1a99190f-019f-4379-90e6-6ec58bf4be2a@googlegroups.com> Subject: Re: why Ada type casting is different from other languages? newType(value) vs. (newType)value From: "Dan'l Miller" Injection-Date: Mon, 14 Jul 2014 20:51:08 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:20936 Date: 2014-07-14T13:51:08-07:00 List-Id: On Monday, July 14, 2014 2:41:58 PM UTC-5, Simon Clubley wrote: > On 2014-07-14, G.B. <> wrote: > > f(C(p).A(I))(N) > > "might be better conveyed with the syntax: > > f(C::p->A_{I})[N] >=20 > To be honest, that suggestion by the authors sounds a bit bogus to me. >=20 > By the time a newcomer is far enough along to understand the concepts > behind that syntax, does that person really still need that special > syntax ? Let's face it. Far less than 1% of programmers work for an employer or on = an open-source project that builds out an ASIS-based (for Ada) or Clang-bas= ed (for C or C++ or Objective-C) or GCC MELT-based (for C or C++) source-co= de analysis tool with a precise & accurate parser. (In fact, I suspect tha= t the true number is far less than 1/100th of 1%.) Without such a precise = & accurate parser, grep(3)ing through source code to find that cryptic type= -case or type-conversion is likely to give numerous false negatives (as wel= l as false positives). Ignoring obfuscation possible in the C preprocessor= , grep(3)ing through source code for type-casting syntax that is designed t= o be extraordinarily obvious (e.g., C++'s static_cast(expression), dy= namic_cast(expression), and reinterpret_cast(expression) is a h= ighly-desirable welcome alternative to building out a ASIS-based or Clang-b= ased or GCC MELT-based source-code analyzer/parser tool. That goes for the= expert in the language and it goes double (or a decimal order of magnitude= more) for a beginner in a language. As I mentioned earlier in a branch of this thread, Ada's subtle typecasting= syntax is a historical artifact of mimicking ALGOL68's type-cast syntax ba= ck when Green was designed in the 1970s back when ALGOL68 still had some sw= ay as the state-of-the-art in language-design. > The above is not what you would teach a student new to programming > in their first week of class. But that is sort of the point, now isn't it. In a strongly-typed languag= e, every way of manipulating types is a core part of the essential language= . When a programmer (beginning or otherwise) needs to play parser on typin= g information (which most programmers consider playing language lawyer, whi= ch is disdain not a complement), then most Millennial-generation programmer= s just give up and go with a less-strongly-type scripted language and decla= re a sort of victory.