http://d.puremagic.com/issues/show_bug.cgi?id=3943
Summary: "in" function argument is redundant Product: D Version: 2.041 Platform: All OS/Version: All Status: NEW Severity: minor Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 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() { foo1(1); foo2(1); foo3(1); } 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: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------