digitalmars.D - Looking for Details On Recent Changes
- Xinok (5/6) Apr 11 2007 I'm looking for details on two changes in particular.
- Dan (3/11) Apr 11 2007 Aww shit. D's getting macros? I was hoping to avoid having to read tho...
- Chris Nicholson-Sauls (18/30) Apr 11 2007 Yes macros, but nothing like C pre-processor macros. No #DEFINE's in si...
- Don Clugston (3/10) Apr 11 2007 Right now, it does nothing except gives an error if you try to use it.
- =?ISO-8859-1?Q?Jari-Matti_M=E4kel=E4?= (12/19) Apr 11 2007 There's an example about it on the template page.
I'm looking for details on two changes in particular. First comes from 1.011, being the macro keyword. I can't find anything about it, and I have no idea how to use it. Second comes from 1.010:I don't understand what this means exactly?Added template partial specialization derived from multiple parameters.
Apr 11 2007
Xinok Wrote:I'm looking for details on two changes in particular. First comes from 1.011, being the macro keyword. I can't find anything about it, and I have no idea how to use it. Second comes from 1.010: >> Added template partial specialization derived from multiple parameters. I don't understand what this means exactly?Aww shit. D's getting macros? I was hoping to avoid having to read those. and... wow. let me get my dictionary.
Apr 11 2007
Dan wrote:Xinok Wrote:Yes macros, but nothing like C pre-processor macros. No #DEFINE's in sight. From the prior discussions on this, they will appear something more like this: macro default_gettor (name, var) { typeof(var) name () { return var; } } class Foo { private int _bar ; this (int barval) { _bar = barval; } default_gettor(bar, _bar); } Contrived example, but you get the notion of what it will make possible. Presumably they could also be used with Tuples via a wrapping template... which means you could write a template-macro pair that cough up an entire module for, say, a variant type with some simple introspection capabilities, which can have new types/behaviors added to it just by adding one relatively simple line to a macro call or template instantiation at the bottom of the module. (At least, that's a rough description of something I plan to do with them.) -- Chris Nicholson-SaulsI'm looking for details on two changes in particular. First comes from 1.011, being the macro keyword. I can't find anything about it, and I have no idea how to use it. Second comes from 1.010: >> Added template partial specialization derived from multiple parameters. I don't understand what this means exactly?Aww shit. D's getting macros? I was hoping to avoid having to read those.
Apr 11 2007
Xinok wrote:I'm looking for details on two changes in particular. First comes from 1.011, being the macro keyword. I can't find anything about it, and I have no idea how to use it.Right now, it does nothing except gives an error if you try to use it. Like 'cent'.Second comes from 1.010: >> Added template partial specialization derived from multiple parameters. I don't understand what this means exactly?
Apr 11 2007
Xinok wrote:I'm looking for details on two changes in particular. First comes from 1.011, being the macro keyword. I can't find anything about it, and I have no idea how to use it.It has been just reserved now. It will do something in the (near) future.Second comes from 1.010:There's an example about it on the template page. http://digitalmars.com/d/template.html Deduction from a specialization can provide values for more than one parameter: template Foo(T: T[U], U) { ... } Foo!(int[long]) // instantiates Foo with T set to int, U set to long Although I also had to diff those docs to find it.I don't understand what this means exactly?Added template partial specialization derived from multiple parameters.
Apr 11 2007