Re: Versioned extern?

2011-07-29 Thread Aleksandar Ružičić
Ouh, haven't read that you don't want code to be mixed-in.. In that case.. I dunno :) 2011/7/29 Aleksandar Ružičić ruzicic.aleksan...@gmail.com: If I'm not mistaken extern() accepts only Identifier, not expression. I'm not really sure what's the best way to do that but I belive this should

Re: ddoc patterns

2011-04-08 Thread Aleksandar Ružičić
On Fri, Apr 8, 2011 at 8:52 PM, spir denis.s...@gmail.com wrote: Right, but IIUC unlike pre there is no guarantee for code contents not to be interpreted further. It's a semantic hint to the rendering engine (which is often used to perform syntax highlighting). AFAIK no major browser (A-grade

Re: ddoc patterns

2011-04-08 Thread Aleksandar Ružičić
On Fri, Apr 8, 2011 at 8:52 PM, spir denis.s...@gmail.com wrote: Yes:        Macros:            CODE = code$0/code That's really nice! I might take a look at ddoc and try to write some useful macros if it's expressive enough...

Re: Using opDispatch as *magic* getter/setter. Possible or not?

2011-03-31 Thread Aleksandar Ružičić
On Thu, Mar 31, 2011 at 8:52 AM, Jacob Carlborg d...@me.com wrote: Or, I think this will work as well: @property ref ConfigSection opDispatch(string sectionName, Args ...)(Args args) if (Args.length == 0) { // getter } @property ref ConfigSection opDispatch(string sectionName, Args

Re: Using opDispatch as *magic* getter/setter. Possible or not?

2011-03-31 Thread Aleksandar Ružičić
On Thu, Mar 31, 2011 at 1:30 PM, Steven Schveighoffer schvei...@yahoo.com wrote: or you can change the template parameters in the opDispatch setter: @property ref ConfigSection opDispatch(string sectionName, T : string)(T arg) -Steve Thanks, that's much more readable I now have these

Non-Virtual Interfaces

2011-03-04 Thread Aleksandar Ružičić
I'm trying to use NVI idiom but i keep getting errors from dmd. This is my setup: module test; import std.stdio; interface IBase { void foo(); void bar(); } interface IBar : IBase { final void bar() { writefln(IBar.bar()); } } class Foo : IBar

Re: Non-Virtual Interfaces

2011-03-04 Thread Aleksandar Ružičić
What you may want to consider is an abstract class instead of NVI, as long as you don't need multiple inheritance, it should be fine. -Steve Well, I've decided to give NVI a try just because multiple inheritance would be best way to do what I want (aldo I hate that feature of C++ and just

Re: Non-Virtual Interfaces

2011-03-04 Thread Aleksandar Ružičić
In D, the public function would have to be final to make it non-virtual/non- overridable, and the function it calls would have to be protected, since you can't override private functions ( http://d.puremagic.com/issues/show_bug.cgi?id=4542 ). In this case, you're trying to override final