Summary: Ambiguous array operations
           Product: D
           Version: 2.032
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: spec
          Severity: enhancement
          Priority: P2
         Component: DMD

--- Comment #0 from Sobirari Muhomori <> 2009-10-14 
01:15:48 PDT ---
These expressions are ambiguous:
Does it mean calling the function on the slice or on each item in the slice?

Possible solution is to change the meaning of empty square brackets from full
slice to only a hint for array operation so that a[].max(n) is an array
operation and a[1..4].max(n) is max(a[1..4],n).
This also gives possibility to extend array operation to whole statement even
if it's not an lvalue:
printf("%.4f, ",a[]);
foreach(v;a)printf("%.4f, ",v);
a[].max(n) and max(a[],n) become the same and unambiguous with other use cases.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to