digitalmars.D - C++ Stylistics
- bearophile (7/7) Jul 17 2010 A Google talk in 2008 by Kevlin Henney, "C++ Stylistics":
- Justin Johansson (8/17) Jul 18 2010 You may have missed it but I raised the topic of Qt, it's signals
- BLS (21/42) Jul 18 2010 I regret that this is such a silence discussion. In fact Lutger (sorry
- Rory McGuire (4/53) Jul 19 2010 Copied from http://digitalmars.com/d/2.0/phobos/std_traits.html
- Rory McGuire (6/68) Jul 19 2010 template isProperty(alias func) if (isCallable!(func)) {
- BLS (3/7) Jul 19 2010 THANKS Rory
- Rory McGuire (4/12) Jul 19 2010 I suppose so, currently one needs to make a wrapper for all the function...
A Google talk in 2008 by Kevlin Henney, "C++ Stylistics": http://www.youtube.com/watch?v=zh8W4ZglOlw Some of the limits/problems of C++ he talks about are patched by Qt, like signals & slots, Q_FLAGS, Q_PROPERTY, Q_ENUMS: http://doc.trolltech.com/latest/moc.html GUIs have needs quite different from the features offered by standard C++: they don't need high speed processing, but they enjoy a good runtime reflection and few other things, most of them offered in some way by the Qt "Meta-Object Compiler". Bye, bearophile
Jul 17 2010
bearophile wrote:A Google talk in 2008 by Kevlin Henney, "C++ Stylistics": http://www.youtube.com/watch?v=zh8W4ZglOlw Some of the limits/problems of C++ he talks about are patched by Qt, like signals & slots, Q_FLAGS, Q_PROPERTY, Q_ENUMS: http://doc.trolltech.com/latest/moc.html GUIs have needs quite different from the features offered by standard C++: they don't need high speed processing, but they enjoy a good runtime reflection and few other things, most of them offered in some way by the Qt "Meta-Object Compiler". Bye, bearophileYou may have missed it but I raised the topic of Qt, it's signals and slots architecture and its meta object compiler, on this newsgroup about two months ago under the subject "Can D be cute (Qt)" http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=109832 Cheers Justin Johansson
Jul 18 2010
On 18/07/2010 11:42, Justin Johansson wrote:bearophile wrote:I regret that this is such a silence discussion. In fact Lutger (sorry don't know your full name) has implemented a fine QT like thread safe Signal Slot library. // Q_FLAGS, Q_PROPERTY, Q_ENUMS and GUI Finally this means > we need more _traits() power. --We have, afaik. no support for isProperty(), and to make visual/interactive GUI development possible, isEvent() is also necessary. -- Now that we know that Compile- to Run- time Reflection could be just a mixin template away we have another good reason to ask for more (meta) _traits power. --Uwe Salomon's Indigo library is also offering a lot of ideas in this regard .. one thing I would name here is internationalization. --QT in D.... ? D bindings to GUI APIs are already there, but wait ... / I think the point is to give a pure *D2 QT implementation* a go, and let's see WHERE the compiler/language is not good enough. Like Andrei did it for his std.algorithm. / BjoernA Google talk in 2008 by Kevlin Henney, "C++ Stylistics": http://www.youtube.com/watch?v=zh8W4ZglOlw Some of the limits/problems of C++ he talks about are patched by Qt, like signals & slots, Q_FLAGS, Q_PROPERTY, Q_ENUMS: http://doc.trolltech.com/latest/moc.html GUIs have needs quite different from the features offered by standard C++: they don't need high speed processing, but they enjoy a good runtime reflection and few other things, most of them offered in some way by the Qt "Meta-Object Compiler". Bye, bearophileYou may have missed it but I raised the topic of Qt, it's signals and slots architecture and its meta object compiler, on this newsgroup about two months ago under the subject "Can D be cute (Qt)" http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=109832 Cheers Justin Johansson
Jul 18 2010
On Sun, 18 Jul 2010 23:21:14 +0200, BLS <windevguy hotmail.de> wrote:On 18/07/2010 11:42, Justin Johansson wrote:Copied from http://digitalmars.com/d/2.0/phobos/std_traits.html isProperty can be implemented using: functionAttributes!(foo.func) & FunctionAttribute.PROPERTYbearophile wrote:I regret that this is such a silence discussion. In fact Lutger (sorry don't know your full name) has implemented a fine QT like thread safe Signal Slot library. // Q_FLAGS, Q_PROPERTY, Q_ENUMS and GUI Finally this means > we need more _traits() power. --We have, afaik. no support for isProperty(), and to make visual/interactive GUI development possible, isEvent() is also necessary.A Google talk in 2008 by Kevlin Henney, "C++ Stylistics": http://www.youtube.com/watch?v=zh8W4ZglOlw Some of the limits/problems of C++ he talks about are patched by Qt, like signals & slots, Q_FLAGS, Q_PROPERTY, Q_ENUMS: http://doc.trolltech.com/latest/moc.html GUIs have needs quite different from the features offered by standard C++: they don't need high speed processing, but they enjoy a good runtime reflection and few other things, most of them offered in some way by the Qt "Meta-Object Compiler". Bye, bearophileYou may have missed it but I raised the topic of Qt, it's signals and slots architecture and its meta object compiler, on this newsgroup about two months ago under the subject "Can D be cute (Qt)" http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=109832 Cheers Justin Johansson-- Now that we know that Compile- to Run- time Reflection could be just a mixin template away we have another good reason to ask for more (meta) _traits power. --Uwe Salomon's Indigo library is also offering a lot of ideas in this regard .. one thing I would name here is internationalization. --QT in D.... ? D bindings to GUI APIs are already there, but wait ... / I think the point is to give a pure *D2 QT implementation* a go, and let's see WHERE the compiler/language is not good enough. Like Andrei did it for his std.algorithm. / Bjoern
Jul 19 2010
On Mon, 19 Jul 2010 10:52:51 +0200, Rory McGuire <rmcguire neonova.co.za> wrote:On Sun, 18 Jul 2010 23:21:14 +0200, BLS <windevguy hotmail.de> wrote:template isProperty(alias func) if (isCallable!(func)) { enum isProperty = (functionAttributes!(func) & FunctionAttribute.PROPERTY)==0 ? false : true; }On 18/07/2010 11:42, Justin Johansson wrote:Copied from http://digitalmars.com/d/2.0/phobos/std_traits.html isProperty can be implemented using: functionAttributes!(foo.func) & FunctionAttribute.PROPERTYbearophile wrote:I regret that this is such a silence discussion. In fact Lutger (sorry don't know your full name) has implemented a fine QT like thread safe Signal Slot library. // Q_FLAGS, Q_PROPERTY, Q_ENUMS and GUI Finally this means > we need more _traits() power. --We have, afaik. no support for isProperty(), and to make visual/interactive GUI development possible, isEvent() is also necessary.A Google talk in 2008 by Kevlin Henney, "C++ Stylistics": http://www.youtube.com/watch?v=zh8W4ZglOlw Some of the limits/problems of C++ he talks about are patched by Qt, like signals & slots, Q_FLAGS, Q_PROPERTY, Q_ENUMS: http://doc.trolltech.com/latest/moc.html GUIs have needs quite different from the features offered by standard C++: they don't need high speed processing, but they enjoy a good runtime reflection and few other things, most of them offered in some way by the Qt "Meta-Object Compiler". Bye, bearophileYou may have missed it but I raised the topic of Qt, it's signals and slots architecture and its meta object compiler, on this newsgroup about two months ago under the subject "Can D be cute (Qt)" http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=109832 Cheers Justin Johansson-- Now that we know that Compile- to Run- time Reflection could be just a mixin template away we have another good reason to ask for more (meta) _traits power. --Uwe Salomon's Indigo library is also offering a lot of ideas in this regard .. one thing I would name here is internationalization. --QT in D.... ? D bindings to GUI APIs are already there, but wait ... / I think the point is to give a pure *D2 QT implementation* a go, and let's see WHERE the compiler/language is not good enough. Like Andrei did it for his std.algorithm. / Bjoern
Jul 19 2010
On 19/07/2010 10:58, Rory McGuire wrote:template isProperty(alias func) if (isCallable!(func)) { enum isProperty = (functionAttributes!(func) & FunctionAttribute.PROPERTY)==0 ? false : true; }THANKS Rory isProperty() should become part of phobos.
Jul 19 2010
On Mon, 19 Jul 2010 20:33:59 +0200, BLS <windevguy hotmail.de> wrote:On 19/07/2010 10:58, Rory McGuire wrote:I suppose so, currently one needs to make a wrapper for all the function attributes that you might want to detect.template isProperty(alias func) if (isCallable!(func)) { enum isProperty = (functionAttributes!(func) & FunctionAttribute.PROPERTY)==0 ? false : true; }THANKS Rory isProperty() should become part of phobos.
Jul 19 2010