Cycle detected between modules with ctors/dtors

2011-04-22 Thread Mandeep

Hi,

I am trying to compile the code that was working with dmd 2.050 using 
dmd 2.052.


The code compiles but it gives me errors with message when trying to run:

Cycle detected between modules with ctors/dtors

This was not happening earlier with 2.050. I am not able to produce a 
smaller test case for this but it is happening with a lot of code 
pieces. A few scenarios in which this is happening is if a class passes 
its reference to child class for usage.


I understand that the above might not be a fit datapoint for analysis 
but wanted to understand if this is known or someone else has faced this?



Thanks & Regards
Mandeep


Expression templates in D1

2011-04-22 Thread SiegeLord
I have been trying to create some simple expression templates in D1 but I've 
run into trouble. Here is a reduced test case:

class A
{
void opSub_r(T:int)(T a)
{

}

void opSub(T)(T a)
{

}
}

void main(char[][] args)
{  
A a;
a - 1;
a - a; // line 20
1 - a;
}

The error is:

test.d(20): Error: template test.A.opSub_r(T : int) does not match any function 
template declaration
test.d(20): Error: template test.A.opSub_r(T : int) cannot deduce template 
function from argument types !()(A)

My goal is to adjust the code such that the three expressions in the main 
function all compile. Both opSub's must be templated functions (as far as I can 
tell) so that the expression templates can work properly. Here is my full code, 
incidentally:

http://ideone.com/2vZdN

Any ideas of any workabouts? Has anyone done expression templates in D1 and got 
them to work?

And yes... the code above works fine in D2, but I want to try to get it to work 
in D1 for now.

Thanks,

-SiegeLord



Re: Next Release

2011-04-22 Thread Jonathan M Davis
> > Well, then I'd better make sure that I get my most recent updates to
> > std.datetime in soon.
> > 
> > - Jonathan M Davis
> 
> Does your library take into account that there's no year 0?

Actually, for ISO 8601, which the library follows, there _is_ a year 0. Date, 
DateTime, and SysTime all have the function yearBC which will give you the 
year as you would normally expect (1 B.C. being immediately prior to 1 A.D. 
with no year 0). But the ISO standard calls for a year 0, and I followed the 
standard (it's also way easier to deal with programmatically). So, other than 
the yearBC function, it treats 0 as the year prior to 1 A.D., and the years 
prior to 0 are negative.

- Jonathan M Davis


Re: Web development howto?

2011-04-22 Thread Robert Clipsham

On 22/04/2011 03:53, Jaime Barciela wrote:

Hello everyone,

I'm going though TDPL and I just joined this list.

I've been looking for guidance on how to do web applications in D but
I haven't found anything.

My background is not C/C++ but Java (and Delphi many years ago) so I
have not only a new language but a new culture to get used to as well.

Could somebody give me some pointers?

Thanks
Jaime


The simplest way to make a web application with D is to use CGI/FastCGI 
etc. There are also at least two frameworks in development (that I know 
of), one is significantly more developed.


http://arsdnet.net/dcode/ - see web.d, cgi.d etc, this is the most 
mature (that I know of).


https://github.com/mrmonday/serenity - One I'm working on. It's due to 
undergo significant changes and is lacking a lot of basic functionality, 
so I'd avoid it, for now at least.


--
Robert
http://octarineparrot.com/


Re: Next Release

2011-04-22 Thread Joel Christensen


Well, then I'd better make sure that I get my most recent updates to
std.datetime in soon.

- Jonathan M Davis


Does your library take into account that there's no year 0?