Topic: question about naming conversations
Author: Ruslan Mullakhmetov <tiabaldu@gmail.com>
Date: Tue, 21 Dec 2010 22:35:03 CST Raw View
Hi. I got a couple of questions about names. Actually, just wondering.
First one, why in C++0x (when finally will it be released:) null
pointer is denoted by keyword 'nullptr' instead of more "common" and
wide spread among other c-like and c++-successors languages 'null' keyword?
And one more. Is the proposal to use 'this' keyword for constructors
and destructors? I realize that this is pure syntax sugar but as for me
it can't break anything in language except for some bringing some
duality for naming ctors and dtors.
BR, RM
--
[ comp.std.c++ is moderated. To submit articles, try posting with your ]
[ newsreader. If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: restor <akrzemi1@gmail.com>
Date: Thu, 23 Dec 2010 08:48:52 CST Raw View
> First one, why in C++0x (when finally will it be released:) null
> pointer is denoted by keyword 'nullptr' instead of more "common" and
> wide spread among other c-like and c++-successors languages 'null' keyword?
Hi,
See this paper
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf
for rationale for 'nullptr' name.
> And one more. Is the proposal to use 'this' keyword for constructors
> and destructors? I realize that this is pure syntax sugar but as for me
> it can't break anything in language except for some bringing some
> duality for naming ctors and dtors.
The following link points to the list of reported language defects:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3222.html
The document is too long for me to read, but my text editor counted
692 items. Not all of them are very important, but this is what the
The C++ Standards Committee needs to deal with, still before C++0x is
shipped. Given that it is not desirable (by anyone) that this work be
slowed down by considering an addition that is, as you yourself call
it, pure syntactic sugar. Not breaking anything is not a sufficient
argument for growing the C++ standard bigger.
Regards,
&rzej
--
[ comp.std.c++ is moderated. To submit articles, try posting with your ]
[ newsreader. If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: Francis Glassborow <francis.glassborow@btinternet.com>
Date: Thu, 23 Dec 2010 08:49:54 CST Raw View
On 22/12/2010 04:35, Ruslan Mullakhmetov wrote:
>
> Hi. I got a couple of questions about names. Actually, just wondering.
>
> First one, why in C++0x (when finally will it be released:) null
> pointer is denoted by keyword 'nullptr' instead of more "common" and
> wide spread among other c-like and c++-successors languages 'null' keyword?
because, among other reasons, of the widespread use of #define
versions of null some of which would break if null became a keyword.
>
> And one more. Is the proposal to use 'this' keyword for constructors
> and destructors? I realize that this is pure syntax sugar but as for me
> it can't break anything in language except for some bringing some
> duality for naming ctors and dtors.
I do not understand your question. Please give me an example.
--
[ comp.std.c++ is moderated. To submit articles, try posting with your ]
[ newsreader. If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: =?ISO-8859-1?Q?Daniel_Kr=FCgler?= <daniel.kruegler@googlemail.com>
Date: Thu, 23 Dec 2010 08:49:46 CST Raw View
Am 22.12.2010 05:35, schrieb Ruslan Mullakhmetov:
>
> Hi. I got a couple of questions about names. Actually, just wondering.
>
> First one, why in C++0x (when finally will it be released:) null
> pointer is denoted by keyword 'nullptr' instead of more "common" and
> wide spread among other c-like and c++-successors languages 'null' keyword?
See
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2214.pdf
for the rationale (especially around p. 6). Additionally note that
keywords in C++ are non-contextual in general (very recently an
exception has been introduced, though), which means that a common word
like 'null' cannot be introduced without breaking currently valid
code.
> And one more. Is the proposal to use 'this' keyword for constructors
> and destructors? I realize that this is pure syntax sugar but as for me
> it can't break anything in language except for some bringing some
> duality for naming ctors and dtors.
I'm not aware of such a proposal. Could you be a bit more specific? In
some languages 'this' can be used to denote a constructor delegate,
I'm not aware of any such usages for destructors, though. Neither
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf
nor any of its predecessors suggested this syntactic sugar form.
HTH & Greetings from Bremen,
Daniel Kr gler
--
[ comp.std.c++ is moderated. To submit articles, try posting with your ]
[ newsreader. If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: Ruslan Mullakhmetov <tiabaldu@gmail.com>
Date: Thu, 23 Dec 2010 18:49:16 CST Raw View
On 12/23/2010 5:48 PM, restor wrote:
>
> Hi,
> See this paper
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf
> for rationale for 'nullptr' name.
>
Thanks. Got answer for all my questions about nullptr.
>> And one more. Is the proposal to use 'this' keyword for constructors
>> and destructors? I realize that this is pure syntax sugar but as for me
>> it can't break anything in language except for some bringing some
>> duality for naming ctors and dtors.
>
> The following link points to the list of reported language defects:
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3222.html
> The document is too long for me to read, but my text editor counted
> 692 items. Not all of them are very important, but this is what the
> The C++ Standards Committee needs to deal with, still before C++0x is
> shipped. Given that it is not desirable (by anyone) that this work be
> slowed down by considering an addition that is, as you yourself call
> it, pure syntactic sugar. Not breaking anything is not a sufficient
> argument for growing the C++ standard bigger.
>
One's again, than you. As I wrote elsethread, I just was wondering
and sure that even the proposal like this have been committed it would
be declined.
BR, RM
--
[ comp.std.c++ is moderated. To submit articles, try posting with your ]
[ newsreader. If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: Ruslan Mullakhmetov <tiabaldu@gmail.com>
Date: Thu, 23 Dec 2010 18:49:38 CST Raw View
On 12/23/2010 5:49 PM, Francis Glassborow wrote:
>
>>
>> And one more. Is the proposal to use 'this' keyword for constructors
>> and destructors? I realize that this is pure syntax sugar but as for me
>> it can't break anything in language except for some bringing some
>> duality for naming ctors and dtors.
>
> I do not understand your question. Please give me an example.
>
I'm sorry. I meant following. In some languages 'this' is used for ctor
and dtor names. Following sample illustrates it.
class Foo {
this(); // default ctor
this( int ); // some other ctor
this( Foo & other ); // copy ctor
~this(); // dtor
};
class Bar : public Foo {
this() : Foo( 10 ){} // calling for base ctor is still by name.
~this(){}
};
this is pure and completely syntactic sugar, but i would like it very
much because it uniforms all ctor and dtors.
The question was does the proposal like this be discussed in committee?
I just was wondering because I realized that is too late and it's likely
would declined as useless.
BR, RM
--
[ comp.std.c++ is moderated. To submit articles, try posting with your ]
[ newsreader. If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]