Re: I can ask questions about dmd on windows here in this forum?

2014-08-31 Thread Ali Çehreli via Digitalmars-d-learn
On 08/30/2014 10:37 PM, Cassio Butrico wrote: I was having trouble setting on my terminal in windows, I'm still trying to solve. In addition to what Vladimir Panteleev said, you should also select a Unicode font for your terminal like Lucida Console. Basically: 1) Set the code page to

Re: I can ask questions about dmd on windows here in this forum?

2014-08-31 Thread Cassio Butrico via Digitalmars-d-learn
On Sunday, 31 August 2014 at 06:08:46 UTC, Ali Çehreli wrote: On 08/30/2014 10:37 PM, Cassio Butrico wrote: I was having trouble setting on my terminal in windows, I'm still trying to solve. In addition to what Vladimir Panteleev said, you should also select a Unicode font for your

Re: I can ask questions about dmd on windows here in this forum?

2014-08-31 Thread bearophile via Digitalmars-d-learn
Ali Çehreli: Unless there is a specific reason not to, use 'string'. When you really need random access to characters, then use 'dstring'. So are the use cases for wstring limited? Bye, bearophile

Re: I can ask questions about dmd on windows here in this forum?

2014-08-31 Thread Ali Çehreli via Digitalmars-d-learn
On 08/31/2014 12:37 AM, bearophile wrote: Ali Çehreli: Unless there is a specific reason not to, use 'string'. When you really need random access to characters, then use 'dstring'. So are the use cases for wstring limited? Bye, bearophile Yes, without real experience, I am under that

Re: I can ask questions about dmd on windows here in this forum?

2014-08-31 Thread Jonathan M Davis via Digitalmars-d-learn
On Sun, 31 Aug 2014 01:11:02 -0700 Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On 08/31/2014 12:37 AM, bearophile wrote: Ali Çehreli: Unless there is a specific reason not to, use 'string'. When you really need random access to characters, then use

Re: D daemon GC?

2014-08-31 Thread JD via Digitalmars-d-learn
Last snippet works for me, dots get printed to the logfile as expected. Ok, it works now. Using the recommended _Exit() function with DMD 2.066 on Linux. Thanks you all for your help! Best regards, Jeroen

Re: D1: Error: duplicate union initialization for size

2014-08-31 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-08-31 04:53, Ali Çehreli wrote: On 08/30/2014 06:05 PM, jicman wrote: Really is or how one can fix it? This is the only time that I have found myself without answers with D. Strange. Maybe folks are not that into D1, but D1 was before D2. Any thoughts would be greatly

A significant performance difference

2014-08-31 Thread bearophile via Digitalmars-d-learn
This is C++ code that solves one Euler problem: -- #include stdio.h #include map const unsigned int H = 9, W = 12; const int g[6][3] = {{7, 0, H - 3}, {1 + (1 H) + (1 (2 * H)), 0, H - 1}, {3 + (1 H), 0, H - 2}, {3 +

Re: How to build dlang.org dd files

2014-08-31 Thread Mike via Digitalmars-d-learn
On Sunday, 31 August 2014 at 05:41:58 UTC, Mike wrote: I've been trying to update some documentation on dlang.org. The instructions at https://github.com/D-Programming-Language/dlang.org/blob/master/CONTRIBUTING.md say I should be able to do make -f posix.make file.html This doesn't seem

alias and mixin

2014-08-31 Thread evilrat via Digitalmars-d-learn
what the problem with this? alias myint = mixin(int); // - basic type expected blah blah blah... mixin alias unusable now, it blocks various cool templates and really frustrating(such things make D feels like some cheap limited language), is there any way to tell compiler explicitly use

Re: alias and mixin

2014-08-31 Thread ketmar via Digitalmars-d-learn
On Sun, 31 Aug 2014 11:26:47 + evilrat via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: alias myint = mixin(int); // - basic type expected blah blah mixin(alias myint = ~int~;); ? signature.asc Description: PGP signature

Re: alias and mixin

2014-08-31 Thread evilrat via Digitalmars-d-learn
On Sunday, 31 August 2014 at 11:43:03 UTC, ketmar via Digitalmars-d-learn wrote: On Sun, 31 Aug 2014 11:26:47 + evilrat via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: alias myint = mixin(int); // - basic type expected blah blah mixin(alias myint = ~int~;); ? wow,

Re: How to build dlang.org dd files

2014-08-31 Thread Philippe Sigaud via Digitalmars-d-learn
dmd -c -o- macros.ddoc doc.ddoc -Df{ddoc_filename}.html {ddoc_filename}.dd If someone knows of a more official syntax, please let me know. I don't know of another syntax, but could you please put this somewhere on the wiki? Maybe in the cookbook section: http://wiki.dlang.org/Cookbook

