Re: Selecting Components



On Sat, 2006-01-07 at 20:24 +0000, Jeffrey R. Carter wrote:


> 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

Interesting.
Is "Index_1, Index_2" and expression, or an identifier
as in Pack.Op, Rec.Comp, etc.?

with Index;
....
declare
Index: ...
begin
for k in a'range loop
Result := Result + a.Index.k;
end loop;
end;

For the record, in Eiffel you'd write array @ expr,
Haskell uses array !! expr.
Eiffel uses '.' for object.feature, not as an operator.
Haskell uses '.' for function composition, too, if surrounded
by white space.



.



Relevant Pages

  • Re: array question
    ... an example that shows "split" can work on an array. ... EXPR stands for any expression that evaluates to a scalar. ... Command line options can be found in `perldoc perlrun`. ...
    (perl.beginners)
  • Re: Intel Fortran Compiler Version 9.1 Now Available
    ... James Giles wrote: ... if expr is an array of different shape or any of the corresponding ... length type parameter values of variable and expr differ. ...
    (comp.lang.fortran)
  • Re: Syntax, expressiveness and the beauty of Tcl
    ... where as an lvalue, sin() would be an array, while on the right side ... it's still the good old sine function... ... set sin[expr sin] ...
    (comp.lang.tcl)
  • Re: Java collection problem
    ... array of pointers is pretty cheap. ... Eiffel has a nice way of handling this. ... it does let you keep your paradigm "all the way down" with good efficiency. ... there are Java-bytecode back-ends for at least two Eiffel compilers ...
    (comp.lang.java.machine)
  • Re: ISE Eiffel 6.0: unequal twins...
    ... I think that a typical solution ported to Eiffel would be ... to provide an agent that modifies the object right in the array. ... I cannot currently check whether such a thing exists in ARRAY. ... and uses pointers to functions and array elements. ...
    (comp.lang.eiffel)