Re: Mixins output handling

2009-10-31 Thread Chris Nicholson-Sauls

Zarathustra wrote:

Is there a some compiler switch to produce mixins output.

I mean [d_file_with_mixins] - [d_file_without_mixins].


Depending on your needs, you can use pragma(msg,...) to output compile time strings. 
Useful for quickly double-checking simple code generators.


-- Chris Nicholson-Sauls


Modules/packages and cryptic errors

2009-10-31 Thread al
I have main.d with:

import foo.bar

and when I run:

dmd foo/*.d main.d

I get:

module bar is in multiple defined

This is pretty strange. The only way I can silence this error is to add module 
dirname.filename to *every* file.

Surely there must be less annoying method?



Re: Modules/packages and cryptic errors

2009-10-31 Thread Frank Benoit
al schrieb:
 module bar is in multiple defined

This often indicates a modules file name and the identifier in the
module statement are unequal (case sensitivity)


Re: Modules/packages and cryptic errors

2009-10-31 Thread al
Frank Benoit Wrote:

 al schrieb:
  module bar is in multiple defined
 
 This often indicates a modules file name and the identifier in the
 module statement are unequal (case sensitivity)

I have all files and imports lowercase. I have class names following filenames 
capitalized, but that shouldn't matter, should it?


When I run:

dmd foo/bar.d

is that assuming module foo.bar or bar? If that's the latter, it might explain 
why I'm getting an error (import finds this file under foo.bar), but how should 
I compile files then?




Re: Modules/packages and cryptic errors

2009-10-31 Thread Frank Benoit
al schrieb:
 Frank Benoit Wrote:
 
 al schrieb:
 module bar is in multiple defined
 This often indicates a modules file name and the identifier in the
 module statement are unequal (case sensitivity)
 
 I have all files and imports lowercase. I have class names following 
 filenames capitalized, but that shouldn't matter, should it?
 
 
 When I run:
 
 dmd foo/bar.d
 
 is that assuming module foo.bar or bar? If that's the latter, it might 
 explain why I'm getting an error (import finds this file under foo.bar), but 
 how should I compile files then?
 
 

if 'foo' shall be package, in bar.d there should be module foo.bar;.
If imported from somewhere else, it should be import foo.bar;.

Class/Type names should not matter.


How to run unittests?

2009-10-31 Thread al
I have main.d:

void main()
{
}

unittest{
assert(0);
}


I run:

dmd  -unittest main.d  ./main 

and nothing happens. 

What do I need to do to run the tests? (or get results printed?)

dmd v1.050 on OS X.



tuples

2009-10-31 Thread Ellery Newcomer
Is there currently any way to get something like

Tuple!(int,i) t = tuple(5);

to work?


Re: How to run unittests?

2009-10-31 Thread grauzone

al wrote:

It seems that unittests are not run (I've tried putting while(1){} and writef() 
there - no effect).

Even this code doesn't run assert():

import std.stdio;

int main(string[] args)
{
assert(args.length == -1);
writef(shouldn't work!);
return 0;
}


I'm using:

dmd -debug -w -unittest -run main.d

Is there a secred debug switch, or is it simply a bug? Which version of DMD is 
usable? (I've got v1.050)



I think it's a bug. Works for me under Linux. I guess the OSX versions 
of dmd are simply not in a useable state yet.