Re: "body" keyword is unnecessary

2017-11-21 Thread Nick Treleaven via Digitalmars-d
On Sunday, 19 November 2017 at 11:54:04 UTC, Tony wrote: dmd --version DMD64 D Compiler v2.077.0 Copyright (c) 1999-2017 by Digital Mars written by Walter Bright dmd test_contracts.d test_contracts.d(13): Error: missing `body { ... }` after `in` or `out` Just made a pull to fix this:

Re: "body" keyword is unnecessary

2017-11-19 Thread Meta via Digitalmars-d
On Sunday, 19 November 2017 at 21:14:58 UTC, Jonathan M Davis wrote: It would have been better to explain in the documentation that body was being phased out rather than just removing it right when the changes were made to dmd. It's already caused problems due to folks trying to use do and it

Re: "body" keyword is unnecessary

2017-11-19 Thread Basile B. via Digitalmars-d
On Sunday, 19 November 2017 at 21:19:58 UTC, Meta wrote: On Sunday, 19 November 2017 at 12:54:37 UTC, Basile B. wrote: Good question, it's even not in the changelog:

Re: "body" keyword is unnecessary

2017-11-19 Thread Meta via Digitalmars-d
On Sunday, 19 November 2017 at 12:54:37 UTC, Basile B. wrote: Good question, it's even not in the changelog:

Re: "body" keyword is unnecessary

2017-11-19 Thread Jonathan M Davis via Digitalmars-d
On Sunday, November 19, 2017 21:07:53 Meta via Digitalmars-d wrote: > On Sunday, 19 November 2017 at 12:54:37 UTC, Basile B. wrote: > > Yeah, "no worries" but for example a few weeks ago a bug report > > has drawn my attention: > > > > https://issues.dlang.org/show_bug.cgi?id=17925 > > > > After

Re: "body" keyword is unnecessary

2017-11-19 Thread Meta via Digitalmars-d
On Sunday, 19 November 2017 at 12:54:37 UTC, Basile B. wrote: Yeah, "no worries" but for example a few weeks ago a bug report has drawn my attention: https://issues.dlang.org/show_bug.cgi?id=17925 After testing some code with i've indeed observed that the transition period for `do` had

Re: "body" keyword is unnecessary

2017-11-19 Thread Basile B. via Digitalmars-d
On Saturday, 18 November 2017 at 19:22:25 UTC, Meta wrote: On Saturday, 18 November 2017 at 16:21:30 UTC, Eljay wrote: On Monday, 28 March 2011 at 18:59:03 UTC, Walter Bright wrote: On 3/27/2011 10:35 PM, Jonathan M Davis wrote: I'll be _very_ excited to have both the destructor issues and

Re: "body" keyword is unnecessary

2017-11-19 Thread Tony via Digitalmars-d
On Sunday, 19 November 2017 at 11:02:37 UTC, bauss wrote: They wouldn't need to know. Obviously they know its purpose and how it works if they have it in their source code, if they don't have it in their source code and they look at contracts, then they will be fine either way as it's not a

Re: "body" keyword is unnecessary

2017-11-19 Thread Tony via Digitalmars-d
On Sunday, 19 November 2017 at 11:02:37 UTC, bauss wrote: On Sunday, 19 November 2017 at 08:13:32 UTC, Tony wrote: On Sunday, 19 November 2017 at 08:05:38 UTC, Tony wrote: OK, but how would someone who is looking at: https://docarchives.dlang.io/v2.074.0/spec/contracts.html I wish this

Re: "body" keyword is unnecessary

2017-11-19 Thread bauss via Digitalmars-d
On Sunday, 19 November 2017 at 08:13:32 UTC, Tony wrote: On Sunday, 19 November 2017 at 08:05:38 UTC, Tony wrote: OK, but how would someone who is looking at: https://docarchives.dlang.io/v2.074.0/spec/contracts.html I wish this board had an edit function. That should be "OK, but how

