Re: coding standard for D progrimming language

2013-03-13 Thread Jonathan M Davis
On Thursday, March 14, 2013 04:55:14 AngryLemming wrote: > On Thursday, 14 March 2013 at 03:43:03 UTC, bearophile wrote: > > http://dlang.org/dstyle.html > > > > Bye, > > bearophile > > I read this, but this document is very small and without some > important question's. For example: > > interfa

Re: coding standard for D progrimming language

2013-03-13 Thread AngryLemming
On Thursday, 14 March 2013 at 03:43:03 UTC, bearophile wrote: http://dlang.org/dstyle.html Bye, bearophile I read this, but this document is very small and without some important question's. For example: interface ISome ... or interface Some ... ... int foo() {or int foo() ...

Re: Overhead when using a C library

2013-03-13 Thread Timon Gehr
On 03/14/2013 01:48 AM, Jeremy DeHaan wrote: Hey guys! I am working on a binding for D, and am almost finished! I started to think of some things I might like to work on to improve the binding after I get everything working, and one of the things I thought of was rewriting certain parts to use o

Overhead when using a C library

2013-03-13 Thread Jeremy DeHaan
Hey guys! I am working on a binding for D, and am almost finished! I started to think of some things I might like to work on to improve the binding after I get everything working, and one of the things I thought of was rewriting certain parts to use only D code instead of making calls to the

Re: Any python-like generator patterns in D?

2013-03-13 Thread Ali Çehreli
Ha ha! Just saw this. :) On 02/21/2013 07:41 AM, jerro wrote: >> P.S. I am in the process of translating my Turkish D book to English. For >> completeness, here are the two chapters about ranges: >> >> http://ddili.org/ders/d/araliklar.html >> >> http://ddili.org/ders/d/araliklar_baska.html > >

Re: Variadic function not recognizing static array length

2013-03-13 Thread Timon Gehr
On 03/12/2013 10:47 PM, Zach the Mystic wrote: void func(string[2] a) {} void func2(T...)(T args) { static assert(is(typeof(args[0]) == string[2])); } void func3(T...)(T args) { static assert(args[0].length == 2); } func(["",""]); // Okay func2(["",""]); // Error: (is(string[] == stri

Re: UTF escape

2013-03-13 Thread Adam D. Ruppe
And there's actually some named entities like writeln("\© 2014"); works in D.

Re: UTF escape

2013-03-13 Thread Brad Anderson
On Wednesday, 13 March 2013 at 21:59:54 UTC, Stephen Jones wrote: Html has &#xxx to access fonts at xxx, does D have something similar? writeln("a"); to writeln(a); Thanks. What Andrej said or you can use the unicode escapes (they are in hexadecimal): writeln("\u0061");

Re: UTF escape

2013-03-13 Thread Andrej Mitrovic
On Wednesday, 13 March 2013 at 21:59:54 UTC, Stephen Jones wrote: Html has &#xxx to access fonts at xxx, does D have something similar? writeln("a"); to writeln(a); Thanks. No but you can easily create this on your own: import std.string; import std.stdio; string[dchar] transTable; share

UTF escape

2013-03-13 Thread Stephen Jones
Html has &#xxx to access fonts at xxx, does D have something similar? writeln("a"); to writeln(a); Thanks.

Re: Lexer in D

