www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1275] New: ambiguity with 'in' meaning

reply d-bugmail puremagic.com writes:

           Summary: ambiguity with 'in' meaning
           Product: D
           Version: 2.000
          Platform: PC
               URL: http://www.digitalmars.com/d/function.html
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: www.digitalmars.com
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: braddr puremagic.com

A snipping from the function.html docs:

Function Parameters
Parameter storage classes are in, out, ref, lazy, final, const, invariant, or
scope. For example:

int foo(in int x, out int y, ref int z, int q);

x is in, y is out, z is ref, and q is none.

out is rare enough, and ref even rarer, to attach the keywords to them and
leave in as the default. The reasons to have them are:

    * The function declaration makes it clear what the inputs and outputs to
the function are.
    * It eliminates the need for IDL as a separate language.
    * It provides more information to the compiler, enabling more error
checking and possibly better code generation.
    * It (perhaps?) eliminates the need for reference (&) declarations. 

The in storage class is equivalent to final const scope. 

There was a debate about whether or not the implicit 'in' behavior when 'in'
ins't actually listed should imply 'final const scope' and I believe the answer
was 'no'.  The above leaves that very unclear.

Jun 18 2007
parent d-bugmail puremagic.com writes:

bugzilla digitalmars.com changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

Fixed dmd 2.001

Jun 27 2007