[Issue 1275] New: ambiguity with 'in' meaning

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jun 18 00:51:20 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1275

           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 at digitalmars.com
        ReportedBy: braddr at 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.


-- 



More information about the Digitalmars-d-bugs mailing list