2013-03-13 Thread Namespace
Array has an horrible code... I decided to start from scratch. So I took a close look at the lexer of dmd and took over the basic functionality. Result for std.datetime (without profiling so far): Total time (ms): 5971.66 Repetitions: 200 Sample mode: 28 (101 o

Re: Variadic function not recognizing static array length

2013-03-13 Thread Zach the Mystic
On Tuesday, 12 March 2013 at 23:35:28 UTC, Ali Çehreli wrote: On 03/12/2013 04:10 PM, Zach the Mystic wrote: > On Tuesday, 12 March 2013 at 21:47:02 UTC, Zach the Mystic wrote: >> void func(string[2] a) {} >> >> void func2(T...)(T args) { >> static assert(is(typeof(args[0]) == string[2])); >> } >

Re: application icon

2013-03-13 Thread Andrej Mitrovic
On 3/13/13, Adam D. Ruppe wrote: > Then make a resource file: Also there's this resource guide: http://www.prowiki.org/wiki4d/wiki.cgi?D__Tutorial/WindowsResources It should be ported to the new wiki some time.

Re: What do you use to generate documentation?

2013-03-13 Thread H. S. Teoh
On Wed, Mar 13, 2013 at 08:47:03AM -0700, Jonathan M Davis wrote: > On Wednesday, March 13, 2013 11:59:52 Andrea Fontana wrote: > > On Wednesday, 13 March 2013 at 10:11:51 UTC, simendsjo wrote: > > > You can redefine the DDOC macro to use a stylesheet. Add your > > > base ddoc file on the command l

Re: Passing several tuples (T...) to templates without expanding them

2013-03-13 Thread simendsjo
On Wednesday, 13 March 2013 at 15:49:06 UTC, jerro wrote: and a template template t(alias A, alias B) { // something something } Given alias Tuple!(int, 1) A; alias Tuple!(int, 1) B; Is it possible to send this to template t as follows t!(A, B) without it expanding to t!(int, 1, int, 1) ?

Re: Passing several tuples (T...) to templates without expanding them

2013-03-13 Thread jerro
and a template template t(alias A, alias B) { // something something } Given alias Tuple!(int, 1) A; alias Tuple!(int, 1) B; Is it possible to send this to template t as follows t!(A, B) without it expanding to t!(int, 1, int, 1) ? Not as far as I know. You can work that around it b

Re: What do you use to generate documentation?

2013-03-13 Thread Jonathan M Davis
On Wednesday, March 13, 2013 11:59:52 Andrea Fontana wrote: > On Wednesday, 13 March 2013 at 10:11:51 UTC, simendsjo wrote: > > You can redefine the DDOC macro to use a stylesheet. Add your > > base ddoc file on the command line with redefined and > > additional macros. > > Is phobos doc based on

Re: GC, memory leaks and 32/64 bit

2013-03-13 Thread Benjamin Thaut
Am 13.03.2013 06:38, schrieb Rob T: On Tuesday, 12 March 2013 at 21:02:20 UTC, Benjamin Thaut wrote: This is not possible as different kinds of GCs need to generate different runtime data at compile time. The current GC for example does not need any runtime data (other then what the D typeinfo s

Re: application icon

2013-03-13 Thread Adam D. Ruppe
On Wednesday, 13 March 2013 at 12:59:57 UTC, Gimsom wrote: Hi, I would like to set an icon for my D2 application but I have no idea how to do that, could somone explain me? Thanks. Create the .ico file and put it in your project folder. Then make a resource file: whatever_name.rc with just

Re: Passing several tuples (T...) to templates without expanding them

2013-03-13 Thread monarch_dodra
On Wednesday, 13 March 2013 at 10:34:14 UTC, simendsjo wrote: Say you have a tuple type: struct Tuple(T...) { alias T Tuple; } and a template template t(alias A, alias B) { // something something } Given alias Tuple!(int, 1) A; alias Tuple!(int, 1) B; Is

Passing several tuples (T...) to templates without expanding them

2013-03-13 Thread simendsjo
Say you have a tuple type: struct Tuple(T...) { alias T Tuple; } and a template template t(alias A, alias B) { // something something } Given alias Tuple!(int, 1) A; alias Tuple!(int, 1) B; Is it possible to send this to template t as follows t!(A, B)

Re: Passing several tuples (T...) to templates without expanding them

2013-03-13 Thread simendsjo
On Wednesday, 13 March 2013 at 11:13:55 UTC, monarch_dodra wrote: On Wednesday, 13 March 2013 at 10:34:14 UTC, simendsjo wrote: Say you have a tuple type: struct Tuple(T...) { alias T Tuple; } and a template template t(alias A, alias B) { // something something } Give

application icon

2013-03-13 Thread Gimsom
Hi, I would like to set an icon for my D2 application but I have no idea how to do that, could somone explain me? Thanks.

Re: Passing several tuples (T...) to templates without expanding them

2013-03-13 Thread monarch_dodra
On Wednesday, 13 March 2013 at 11:26:24 UTC, simendsjo wrote: Ahem.. Seems TypeTuple is exactly like my Tuple, so I'll change my code to use TypeTuple. The question still stands though.. If it's not possible, as you say, I'll try to figure out a workaround.. Yeah, Tuple is a Tuple in the C++

Re: What do you use to generate documentation?

2013-03-13 Thread simendsjo
On Wednesday, 13 March 2013 at 09:35:18 UTC, Andrea Fontana wrote: I've tried to build documentation using ddoc format and dmd. dmd -c -D -o- ... Generated documentation looks ugly and without stylesheet. Am I wrong? I expected a phobos-like documentation. So, what do you use to generate you

Re: Passing several tuples (T...) to templates without expanding them

2013-03-13 Thread simendsjo
On Wednesday, 13 March 2013 at 11:21:53 UTC, simendsjo wrote: On Wednesday, 13 March 2013 at 11:13:55 UTC, monarch_dodra wrote: On Wednesday, 13 March 2013 at 10:34:14 UTC, simendsjo wrote: Say you have a tuple type: struct Tuple(T...) { alias T Tuple; } and a template template t(a

Re: What do you use to generate documentation?

2013-03-13 Thread Andrea Fontana
On Wednesday, 13 March 2013 at 10:11:51 UTC, simendsjo wrote: You can redefine the DDOC macro to use a stylesheet. Add your base ddoc file on the command line with redefined and additional macros. Is phobos doc based on some .ddoc file then? I see there's a number of .ddoc file in github d-pr

What do you use to generate documentation?

2013-03-13 Thread Andrea Fontana
I've tried to build documentation using ddoc format and dmd. dmd -c -D -o- ... Generated documentation looks ugly and without stylesheet. Am I wrong? I expected a phobos-like documentation. So, what do you use to generate your D docs? Doxygen or something else?

Re: GC, memory leaks and 32/64 bit

2013-03-13 Thread Rainer Schuetze
On 13.03.2013 08:03, Druzhinin Alexandr wrote: On 13.03.2013 13:35, Rainer Schuetze wrote: If the undefined symbols happen to be related to AssociativeArray, my current workaround is to add "alias Associative!(Key,Value) _workaround;" somewhere to force instantiation for the respective Key an

Re: GC, memory leaks and 32/64 bit

2013-03-13 Thread Druzhinin Alexandr
On 13.03.2013 13:35, Rainer Schuetze wrote: If the undefined symbols happen to be related to AssociativeArray, my current workaround is to add "alias Associative!(Key,Value) _workaround;" somewhere to force instantiation for the respective Key and Value types. The precise GC needs some type inf