Re: What is this strange alias syntax?

2011-05-23 Thread Andrej Mitrovic
Ah ok. Hey if it's used for something useful I won't steal it from you. ;)

Re: Some help on Mixin Template at Class level.

2011-05-23 Thread Matthew Ong
On 5/23/2011 2:17 AM, Simen Kjaeraas wrote: On Sat, 21 May 2011 11:40:22 +0200, Matthew Ong on...@yahoo.com wrote: Using your code I have this error: src\Sample.d(16): Error: undefined identifier btype, did you mean template AType(string name,U,alias V)? src\Sample.d(16): Error: mixin

Re: How to break module into multiple file.

2011-05-23 Thread Jonathan M Davis
On 2011-05-23 00:09, Matthew Ong wrote: On 5/21/2011 7:16 PM, Russel Winder wrote: On Sat, 2011-05-21 at 04:35 -0400, Nick Sabalausky wrote: [ . . . ] Subversion handles multiple people editing the same file perfectly fine. But Hg probably is better than SVN, overall. I've been a happy

Re: How to interface with existing Java Code at the API level.

2011-05-23 Thread Matthew Ong
On 5/21/2011 11:27 PM, Robert Clipsham wrote: On 21/05/2011 09:58, Jonathan M Davis wrote: On 2011-05-21 01:04, Matthew Ong wrote: Hi, D has major potential to replace C/C++ at the system API level. What I can see D is doing now is trying to glue to the existing C API instead of replacing

Re: Some help on Mixin Template at Class level.

2011-05-23 Thread Andrej Mitrovic
On 5/23/11, Matthew Ong on...@yahoo.com wrote: Someone also pointed out: template mydef(string name){ } mixin(mydef!(abc)); The above are NOT shown up left hand side of that when we click on Language Reference You're probably looking for this: http://www.digitalmars.com/d/2.0/mixin.html

Not true for Java about Function Hijacking.

2011-05-23 Thread Matthew Ong
Hi Digitalmars/Walter Bright, http://www.digitalmars.com/d/2.0/hijack.html This talk covers function hijacking, where adding innocent and reasonable declarations in a module can wreak arbitrary havoc on an application program in C++(maybe true) and Java(not true). Since I have not done C++

Extra Cool D NEWbie ( from java)

2011-05-23 Thread Matthew Ong
Hi ALL Java D Newbie, http://www.dsource.org/projects/dwt Do a Mercurial Hg Clone of: hg clone http://hg.dsource.org/projects/dwt2 Once done. dwt2 will be the top level directory of that clone. Look inside: dwt2\base\src\java There are many buildin java like classes written nicely in D

Re: How to break module into multiple file.

2011-05-23 Thread Matthew Ong
On 5/23/2011 3:58 PM, Timon Gehr wrote: On 2011-05-23 00:09, Matthew Ong wrote: Thanks everyone that gave some working model to a newbie from Java Space. I found the working file layout model from dwt2 http://hg.dsource.org/projects/dwt2 There is a dwt2\base\src Haha. That is exactly like

Re: What is this strange alias syntax?

2011-05-23 Thread Steven Schveighoffer
On Sun, 22 May 2011 11:20:15 -0400, Timon Gehr timon.g...@gmx.ch wrote: Andrej Mitrovic wrote: Should I file a bug report to kill this syntax? No. It is perfectly valid, see grammar: http://www.digitalmars.com/d/2.0/declaration.html What is strange about this syntax in particular? int i;

Re: Extra Cool D NEWbie ( from java)

2011-05-23 Thread Jacob Carlborg
On 2011-05-23 11:32, Matthew Ong wrote: Hi ALL Java D Newbie, http://www.dsource.org/projects/dwt Do a Mercurial Hg Clone of: hg clone http://hg.dsource.org/projects/dwt2 Once done. dwt2 will be the top level directory of that clone. Look inside: dwt2\base\src\java There are many buildin

Re: What is this strange alias syntax?

2011-05-23 Thread Timon Gehr
Steven Schveighoffer wrote: It is not perfectly consistent. The function type syntax is useless, because you can only use it if you use the pointer modifier with it. If you want to declare a function pointer, there are other (better) ways. Yes, other ways of declaring a function pointer are

Re: What is this strange alias syntax?

2011-05-23 Thread Andrej Mitrovic
On 5/23/11, Timon Gehr timon.g...@gmx.ch wrote: BTW: writeln(typeid(int function(int))); //int()* wtf? Yeah, typeid generally seems to be bad for these things. typeof.stringof to the rescue: writeln((int function(int)).stringof); // int function(int)