Re: "body" keyword is unnecessary

2017-11-19 Thread Tony via Digitalmars-d
On Sunday, 19 November 2017 at 08:05:38 UTC, Tony wrote: OK, but how would someone who is looking at: https://docarchives.dlang.io/v2.074.0/spec/contracts.html I wish this board had an edit function. That should be "OK, but how would someone who is looking at:

Re: "body" keyword is unnecessary

2017-11-19 Thread Tony via Digitalmars-d
On Sunday, 19 November 2017 at 07:21:32 UTC, Seb wrote: On Sunday, 19 November 2017 at 04:57:11 UTC, Tony wrote: On Saturday, 18 November 2017 at 19:22:25 UTC, Meta wrote: On Saturday, 18 November 2017 at 16:21:30 UTC, Eljay wrote: [...] Don't worry, you've got a few years yet. Currently

Re: "body" keyword is unnecessary

2017-11-18 Thread Seb via Digitalmars-d
On Sunday, 19 November 2017 at 04:57:11 UTC, Tony wrote: On Saturday, 18 November 2017 at 19:22:25 UTC, Meta wrote: On Saturday, 18 November 2017 at 16:21:30 UTC, Eljay wrote: [...] Don't worry, you've got a few years yet. Currently `body`is not even deprecated; it's become a conditional

Re: "body" keyword is unnecessary

2017-11-18 Thread Tony via Digitalmars-d
On Saturday, 18 November 2017 at 19:22:25 UTC, Meta wrote: On Saturday, 18 November 2017 at 16:21:30 UTC, Eljay wrote: On Monday, 28 March 2011 at 18:59:03 UTC, Walter Bright wrote: On 3/27/2011 10:35 PM, Jonathan M Davis wrote: I'll be _very_ excited to have both the destructor issues and

Re: "body" keyword is unnecessary

2017-11-18 Thread Meta via Digitalmars-d
On Saturday, 18 November 2017 at 16:21:30 UTC, Eljay wrote: On Monday, 28 March 2011 at 18:59:03 UTC, Walter Bright wrote: On 3/27/2011 10:35 PM, Jonathan M Davis wrote: I'll be _very_ excited to have both the destructor issues and the const issues sorted out. They are some of the more

Re: "body" keyword is unnecessary

2017-11-18 Thread bauss via Digitalmars-d
On Saturday, 18 November 2017 at 16:21:30 UTC, Eljay wrote: On Monday, 28 March 2011 at 18:59:03 UTC, Walter Bright wrote: On 3/27/2011 10:35 PM, Jonathan M Davis wrote: [...] Yes, I agree those are the top priority at the moment, now that we have the 64 bit compiler online and the worst of

Re: "body" keyword is unnecessary

2017-11-18 Thread Eljay via Digitalmars-d
On Monday, 28 March 2011 at 18:59:03 UTC, Walter Bright wrote: On 3/27/2011 10:35 PM, Jonathan M Davis wrote: I'll be _very_ excited to have both the destructor issues and the const issues sorted out. They are some of the more annoying quality of implementation issues at the moment. Yes, I

Re: body keyword is unnecessary

2013-07-28 Thread Vlad
Hate to reopen old threads.. but I didn't find another one on this topic. Supposing someone wants to implement a browser in D. And his bindings to JavaScript need to expose HTMLDocument.body property. Is that a use case that would work for allowing body not to be a keyword? -- Vlad

[Issue 5775] body keyword is unnecessary

2012-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5775 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added Status|NEW |RESOLVED

Re: body keyword is unnecessary

2011-03-28 Thread Walter Bright
On 3/27/2011 10:35 PM, Jonathan M Davis wrote: I'll be _very_ excited to have both the destructor issues and the const issues sorted out. They are some of the more annoying quality of implementation issues at the moment. Yes, I agree those are the top priority at the moment, now that we have

Re: body keyword is unnecessary

