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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 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!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!fx18.iad.POSTED!not-for-mail From: Shark8 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:32.0) Gecko/20100101 Thunderbird/32.0a1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: why Ada type casting is different from other languages? newType(value) vs. (newType)value References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Message-ID: X-Complaints-To: abuse@teranews.com NNTP-Posting-Date: Sun, 13 Jul 2014 03:01:39 UTC Organization: TeraNews.com Date: Sat, 12 Jul 2014 21:01:43 -0600 X-Received-Bytes: 1344 X-Received-Body-CRC: 3741132369 Xref: news.eternal-september.org comp.lang.ada:20898 Date: 2014-07-12T21:01:43-06:00 List-Id: On 12-Jul-14 19:55, Nasser M. Abbasi wrote: > I am just wondering what is the rational of Ada choosing to use > type(value) > > vs > (type)value > > to do typecasting. does not type(value) appear as a function call? > as in > > i := float(9); > > vs. > > i := (float) 9; > > Just wondering on this choice and its advantage over the more > common syntax. > > thanks, > --Nasser Because conversion certainly may be thought of as a function; implicitly: Function TARGET_TYPE_NAME( Input : SOURCE_TYPE ) Return TARGET_TYPE;