Re: D daemon GC?

2014-08-31 Thread Gary Willoughby via Digitalmars-d-learn
On Sunday, 31 August 2014 at 09:02:55 UTC, JD wrote: Last snippet works for me, dots get printed to the logfile as expected. Ok, it works now. Using the recommended _Exit() function with DMD 2.066 on Linux. Thanks you all for your help! Best regards, Jeroen On a side note, i've created

Tango Problems..

2014-08-31 Thread seany via Digitalmars-d-learn
I have several files, which I am trying to import as modules to a central file. However, whyile trying to complie with dmd -L-ltango-dmd list of files space separated However, I am getting this error : /usr/lib/libtango-dmd.a(tango-io-Stdout-release.o): In function

Re: alias and mixin

2014-08-31 Thread Dicebot via Digitalmars-d-learn
On Sunday, 31 August 2014 at 12:01:43 UTC, evilrat wrote: On Sunday, 31 August 2014 at 11:43:03 UTC, ketmar via Digitalmars-d-learn wrote: On Sun, 31 Aug 2014 11:26:47 + evilrat via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: alias myint = mixin(int); // - basic type

Re: alias and mixin

2014-08-31 Thread Philippe Sigaud via Digitalmars-d-learn
It is basically just an annoying grammar limitation that does not allow to use mixin / __traits as an identifier. The usual helper template: ``` alias helper(alias a) = a; ``` helps for aliasing __traits and anonymous function templates (x = x+1), but I don't see an easy solution for

Re: Tango Problems..

2014-08-31 Thread seany via Digitalmars-d-learn
Oh, I am using netrunner linux with arch/manjaro core.

Re: alias and mixin

2014-08-31 Thread Dicebot via Digitalmars-d-learn
On Sunday, 31 August 2014 at 14:46:00 UTC, Philippe Sigaud via Digitalmars-d-learn wrote: It is basically just an annoying grammar limitation that does not allow to use mixin / __traits as an identifier. The usual helper template: ``` alias helper(alias a) = a; ``` helps for aliasing

Re: Tango Problems..

2014-08-31 Thread Rémy Mouëza via Digitalmars-d-learn
From what I understand in the error message, the linker cannot find a druntime function: void core.stdc.stdarg.va_end(void*). I would advise to check that the druntime lib is in the import path. In your the dmd repository, you should have a dmd.conf file containing something like:

Re: Tango Problems..

2014-08-31 Thread seany via Digitalmars-d-learn
On Sunday, 31 August 2014 at 15:40:04 UTC, Rémy Mouëza wrote: From what I understand in the error message, the linker cannot find a druntime function: void core.stdc.stdarg.va_end(void*). I would advise to check that the druntime lib is in the import path. In your the dmd repository, you

Re: Tango Problems..

2014-08-31 Thread seany via Digitalmars-d-learn
I am linking against tango ldc -I/path/to/tango -L-L/path/to/tango -L-ltango-dmd \

Re: alias and mixin

2014-08-31 Thread Philippe Sigaud via Digitalmars-d-learn
I recommend slightly more generic form: template Alias(T...) if (T.length == 1) { alias Alias = T[0]; } it is quite helpful in templated code to be able to alias _anything_ That's what I use also, but didn't want another thread on the (T...) if (T.length ==1) trick :) But

Re: D daemon GC?

2014-08-31 Thread Raphaël Jakse via Digitalmars-d-learn
On 30/08/2014 19:09, JD wrote: My questions: 1. Are there any special considerations w.r.t. the GC after using fork()? Or must it be disabled? 2. Is it allowed to use stdlib's exit() without cleaning up after the runtime (as a normal end of program probably does)? Or is there a safe D exit()?

Re: Programming a Game in D? :D

2014-08-31 Thread David via Digitalmars-d-learn
Hi, About 2 month ago I started learning modding for minecraft with the Forge API I was reading through a lot of classes of minecraft and even no it might not seem like, I learned a freking lot about how games work and stuff and improved my programming skill a lot (Yes for Java but also

Re: Tango Problems..

2014-08-31 Thread Rémy Mouëza via Digitalmars-d-learn
I have checked my ldc installation: the druntime library is located in ldc2-0.12.0-linux-x86/x86/libdruntime-ldc.a You should also add a some extra flags like: -L-L/path/to/ldc/lib/architecture -L-Ldruntime-ldc . On 08/31/2014 05:52 PM, seany wrote: I am linking against tango ldc

Re: Tango Problems..

2014-08-31 Thread seany via Digitalmars-d-learn
On Sunday, 31 August 2014 at 20:40:06 UTC, Rémy Mouëza wrote: -L-L/path/to/ldc/lib/architecture -L-Ldruntime-ldc . there is no /path/to/ldc/lib in my system - i have an /etc/ldc.conf and a /usr/bin/ldc2

Re: Tango Problems..

2014-08-31 Thread Rémy Mouëza via Digitalmars-d-learn
Have you tried something like this: find /lib /usr/lib* /usr/local/lib* -name \*.a | grep -i druntime or a simple: locate druntime ? On 08/31/2014 10:50 PM, seany wrote: On Sunday, 31 August 2014 at 20:40:06 UTC, Rémy Mouëza wrote: -L-L/path/to/ldc/lib/architecture -L-Ldruntime-ldc .

Re: Tango Problems..

2014-08-31 Thread Rémy Mouëza via Digitalmars-d-learn
In case you don't find any druntime library, try to see if the missing symbol is in the libphobos2.a file (you'll first have to identify the directory where phobos is located): $ nm libphobos2.a | ddemangle | grep stdc | grep va_end T nothrow void

