comp.lang.ada
 help / color / mirror / Atom feed
* Selecting Components
@ 2006-01-07 20:24 Jeffrey R. Carter
  2006-01-08  1:09 ` (see below)
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Jeffrey R. Carter @ 2006-01-07 20:24 UTC (permalink / raw)


I guess this is primarily aimed at the language lawyers who hang out here.

Thinking about how Ada selects components of things, especially of composite 
objects, I see that almost every case uses dot notation. Package.Declaration, 
Record.Component, and so on. The one exception seems to be components of arrays, 
which use parentheses:

Array (Index)
Array (Index_1, Index_2)
Array (High .. Low)

I suppose one argument for this is that it's how it's always been done since the 
earliest days of FORTRAN. Another is that it allows functions to be replaced by 
arrays and arrays by functions.

However, many languages, including Pascal, Ada's ancestor, use [] for array 
indices, so the function/array equivalence may not be that strong.

What would be the consequences if a language were designed so that all 
selections used dot notation, including arrays:

Array.Index
Array.Index_1, Index_2
Array.Low .. High

?

-- 
Jeff Carter
"Spam! Spam! Spam! Spam! Spam! Spam! Spam! Spam!"
Monty Python's Flying Circus
53



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-01-11  3:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-07 20:24 Selecting Components Jeffrey R. Carter
2006-01-08  1:09 ` (see below)
2006-01-08  6:18   ` Jeffrey R. Carter
2006-01-08 20:35   ` Keith Thompson
2006-01-08 10:58 ` Dmitry A. Kazakov
2006-01-09  0:12 ` Georg Bauhaus
2006-01-09  4:41   ` Jeffrey R. Carter
2006-01-11  2:29 ` Stephen Leake
2006-01-11  3:01   ` Jeffrey R. Carter

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