Jump to page: 1 2
Thread overview
operators in language reference
Apr 01, 2015
John Colvin
Apr 01, 2015
John Colvin
Apr 01, 2015
John Colvin
Apr 01, 2015
ketmar
Apr 01, 2015
John Colvin
Apr 01, 2015
ketmar
Apr 01, 2015
John Colvin
Apr 01, 2015
ketmar
April 01, 2015
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.
April 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
April 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:
>> 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
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.

> and related http://dlang.org/operatoroverloading.html
Yes, 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!).
April 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:
>> 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
> 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.

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.
April 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:
>> 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:
>>>> 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
>> 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.
>
> 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.

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"
April 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:
>> 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:
>>>> 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
>>> 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.
>>
>> 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.
>
> Yeah, but scattered all over the different chapters.

I meant just in http://dlang.org/expression.html. All the novel operators are described there, including what they do.

> 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"

Agreed.
April 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.

April 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 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.

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.
April 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:
>> 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.
> 
> 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.

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?

April 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.
« First   ‹ Prev
1 2