2011-03-27 Thread Walter Bright
On 3/23/2011 3:17 PM, Alvaro wrote: D already has a long list of keywords, reserved words can't be used as identifiers, which can be annoying. body in particular is a common noun that programmers would gladly use as a variable name in physics simulation, astronomy, mechanics, games, health, etc.

Re: body keyword is unnecessary

2011-03-27 Thread Jonathan M Davis
On 2011-03-27 22:23, Walter Bright wrote: On 3/23/2011 3:17 PM, Alvaro wrote: D already has a long list of keywords, reserved words can't be used as identifiers, which can be annoying. body in particular is a common noun that programmers would gladly use as a variable name in physics

Re: body keyword is unnecessary

2011-03-26 Thread Alvaro
El 25/03/2011 22:40, piotrek escribió: Speaking of real world examples(is my world really real? :D) I hit body when I was doing an html generator. Long before that when I was reading language specification I looked with distaste at the body keyword in the contract programming section. Still no

Re: body keyword is unnecessary

2011-03-26 Thread bearophile
Alvaro: A bit off-topic post: It's not off-topic, you have shown one case where the keyword body is useful as variable name. I first hit body when porting the nbody benchmark test from the Computer Language Shootout to D. Time ago I have translated to D (D1, mostly) all Shootout

Re: body keyword is unnecessary

2011-03-25 Thread Bekenn
On 3/24/2011 12:55 PM, Steven Schveighoffer wrote: I wouldn't mind it becoming a contextual keyword (like C#'s get and set inside properties). This is exactly what it should be.

Re: body keyword is unnecessary

2011-03-25 Thread Don
piotrek wrote: On Thu, 24 Mar 2011 16:04:25 +0100, Don wrote: piotrek wrote: On Thu, 24 Mar 2011 21:37:12 +0800, KennyTM~ wrote: On Mar 24, 11 19:00, sclytrack wrote: == Quote from piotrek (star...@tlen.pl)'s article On Wed, 23 Mar 2011 23:17:32 +0100, Alvaro wrote: D already has a long

Re: body keyword is unnecessary

2011-03-25 Thread Andrej Mitrovic
On 3/25/11, Jonathan M Davis jmdavisp...@gmx.com wrote: snip Well, I was really referring to C client-code, not templated D library code, maybe I should have made myself more clear on that :) Generic code uses generic names, it makes the most sense there. So I agree with everything you've said.

Re: body keyword is unnecessary

2011-03-25 Thread piotrek
On Fri, 25 Mar 2011 10:09:25 +0100, Don wrote: piotrek wrote: On Thu, 24 Mar 2011 16:04:25 +0100, Don wrote: piotrek wrote: On Thu, 24 Mar 2011 21:37:12 +0800, KennyTM~ wrote: On Mar 24, 11 19:00, sclytrack wrote: == Quote from piotrek (star...@tlen.pl)'s article On Wed, 23 Mar 2011

Re: body keyword is unnecessary

2011-03-25 Thread Walter Bright
On 3/25/2011 2:09 AM, Don wrote: Walter makes all the language decisions. The rest of us have just been able to convince him on multiple occasions (but I think that even Andrei has not achieved 50% convince rate). Hint #1: if you want to convince Walter, produce some real world use cases. Hint

Re: body keyword is unnecessary

2011-03-25 Thread Walter Bright
On 3/25/2011 2:40 PM, piotrek wrote: I really appreciate Walter's work and didn't want to make any pressure on him (like I could ;). I'm grateful for him for all amazing staff he did. D is the most beautiful language I have seen. It has its pitfalls, but we know there can't be any perfect one.

Re: body keyword is unnecessary

2011-03-25 Thread bearophile
Walter: Thanks for the kind words. Not everyone thinks that way http://www.reddit.com/r/programming/comments/gacna/bye_bye_nullpointerexceptions/c1m3r7n :-) I didn't see that thread, thank you for the link. Some of your answers shown in that Reddit page were really wrong (like that null

Re: body keyword is unnecessary

2011-03-24 Thread Bekenn
Interestingly, you don't even have to remove body from the syntax to remove it as a keyword, as it's only used in this context (that I know of), where no other symbols make sense.

Re: body keyword is unnecessary

2011-03-24 Thread Sönke Ludwig
I'm all for this change. Since there are already similar differences between 1.0 and 2.0 (e.g. invariant()) and projects can be fixed by a more or less simple search and replace, this would be a cheap way to clean up a keyword that can truly get in your way (in contrast to some others that

Re: body keyword is unnecessary

2011-03-24 Thread piotrek
On Wed, 23 Mar 2011 23:17:32 +0100, Alvaro wrote: D already has a long list of keywords, reserved words can't be used as identifiers, which can be annoying. body in particular is a common noun that programmers would gladly use as a variable name in physics simulation, astronomy, mechanics,

Re: body keyword is unnecessary

2011-03-24 Thread sclytrack
== Quote from piotrek (star...@tlen.pl)'s article On Wed, 23 Mar 2011 23:17:32 +0100, Alvaro wrote: D already has a long list of keywords, reserved words can't be used as identifiers, which can be annoying. body in particular is a common noun that programmers would gladly use as a variable

Re: body keyword is unnecessary

2011-03-24 Thread bearophile
sclytrack: Copied the following line from the Vala (=mostly reference counted language) web page. It is possible to use a reserved keyword as identifier name by prefixing it with the @ character. This character is not part of the name. For example, you can name a method foreach by

Re: body keyword is unnecessary

2011-03-24 Thread KennyTM~
On Mar 24, 11 19:00, sclytrack wrote: == Quote from piotrek (star...@tlen.pl)'s article On Wed, 23 Mar 2011 23:17:32 +0100, Alvaro wrote: D already has a long list of keywords, reserved words can't be used as identifiers, which can be annoying. body in particular is a common noun that

Re: body keyword is unnecessary

2011-03-24 Thread piotrek
On Thu, 24 Mar 2011 21:37:12 +0800, KennyTM~ wrote: On Mar 24, 11 19:00, sclytrack wrote: == Quote from piotrek (star...@tlen.pl)'s article On Wed, 23 Mar 2011 23:17:32 +0100, Alvaro wrote: D already has a long list of keywords, reserved words can't be used as identifiers, which can be

Re: body keyword is unnecessary

2011-03-24 Thread Don
piotrek wrote: On Thu, 24 Mar 2011 21:37:12 +0800, KennyTM~ wrote: On Mar 24, 11 19:00, sclytrack wrote: == Quote from piotrek (star...@tlen.pl)'s article On Wed, 23 Mar 2011 23:17:32 +0100, Alvaro wrote: D already has a long list of keywords, reserved words can't be used as identifiers,

Re: body keyword is unnecessary

2011-03-24 Thread piotrek
On Thu, 24 Mar 2011 16:04:25 +0100, Don wrote: piotrek wrote: On Thu, 24 Mar 2011 21:37:12 +0800, KennyTM~ wrote: On Mar 24, 11 19:00, sclytrack wrote: == Quote from piotrek (star...@tlen.pl)'s article On Wed, 23 Mar 2011 23:17:32 +0100, Alvaro wrote: D already has a long list of

Re: body keyword is unnecessary

2011-03-24 Thread KennyTM~
On Mar 24, 11 22:25, piotrek wrote: On Thu, 24 Mar 2011 21:37:12 +0800, KennyTM~ wrote: On Mar 24, 11 19:00, sclytrack wrote: == Quote from piotrek (star...@tlen.pl)'s article On Wed, 23 Mar 2011 23:17:32 +0100, Alvaro wrote: D already has a long list of keywords, reserved words can't be

Re: body keyword is unnecessary

