digitalmars.D - operators in language reference
- Dominikus Dittes Scherkl (10/10) Apr 01 2015 There is a gapping hole in the language reference: The operators
- John Colvin (4/15) Apr 01 2015 http://dlang.org/expression.html
- Dominikus Dittes Scherkl (13/28) Apr 01 2015 This describes what operators (tokens) exist and what operands
- John Colvin (7/28) Apr 01 2015 With exception of the ones that are the same in C, I can't spot
- Dominikus Dittes Scherkl (7/35) Apr 01 2015 Yeah, but scattered all over the different chapters. And not
- John Colvin (5/42) Apr 01 2015 I meant just in http://dlang.org/expression.html. All the novel
- ketmar (2/5) Apr 01 2015 newbie should read some textbook first.=
- John Colvin (5/13) Apr 01 2015 I think the language reference should be a comprehensive document
- ketmar (5/18) Apr 01 2015 does this including IEEE floating point number description down to bits,...
- Dominikus Dittes Scherkl (10/16) Apr 01 2015 At least a reference to another (concurrent!) language is not so
- John Colvin (4/21) Apr 01 2015 A table in the wiki with a one-line description and example each
- ketmar (3/4) Apr 01 2015 why, C/C++ aren't a rivals. it's like telling that mongolfier (C/C++) is...
There is a gapping hole in the language reference: The operators are nowhere described. Ok, most of them are the same as in C and C++, but there are subtle differences (e.g. different precedence) and some are new (the floating point comparisons have their own chapter and they are about to beeing deprecated, but what about >>>, ^^, ^^=, =>, ., is, in ?). And even if they where all the same as in C or C++, not everybody comes from those languages and D should be understandable without such kind of background knowledge, I think.
Apr 01 2015
On Wednesday, 1 April 2015 at 10:06:20 UTC, Dominikus Dittes Scherkl wrote:There is a gapping hole in the language reference: The operators are nowhere described. Ok, most of them are the same as in C and C++, but there are subtle differences (e.g. different precedence) and some are new (the floating point comparisons have their own chapter and they are about to beeing deprecated, but what about >>>, ^^, ^^=, =>, ., is, in ?). And even if they where all the same as in C or C++, not everybody comes from those languages and D should be understandable without such kind of background knowledge, I think.http://dlang.org/expression.html and related http://dlang.org/operatoroverloading.html
Apr 01 2015
On Wednesday, 1 April 2015 at 10:39:01 UTC, John Colvin wrote:On Wednesday, 1 April 2015 at 10:06:20 UTC, Dominikus Dittes Scherkl wrote:This describes what operators (tokens) exist and what operands they can take (form a grammar point of view), but not what they do. You may say that's obvious, but I know languages where even "+" doesn't do what one might expect.There is a gapping hole in the language reference: The operators are nowhere described. Ok, most of them are the same as in C and C++, but there are subtle differences (e.g. different precedence) and some are new (the floating point comparisons have their own chapter and they are about to beeing deprecated, but what about >>>, ^^, ^^=, =>, ., is, in ?). And even if they where all the same as in C or C++, not everybody comes from those languages and D should be understandable without such kind of background knowledge, I think.http://dlang.org/expression.htmland related http://dlang.org/operatoroverloading.htmlYes, this goes further into details what operands an operator take (especially if it is only one or two or more operands), but not what they do - in this chapter this is especially useless, as if I overload an operator, it will do whatever I want it to do even if it is strange as hell. So this is not the right place to describe the default behaviour of an operator (but ok, It should refer to that place --- if only there would be one!).
Apr 01 2015
On Wednesday, 1 April 2015 at 10:53:57 UTC, Dominikus Dittes Scherkl wrote:On Wednesday, 1 April 2015 at 10:39:01 UTC, John Colvin wrote:With exception of the ones that are the same in C, I can't spot any that are missing an explanation. I agree that it would be good to have a more beginner friendly description of them all, but to a C(++) programmer I would say that document contains the info they need.On Wednesday, 1 April 2015 at 10:06:20 UTC, Dominikus Dittes Scherkl wrote:This describes what operators (tokens) exist and what operands they can take (form a grammar point of view), but not what they do. You may say that's obvious, but I know languages where even "+" doesn't do what one might expect.There is a gapping hole in the language reference: The operators are nowhere described. Ok, most of them are the same as in C and C++, but there are subtle differences (e.g. different precedence) and some are new (the floating point comparisons have their own chapter and they are about to beeing deprecated, but what about >>>, ^^, ^^=, =>, ., is, in ?). And even if they where all the same as in C or C++, not everybody comes from those languages and D should be understandable without such kind of background knowledge, I think.http://dlang.org/expression.html
Apr 01 2015
On Wednesday, 1 April 2015 at 11:18:26 UTC, John Colvin wrote:On Wednesday, 1 April 2015 at 10:53:57 UTC, Dominikus Dittes Scherkl wrote:Yeah, but scattered all over the different chapters. And not describing those that are the same in C++ is like not describing the types float and short, just because they are the same in C++. I find it lacking if I have to tell a newbie "look in the documentation for some other language for the definition of the operators that you can't find here somewhere"On Wednesday, 1 April 2015 at 10:39:01 UTC, John Colvin wrote:With exception of the ones that are the same in C, I can't spot any that are missing an explanation. I agree that it would be good to have a more beginner friendly description of them all, but to a C(++) programmer I would say that document contains the info they need.On Wednesday, 1 April 2015 at 10:06:20 UTC, Dominikus Dittes Scherkl wrote:This describes what operators (tokens) exist and what operands they can take (form a grammar point of view), but not what they do. You may say that's obvious, but I know languages where even "+" doesn't do what one might expect.There is a gapping hole in the language reference: The operators are nowhere described. Ok, most of them are the same as in C and C++, but there are subtle differences (e.g. different precedence) and some are new (the floating point comparisons have their own chapter and they are about to beeing deprecated, but what about >>>, ^^, ^^=, =>, ., is, in ?). And even if they where all the same as in C or C++, not everybody comes from those languages and D should be understandable without such kind of background knowledge, I think.http://dlang.org/expression.html
Apr 01 2015
On Wednesday, 1 April 2015 at 12:40:26 UTC, Dominikus Dittes Scherkl wrote:On Wednesday, 1 April 2015 at 11:18:26 UTC, John Colvin wrote:I meant just in http://dlang.org/expression.html. All the novel operators are described there, including what they do.On Wednesday, 1 April 2015 at 10:53:57 UTC, Dominikus Dittes Scherkl wrote:Yeah, but scattered all over the different chapters.On Wednesday, 1 April 2015 at 10:39:01 UTC, John Colvin wrote:With exception of the ones that are the same in C, I can't spot any that are missing an explanation. I agree that it would be good to have a more beginner friendly description of them all, but to a C(++) programmer I would say that document contains the info they need.On Wednesday, 1 April 2015 at 10:06:20 UTC, Dominikus Dittes Scherkl wrote:This describes what operators (tokens) exist and what operands they can take (form a grammar point of view), but not what they do. You may say that's obvious, but I know languages where even "+" doesn't do what one might expect.There is a gapping hole in the language reference: The operators are nowhere described. Ok, most of them are the same as in C and C++, but there are subtle differences (e.g. different precedence) and some are new (the floating point comparisons have their own chapter and they are about to beeing deprecated, but what about >>>, ^^, ^^=, =>, ., is, in ?). And even if they where all the same as in C or C++, not everybody comes from those languages and D should be understandable without such kind of background knowledge, I think.http://dlang.org/expression.htmlAnd not describing those that are the same in C++ is like not describing the types float and short, just because they are the same in C++. I find it lacking if I have to tell a newbie "look in the documentation for some other language for the definition of the operators that you can't find here somewhere"Agreed.
Apr 01 2015
On Wed, 01 Apr 2015 12:40:24 +0000, Dominikus Dittes Scherkl wrote:I find it lacking if I have to tell a newbie "look in the documentation for some other language for the definition of the operators that you can't find here somewhere"newbie should read some textbook first.=
Apr 01 2015
On Wednesday, 1 April 2015 at 13:36:38 UTC, ketmar wrote:On Wed, 01 Apr 2015 12:40:24 +0000, Dominikus Dittes Scherkl wrote:I think the language reference should be a comprehensive document that doesn't technically require someone to know C(++) first to understand. It doesn't necessarily have to be newbie friendly, but it should be complete.I find it lacking if I have to tell a newbie "look in the documentation for some other language for the definition of the operators that you can't find here somewhere"newbie should read some textbook first.
Apr 01 2015
On Wed, 01 Apr 2015 15:25:28 +0000, John Colvin wrote:On Wednesday, 1 April 2015 at 13:36:38 UTC, ketmar wrote:does this including IEEE floating point number description down to bits,=20 for example? as it's essentialy the same thing: requirement to read=20 external sources. i.e. it's good and all that, but where we should draw the line?=On Wed, 01 Apr 2015 12:40:24 +0000, Dominikus Dittes Scherkl wrote:=20 I think the language reference should be a comprehensive document that doesn't technically require someone to know C(++) first to understand. It doesn't necessarily have to be newbie friendly, but it should be complete.I find it lacking if I have to tell a newbie "look in the documentation for some other language for the definition of the operators that you can't find here somewhere"newbie should read some textbook first.
Apr 01 2015
On Wednesday, 1 April 2015 at 15:42:31 UTC, ketmar wrote:does this including IEEE floating point number description down to bits, for example? as it's essentialy the same thing: requirement to read external sources. i.e. it's good and all that, but where we should draw the line?At least a reference to another (concurrent!) language is not so good. D aims to replace C/C++, so it should not refer to its definitions. But ok, I've read the expressions chapter again, and most operators are described good enought. For some it is clear from the naming of the operands (AddExpression implies an arithmetic operation of addition/subtraction) but it is not realy explicitly expressed.
Apr 01 2015
On Wednesday, 1 April 2015 at 15:50:20 UTC, Dominikus Dittes Scherkl wrote:On Wednesday, 1 April 2015 at 15:42:31 UTC, ketmar wrote:A table in the wiki with a one-line description and example each would be a nice idea, for a start.does this including IEEE floating point number description down to bits, for example? as it's essentialy the same thing: requirement to read external sources. i.e. it's good and all that, but where we should draw the line?At least a reference to another (concurrent!) language is not so good. D aims to replace C/C++, so it should not refer to its definitions. But ok, I've read the expressions chapter again, and most operators are described good enought. For some it is clear from the naming of the operands (AddExpression implies an arithmetic operation of addition/subtraction) but it is not realy explicitly expressed.
Apr 01 2015
On Wed, 01 Apr 2015 15:50:19 +0000, Dominikus Dittes Scherkl wrote:At least a reference to another (concurrent!) language is not so good.why, C/C++ aren't a rivals. it's like telling that mongolfier (C/C++) is=20 a rival to jet airplane (D).=
Apr 01 2015