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 Path: border1.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: why Ada type casting is different from other languages? newType(value) vs. (newType)value Date: Mon, 14 Jul 2014 18:23:09 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <53c40435$0$6612$9b4e6d93@newsspool4.arcor-online.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1405380189 29516 69.95.181.76 (14 Jul 2014 23:23:09 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 14 Jul 2014 23:23:09 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: number.nntp.dca.giganews.com comp.lang.ada:187588 Date: 2014-07-14T18:23:09-05:00 List-Id: "Simon Clubley" wrote in message news:lq1bq1$o5d$1@dont-email.me... > On 2014-07-14, G.B. wrote: >> >> It appears that in some situations style alone is not a permissible >> language design guide. WRT syntax, McIver and Conway explain, with >> novice programmers in mind, that there needs to be a good signal >> to noise ratio and that this may mean just enough syntax, but also >> enough syntax. In particular, they address "homonyms", >> as in "type(expression)" vs "something-else(expression)". >> >> "Alternatively, it may be better to increase the complex- >> ity of the syntax in order to reduce homonyms which blur >> the signal. For example, the meaning of the various compo- >> nents of the Turing expression^7: >> >> >> f(C(p).A(I))(N) >> >> "might be better conveyed with the syntax: >> >> f(C::p->A_{I})[N] >> > > To be honest, that suggestion by the authors sounds a bit bogus to me. > > 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 ? I agree. On top of that, there's more than 3 kinds of bracketed expressions (type conversion, type qualification, subprogram call, aggregates, array indexing, array slicing, and now conditional expressions and qualified expressions), but in ASCII there's only 3 useable sets of brackets (), [], {}. (You can't use <> as brackets in expressions because of ambiguity with operators < and >.) Any choice is going to end up with arbitrary groupings where some kinds of brackets are the same and some are different. Ada decided not to bother and just use one set - then you never have to worry about what set to use. Randy.