2011-03-24 Thread piotrek
On Fri, 25 Mar 2011 00:50:56 +0800, KennyTM~ wrote: On Mar 24, 11 22:25, piotrek wrote: On Thu, 24 Mar 2011 21:37:12 +0800, KennyTM~ wrote: On Mar 24, 11 19:00, sclytrack wrote: == Quote from piotrek (star...@tlen.pl)'s article On Wed, 23 Mar 2011 23:17:32 +0100, Alvaro wrote: D already

Re: body keyword is unnecessary

2011-03-24 Thread Steven Schveighoffer
On Wed, 23 Mar 2011 18:17:32 -0400, Alvaro alvarodotseg...@gmail.com wrote: D already has a long list of keywords, reserved words can't be used as identifiers, which can be annoying. body in particular is a common noun that programmers would gladly use as a variable name in physics

Re: body keyword is unnecessary

2011-03-24 Thread Nick Sabalausky
Sönke Ludwig lud...@informatik.uni-luebeck.de wrote in message news:imeqnd$12ss$1...@digitalmars.com... I'm all for this change. Since there are already similar differences between 1.0 and 2.0 (e.g. invariant()) and projects can be fixed by a more or less simple search and replace, this

Re: body keyword is unnecessary

2011-03-24 Thread Andrej Mitrovic
I definitely had in as a problem. Its because some people like to use that in C code. (Qt being the most recent example). I've also had issues with string. That one can be common in C code. Its a pretty bad habit of naming your variables for what type they are instead of their purpose. I guess it

Re: body keyword is unnecessary

2011-03-24 Thread Jonathan M Davis
I definitely had in as a problem. Its because some people like to use that in C code. (Qt being the most recent example). I've also had issues with string. That one can be common in C code. Its a pretty bad habit of naming your variables for what type they are instead of their purpose. I

Re: body keyword is unnecessary

2011-03-24 Thread Andrej Mitrovic
On 3/24/11, Jonathan M Davis jmdavisp...@gmx.com wrote: Now, string is pretty bad on the whole, but then again, there are plenty of cases where you just don't care about what a string is for. You don't care now, but you'll care later when its time to fix a bug. Sometimes, its obvious what a

Re: body keyword is unnecessary

2011-03-24 Thread Jonathan M Davis
On 2011-03-24 16:23:40, Andrej Mitrovic wrote: On 3/24/11, Jonathan M Davis jmdavisp...@gmx.com wrote: Now, string is pretty bad on the whole, but then again, there are plenty of cases where you just don't care about what a string is for. You don't care now, but you'll care later when its

Re: body keyword is unnecessary

2011-03-24 Thread Ary Manzana
On 3/24/11 4:02 AM, Bekenn wrote: Interestingly, you don't even have to remove body from the syntax to remove it as a keyword, as it's only used in this context (that I know of), where no other symbols make sense. And oh so many keywords could be removed from the language if the compiler is

Re: body keyword is unnecessary

2011-03-24 Thread Bekenn
On 3/24/2011 12:55 PM, Steven Schveighoffer wrote: But I don't know that it's so terrible to have it as a keyword. Clearly there was a free keyword love period in D's past, but I think it takes a lot more than just we could technically do this without a keyword to remove it from the language.

body keyword is unnecessary

2011-03-23 Thread Alvaro
D already has a long list of keywords, reserved words can't be used as identifiers, which can be annoying. body in particular is a common noun that programmers would gladly use as a variable name in physics simulation, astronomy, mechanics, games, health, etc. I think body can be removed from

Re: body keyword is unnecessary

2011-03-23 Thread Trass3r
Yep, this has been brought up at least once before. Nothing has happened so far.

[Issue 5775] New: body keyword is unnecessary

2011-03-23 Thread d-bugmail
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

[Issue 5775] body keyword is unnecessary

2011-03-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5775 bearophile_h...@eml.cc changed: What|Removed |Added CC||bearophile_h...@eml.cc ---

[Issue 5775] body keyword is unnecessary

2011-03-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5775 Jonathan M Davis jmdavisp...@gmx.com changed: What|Removed |Added CC|