comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
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
Date: 2014-07-14T18:23:09-05:00	[thread overview]
Message-ID: <lq1oot$sqc$1@loke.gir.dk> (raw)
In-Reply-To: lq1bq1$o5d$1@dont-email.me

"Simon Clubley" <clubley@remove_me.eisner.decus.org-Earth.UFP> wrote in 
message news:lq1bq1$o5d$1@dont-email.me...
> On 2014-07-14, G.B. <rm-dash-bau-haus@dash.futureapps.de> 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.




  parent reply	other threads:[~2014-07-14 23:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-13  1:55 why Ada type casting is different from other languages? newType(value) vs. (newType)value Nasser M. Abbasi
2014-07-13  3:01 ` Shark8
2014-07-13  6:26 ` Jeffrey Carter
2014-07-13 14:33   ` Dan'l Miller
2014-07-13  9:01 ` Niklas Holsti
2014-07-13  9:08   ` Dmitry A. Kazakov
2014-07-13 10:20     ` AdaMagica
2014-07-13 10:24     ` Georg Bauhaus
2014-07-14 23:36       ` Randy Brukardt
2014-07-15 18:42         ` G.B.
2014-07-15 19:14           ` Niklas Holsti
2014-07-15 22:47             ` Georg Bauhaus
2014-07-15 19:19           ` Jeffrey Carter
2014-07-15 23:07             ` Georg Bauhaus
2014-07-15 22:00           ` Randy Brukardt
2014-07-13 14:42 ` Dan'l Miller
2014-07-14 15:25 ` Adam Beneschan
2014-07-14 16:24   ` G.B.
2014-07-14 17:41     ` Simon Wright
2014-07-14 19:41     ` Simon Clubley
2014-07-14 20:51       ` Dan'l Miller
2014-07-14 23:23       ` Randy Brukardt [this message]
2014-07-15 19:22 ` Marius Amado-Alves
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox