Summary: "in" function argument is redundant
           Product: D
           Version: 2.041
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: DMD

--- Comment #0 from 2010-03-12 14:47:11 PST ---
This program seems to show that "in" function arguments are the same as
"const", and "immutable in" are immutable:

import std.stdio: writeln;
void foo1(const int x) {
    writeln(typeid(typeof(x))); // const(int)
void foo2(in int x) {
    writeln(typeid(typeof(x))); // const(int)
void foo3(immutable in int x) {
    writeln(typeid(typeof(x))); // immutable(int)
void main() {

So the "in" attribute for function arguments can be removed from the language,
so programmers can use "const", "immutable", etc in a more explicit way.

According to Python Zen: "There should be one-- and preferably only one
--obvious way to do it."

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

Reply via email to