Re: Tango Problems..

2014-08-31 Thread seany via Digitalmars-d-learn
About find command : I use find / -iname *druntime*.a with root permission - how else will i find what is where, kfind probably uses find internally too, or boost, egal ... for the nm command : without ddemangle, i dont have the command installed : T

Re: Tango Problems..

2014-08-31 Thread seany via Digitalmars-d-learn
On Sunday, 31 August 2014 at 21:40:51 UTC, seany wrote: On the other hand, phobos works. But I want some tango functionality, without having to hack it all by hand ...

Re: Tango Problems..

2014-08-31 Thread Rémy Mouëza via Digitalmars-d-learn
I suggest to try linking with both phobos and tango. Only the druntime functions contained in phobos should be used by the linker (if I am correct). Otherwise, did you take a look at code.dlang.org? Depending on your needs, there might be a dub package you could use to fill in for the

How to compare two types?

2014-08-31 Thread MarisaLovesUsAll via Digitalmars-d-learn
How to compare two types? Will I use T.stringof instead of this? void main() { if(One is Two) {} //Error: type One is not an expression //Error: type Two is not an expression } class One {} class Two {} Regards, MarisaLovesUsAll

Re: How to compare two types?

2014-08-31 Thread Adam D. Ruppe via Digitalmars-d-learn
There's two ways: static if(is(One == Two)) { } That compares the static types in a form of conditional compilation. http://dlang.org/expression.html#IsExpression If you want to compare the runtime type of a class object, you can do: if(typeid(obj_one) == typeid(obj_two)) that should

Re: How to compare two types?

2014-08-31 Thread bearophile via Digitalmars-d-learn
Adam D. Ruppe: If you want to compare the runtime type of a class object, you can do: if(typeid(obj_one) == typeid(obj_two)) that should tell you if they are the same dynamic class type. And what about: if (is(typeof(obj_one) == typeof(obj_two))) Bye, bearophile

Re: How to compare two types?

2014-08-31 Thread Adam D. Ruppe via Digitalmars-d-learn
typeof() always gets the static type, typeid() is needed if you want the dynamic type.

Re: How to compare two types?

2014-08-31 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 31 August 2014 at 23:53:31 UTC, bearophile wrote: if (is(typeof(obj_one) == typeof(obj_two))) You could, but since it is static info you might as well use static if.

Possible difference in compilers?

2014-08-31 Thread Charles via Digitalmars-d-learn
Hi everyone So I've been working on the problems over at HackerRank.com trying to gain some familiarity with D. I use a Windows computer with VisualD, but the server used to test the program uses Ubuntu (I can't tell which compiler they're actually using). The problem I'm stuck on now is the

Re: Possible difference in compilers?

2014-08-31 Thread Charles via Digitalmars-d-learn
For the test cases this only produces the first output (correctly), but then hits a compiler error with format.d before the next one. Any ideas what might be going on? Figured it out. The issue was the \n character at the end of the readf statements.

const-correctness in std.range

2014-08-31 Thread Vlad Levenfeld via Digitalmars-d-learn
I notice that some of the range adapters in std.range (iota, takeExactly) have a const empty property, while others (take, retro) don't. This makes maintaining const-correctness downstream (with my own range adapters atop phobos') more difficult. I'm wondering if there is a rationale for this,

Re: const-correctness in std.range

2014-08-31 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, 1 September 2014 at 03:45:25 UTC, Vlad Levenfeld wrote: I notice that some of the range adapters in std.range (iota, takeExactly) have a const empty property, while others (take, retro) don't. This makes maintaining const-correctness downstream (with my own range adapters atop

Re: Programming a Game in D? :D

2014-08-31 Thread evilrat via Digitalmars-d-learn
On Sunday, 31 August 2014 at 19:06:41 UTC, David wrote: So first of all, I'm not sure if D is really the best choice for me. Since its just pretty hard for begginers like me without any tutorials and anything to come up with a game. Then what language should it be? It should have a big