Re: What is this strange alias syntax?

2011-05-23 Thread Andrej Mitrovic
Well if there's no better way to do it and it's useful, we should do a feature request for a better syntax, no?

Re: What is this strange alias syntax?

2011-05-23 Thread Steven Schveighoffer
On Mon, 23 May 2011 09:32:47 -0400, Timon Gehr timon.g...@gmx.ch wrote: Steven Schveighoffer wrote: it's akin to making: if(x); invalid. Yes, it's valid syntax, but it's almost certainly not what the user wanted. It's special cased for failure, to aid the developer in writing less buggy

Re: What is this strange alias syntax?

2011-05-23 Thread Steven Schveighoffer
On Mon, 23 May 2011 09:59:01 -0400, Steven Schveighoffer schvei...@yahoo.com wrote: On Mon, 23 May 2011 09:32:47 -0400, Timon Gehr timon.g...@gmx.ch wrote: Steven Schveighoffer wrote: it's akin to making: if(x); invalid. Yes, it's valid syntax, but it's almost certainly not what the user

Re: How to break module into multiple file.

2011-05-23 Thread Andrew Wiley
On Mon, May 23, 2011 at 4:39 AM, Matthew Ong on...@yahoo.com wrote: On 5/23/2011 3:58 PM, Timon Gehr wrote: On 2011-05-23 00:09, Matthew Ong wrote: Thanks everyone that gave some working model to a newbie from Java Space. I found the working file layout model from dwt2

Re: What is this strange alias syntax?

2011-05-23 Thread Steven Schveighoffer
On Mon, 23 May 2011 10:50:11 -0400, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: Since main can't be a template value argument, maybe he meant this use case: alias int func(); void foo(alias T)() { static assert(is(typeof(T) == int function())); // fixed } int main() {

Re: What is this strange alias syntax?

2011-05-23 Thread Andrej Mitrovic
Nice.

Re: How To Dynamic Web Rendering?

2011-05-23 Thread Nathan
This looks really interesting -- this will be obvious from my question -- I am a hobbyist programmer interested in D (with most experience in Python). I can get the first cgi example (not the mixin) to compile and run on an Apache cgi server. I cannot get the second, cgi/mixin sample to compile.

Re: How To Dynamic Web Rendering?

2011-05-23 Thread Adam D. Ruppe
Nathan wrote: I cannot get the second, cgi/mixin sample to compile. What is the appropriate dmd command line? First, download my cgi module http://arsdnet.net/dcode/cgi.d Then, in the same directory write this file, hello.d: === import arsd.cgi; void whatever(Cgi cgi) {

Re: How To Dynamic Web Rendering?

2011-05-23 Thread Adam D. Ruppe
Also: other two errors say that modulename.run cannot be called with argument type Cgi and that 0 arguments are expected for function type void When using the generic main mixin, the function you pass must always take one argument: a Cgi object. void yourFunctionHere(Cgi cgi) { } When the

Re: What is this strange alias syntax?

2011-05-23 Thread Timon Gehr
Steven Schveighoffer wrote: On Mon, 23 May 2011 10:50:11 -0400, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: Since main can't be a template value argument, maybe he meant this use case: alias int func(); void foo(alias T)() { static assert(is(typeof(T) == int function())); //

Re: What is this strange alias syntax?

2011-05-23 Thread Steven Schveighoffer
On Mon, 23 May 2011 14:06:31 -0400, Timon Gehr timon.g...@gmx.ch wrote: Steven Schveighoffer wrote: On Mon, 23 May 2011 10:50:11 -0400, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: Since main can't be a template value argument, maybe he meant this use case: alias int func(); void

github: What to do when unittests fail?

2011-05-23 Thread Andrej Mitrovic
I've cloned Phobos just a few minutes ago, and I've tried to build it with unittests, I'm getting these: Warning: AutoImplement!(C_6) ignored variadic arguments to the constructor C_6(...) --- std.socket(316) broken test --- --- std.regex(3671) broken test --- So what's the procedure now? Do

Re: github: What to do when unittests fail?

2011-05-23 Thread Andrej Mitrovic
Also, David, your multithreaded unittest is gonna fry my CPU! It's getting hot these days.. :)

Re: What is this strange alias syntax?

2011-05-23 Thread Stewart Gordon
On 22/05/2011 21:51, Timon Gehr wrote: snip I suspect what Andrej actually meant is to kill treating function signatures as types in this way. And possibly enhancement request rather than bug. It is the opposite of an enhancement request. It means removing a feature that cannot be