http://d.puremagic.com/issues/show_bug.cgi?id=5775
Summary: "body" keyword is unnecessary Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: alvaro.seg...@gmail.com --- Comment #0 from Alvaro <alvaro.seg...@gmail.com> 2011-03-23 14:46:55 PDT --- D already has a long list of keywords, and those reserved words can't be used as identifiers. "body" in particular is a common noun that programmers would gladly use as variable name in physics simulation, astronomy, mechanics, games, health, etc. I think "body" can be removed from D with no harm, and with the benefit of allowing the name as identifier. Rationale: Functions in C and derived languages have always had a body and they never needed a keyword. In D, "body" is used to mark the actual body of a function after the optional "in" and/or "out" contract blocks. From the documentation: in{ ...contract preconditions... } out (result){ ...contract postconditions... } body{ ...code... } But the body keyword can be omitted and still interpret the code correctly given the rule: "An unnamed {} block right after an in{} or out{} block when defining a function, MUST be the function's body". Thus, the above code would become: in{ ...contract preconditions... } out (result){ ...contract postconditions... } { ...code... } and be perfectly understandable, with the benefit of one less keyword. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------