Re: Using tango or other static lib in static lib

2016-03-14 Thread Zardoz via Digitalmars-d-learn
On Sunday, 13 March 2016 at 01:08:29 UTC, Mike Parker wrote: On Sunday, 13 March 2016 at 01:06:33 UTC, Mike Parker wrote: it. Assuming both files live in the same directory, they can be compiled with this command: Somehow I deleted that line: dmd main.d something.d Not would be more easy t

Re: Is D a good choice for embedding python/octave/julia

2016-03-14 Thread Ellery Newcomer via Digitalmars-d-learn
On 03/13/2016 02:36 PM, Laeeth Isharc wrote: InterpContext context = new InterpContext(); context.py_stmts(outdent(" import numpy a = numpy.eye(2, dtype='complex128') ")); context.a.to_d!(Complex!double[][] )(); nitpicking, but the outdent is unnecessary,

Re: Can DUB --combined builds be faster?

2016-03-14 Thread Chris Wright via Digitalmars-d-learn
On Tue, 15 Mar 2016 01:54:51 +, thedeemon wrote: > On Monday, 14 March 2016 at 11:50:38 UTC, Rene Zwanenburg wrote: > >> When building in release mode the call to foo() gets inlined just fine >> without --combined. > > How does it work? Is it because the source of foo() is visible to the > c

Re: Can DUB --combined builds be faster?

2016-03-14 Thread thedeemon via Digitalmars-d-learn
On Monday, 14 March 2016 at 11:50:38 UTC, Rene Zwanenburg wrote: When building in release mode the call to foo() gets inlined just fine without --combined. How does it work? Is it because the source of foo() is visible to the compiler when producing the result?

Re: Not sure how to translate this C++ variable to D.

2016-03-14 Thread Ali Çehreli via Digitalmars-d-learn
On 03/14/2016 03:14 PM, WhatMeWorry wrote: > > sprite_renderer.h -- > > class SpriteRenderer > { > ... > }; Same thing in D without the semicolon. :) > game.cpp > > #include "sprite_renderer.h" > > SpriteRenderer *Re

Re: Can DUB --combined builds be faster?

2016-03-14 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 14 March 2016 at 11:50:38 UTC, Rene Zwanenburg wrote: It shouldn't make a difference for the resulting executable, but compilation itself may be faster. I did a little test just to be sure. Two DUB packages, one with: module m; string foo() { return "asdf"; } And the other: impor

Not sure how to translate this C++ variable to D.

2016-03-14 Thread WhatMeWorry via Digitalmars-d-learn
sprite_renderer.h -- class SpriteRenderer { ... }; game.cpp #include "sprite_renderer.h" SpriteRenderer *Renderer; Game::Game(GLuint width, GLuint height) : State(GAME_ACTIVE), Keys(), Width(width), Heigh

Re: Sort using Uniform call syntax

2016-03-14 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, March 14, 2016 11:27:30 Ali Çehreli via Digitalmars-d-learn wrote: > On 03/14/2016 06:56 AM, Jonathan M Davis via Digitalmars-d-learn wrote: > > On Monday, March 14, 2016 04:14:26 Ali Çehreli via Digitalmars-d-learn wrote: > >> On 03/14/2016 04:01 AM, Jerry wrote: > >> > I have a smal

Re: Sort using Uniform call syntax

2016-03-14 Thread Ali Çehreli via Digitalmars-d-learn
On 03/14/2016 06:56 AM, Jonathan M Davis via Digitalmars-d-learn wrote: On Monday, March 14, 2016 04:14:26 Ali Çehreli via Digitalmars-d-learn wrote: On 03/14/2016 04:01 AM, Jerry wrote: > I have a small problem with using UCS when sorting arrays. This pops a > warning telling me to use the

Re: Gdmd compiling error

2016-03-14 Thread Ali Çehreli via Digitalmars-d-learn
On 03/14/2016 10:08 AM, Marc Schütz wrote: > What does `which gdc` print? If it says something like "which: no gdc in > ...", there is a problem with the installation of GDC. Otherwise, you > can use the following as a quick workaround: > > sudo ln -s `which gdc` /usr/local/bin/gdc > > The p

Re: Gdmd compiling error

2016-03-14 Thread Marc Schütz via Digitalmars-d-learn
On Monday, 14 March 2016 at 14:46:06 UTC, Orkhan wrote: On Monday, 14 March 2016 at 11:11:28 UTC, Ali Çehreli wrote: On 03/14/2016 02:56 AM, Orkhan wrote: > THe output like that : > root@ubuntu:/opt/xcomm# gdmd > Can't exec "/usr/local/bin/gdc": No such file or directory at Ok, now you need to

Re: Where do I learn to use GtkD

2016-03-14 Thread Gerald via Digitalmars-d-learn
On Monday, 14 March 2016 at 07:38:43 UTC, Russel Winder wrote: What we need here is a collection of people reviewing each others GtkD code and having a listing board somewhere on the GtkD site of all the codes available and what they show. It is the annotations as much as the code itself that i

Re: Gdmd compiling error

2016-03-14 Thread Orkhan via Digitalmars-d-learn
On Monday, 14 March 2016 at 11:11:28 UTC, Ali Çehreli wrote: On 03/14/2016 02:56 AM, Orkhan wrote: > THe output like that : > root@ubuntu:/opt/xcomm# gdmd > Can't exec "/usr/local/bin/gdc": No such file or directory at Ok, now you need to install gdc: http://gdcproject.org/downloads In shor

Re: std.stdio.File.seek error

2016-03-14 Thread Mike Parker via Digitalmars-d-learn
On Monday, 14 March 2016 at 14:19:27 UTC, stunaep wrote: I'm on my phone but I think It said something like Deprecation: module std.stdio not accessible from here. Try import static std.stdio Deprecation: module std.stdio is not accessible here, perhaps add 'static import std.stdio;' The

Re: std.stdio.File.seek error

2016-03-14 Thread Kagamin via Digitalmars-d-learn
On Monday, 14 March 2016 at 14:19:27 UTC, stunaep wrote: I'm on my phone but I think It said something like Deprecation: module std.stdio not accessible from here. Try import static std.stdio That's fix for bug https://issues.dlang.org/show_bug.cgi?id=313 See the code where std.stdio is not ac

Re: std.stdio.File.seek error

2016-03-14 Thread stunaep via Digitalmars-d-learn
On Monday, 14 March 2016 at 13:33:36 UTC, Mike Parker wrote: On Monday, 14 March 2016 at 09:57:19 UTC, stunaep wrote: It looks like _fseeki64 is in the nightly build but not dmd 2.070.2; However, the nightly build says std.stdio and std.conv are deprecated and I cant use them. I think you ma

Re: Sort using Uniform call syntax

2016-03-14 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, March 14, 2016 04:14:26 Ali Çehreli via Digitalmars-d-learn wrote: > On 03/14/2016 04:01 AM, Jerry wrote: > > I have a small problem with using UCS when sorting arrays. This pops a > > warning telling me to use the algorithm sort instead of the property > > sort. Which I understand wh

Re: Specialized template in different module

2016-03-14 Thread Mike Parker via Digitalmars-d-learn
On Monday, 14 March 2016 at 08:42:58 UTC, John wrote: If I define a template in one module, and specialize it in a second module, the compiler doesn't like it when I try to call a function using the template. If I put everything in the same module it works. So are template specializations lim

Re: std.stdio.File.seek error

2016-03-14 Thread Mike Parker via Digitalmars-d-learn
On Monday, 14 March 2016 at 09:57:19 UTC, stunaep wrote: It looks like _fseeki64 is in the nightly build but not dmd 2.070.2; However, the nightly build says std.stdio and std.conv are deprecated and I cant use them. I think you may be misinterpreting the error message. There was a change re

Re: Can DUB --combined builds be faster?

2016-03-14 Thread Rene Zwanenburg via Digitalmars-d-learn
On Monday, 14 March 2016 at 11:03:41 UTC, Guillaume Piolat wrote: I'm cargo-culting the use of --combined with DUB because I somehow think inlining will be better in this way. (For thos who don't use DUB, what it does is compiling the whole program with a single compiler invokation instead of m

Re: Using tango or other static lib in static lib

2016-03-14 Thread Voitech via Digitalmars-d-learn
On Sunday, 13 March 2016 at 01:08:29 UTC, Mike Parker wrote: On Sunday, 13 March 2016 at 01:06:33 UTC, Mike Parker wrote: it. Assuming both files live in the same directory, they can be compiled with this command: Somehow I deleted that line: dmd main.d something.d Wow. Thank You very much

Re: Sort using Uniform call syntax

2016-03-14 Thread Ali Çehreli via Digitalmars-d-learn
On 03/14/2016 04:01 AM, Jerry wrote: > I have a small problem with using UCS when sorting arrays. This pops a > warning telling me to use the algorithm sort instead of the property > sort. Which I understand why it works that way. However that means I can > not have syntactic sugar. So is there an

Re: Gdmd compiling error

2016-03-14 Thread Ali Çehreli via Digitalmars-d-learn
On 03/14/2016 02:56 AM, Orkhan wrote: > THe output like that : > root@ubuntu:/opt/xcomm# gdmd > Can't exec "/usr/local/bin/gdc": No such file or directory at Ok, now you need to install gdc: http://gdcproject.org/downloads In short, the project that you are trying to build depends on gdmd,

Can DUB --combined builds be faster?

2016-03-14 Thread Guillaume Piolat via Digitalmars-d-learn
I'm cargo-culting the use of --combined with DUB because I somehow think inlining will be better in this way. (For thos who don't use DUB, what it does is compiling the whole program with a single compiler invokation instead of making one static library by package.) But I've never measured mu

Sort using Uniform call syntax

2016-03-14 Thread Jerry via Digitalmars-d-learn
I have a small problem with using UCS when sorting arrays. This pops a warning telling me to use the algorithm sort instead of the property sort. Which I understand why it works that way. However that means I can not have syntactic sugar. So is there any way around this or do I just have to liv

Re: Specialized template in different module

2016-03-14 Thread ag0aep6g via Digitalmars-d-learn
On 14.03.2016 09:42, John wrote: module one; struct Test(T) {} void testing(T)(Test!T t) {} module two; struct Test(T : int) {} void main() { Test!int i; testing!int(i); } Output: error : testing (Test!int t) is not callable using argument types (Test!int)

Re: Gdmd compiling error

2016-03-14 Thread Ali Çehreli via Digitalmars-d-learn
On 03/14/2016 02:29 AM, Orkhan wrote: > root@ubuntu:/home/alikoza/Downloads/GDMD-master# sudo make install > rm -f /usr/local/bin/gdmd > install dmd-script /usr/local/bin/gdmd Good: gdmd seems to be installed. Please type 'gdmd' to confirm. Note: You may see errors like 'Can't exec "/usr/local/

Re: std.stdio.File.seek error

2016-03-14 Thread stunaep via Digitalmars-d-learn
On Monday, 14 March 2016 at 07:15:01 UTC, Nicholas Wilson wrote: On Monday, 14 March 2016 at 05:24:48 UTC, stunaep wrote: On Monday, 14 March 2016 at 03:07:05 UTC, Nicholas Wilson wrote: [...] I'm currently on windows 7. The code you gave me prints 022. It's weird because it always tries to

Re: Gdmd compiling error

2016-03-14 Thread Orkhan via Digitalmars-d-learn
On Monday, 14 March 2016 at 09:48:00 UTC, Ali Çehreli wrote: On 03/14/2016 02:29 AM, Orkhan wrote: > root@ubuntu:/home/alikoza/Downloads/GDMD-master# sudo make install > rm -f /usr/local/bin/gdmd > install dmd-script /usr/local/bin/gdmd Good: gdmd seems to be installed. Please type 'gdmd' to co

Re: Gdmd compiling error

2016-03-14 Thread Ali Çehreli via Digitalmars-d-learn
On 03/14/2016 02:15 AM, Orkhan wrote: >> I think you need to install gdmd: >> >> https://github.com/D-Programming-GDC/GDMD Yes I have seen that page. But I don't know how to make that . I think I need to upload all files then unzip then just type make ? could you please let me know. Thanks.

Re: Gdmd compiling error

2016-03-14 Thread Orkhan via Digitalmars-d-learn
On Monday, 14 March 2016 at 09:24:19 UTC, Ali Çehreli wrote: On 03/14/2016 02:15 AM, Orkhan wrote: >> I think you need to install gdmd: >> >> https://github.com/D-Programming-GDC/GDMD Yes I have seen that page. But I don't know how to make that . I think I need to upload all files then unz

Re: Gdmd compiling error

2016-03-14 Thread Orkhan via Digitalmars-d-learn
On Monday, 14 March 2016 at 09:06:30 UTC, Ali Çehreli wrote: On 03/14/2016 02:01 AM, Orkhan wrote: > I changed all gdmd to dmd and still not getting result . the outputs > after changing dmd is : > > Error: unrecognized switch '-q,-rdynamic' Sorry to have misled you. Apparently, those are gcc

Re: Gdmd compiling error

2016-03-14 Thread Ali Çehreli via Digitalmars-d-learn
On 03/14/2016 02:01 AM, Orkhan wrote: > I changed all gdmd to dmd and still not getting result . the outputs > after changing dmd is : > > Error: unrecognized switch '-q,-rdynamic' Sorry to have misled you. Apparently, those are gcc compiler switches that are not supported by dmd. > On Monda

Re: Gdmd compiling error

2016-03-14 Thread Orkhan via Digitalmars-d-learn
On Monday, 14 March 2016 at 07:52:18 UTC, Ali Çehreli wrote: On 03/13/2016 06:07 AM, Orkhan wrote: > It is in linux system , and when I type make command it returns error like: > /bin/sh: 1: gdmd: not found I think you need to install gdmd: https://github.com/D-Programming-GDC/GDMD Alternat

Specialized template in different module

2016-03-14 Thread John via Digitalmars-d-learn
If I define a template in one module, and specialize it in a second module, the compiler doesn't like it when I try to call a function using the template. module one; struct Test(T) {} void testing(T)(Test!T t) {} module two; struct Test(T : int) {} void main() { Test!int i

Re: Programming in D vs The D Programming Language

2016-03-14 Thread Saša Janiška via Digitalmars-d-learn
Ali Çehreli writes: > I agree and I doubt that I will ever see PinD on a local bookshop > shelf. What I meant was, IngramSpark makes it *possible* at all for a > local bookshop to order the book for you and that you can return it > for a full refund. Now I'm living in much smaller place and will

Re: Gdmd compiling error

2016-03-14 Thread Ali Çehreli via Digitalmars-d-learn
On 03/13/2016 06:07 AM, Orkhan wrote: > It is in linux system , and when I type make command it returns error like: > /bin/sh: 1: gdmd: not found I think you need to install gdmd: https://github.com/D-Programming-GDC/GDMD Alternatively, assuming that you have dmd installed, you can try re

Re: Where do I learn to use GtkD

2016-03-14 Thread Russel Winder via Digitalmars-d-learn
On Sun, 2016-03-13 at 19:28 +, karabuta via Digitalmars-d-learn wrote: > Gtk3 from python3 has got I nice book with examples that are not  > so advanced but enough to get you doing real work(from a beginner  > point of view). GtkD seem to have changed the API structure  > compared to python3 Gt

Re: std.stdio.File.seek error

2016-03-14 Thread Nicholas Wilson via Digitalmars-d-learn
On Monday, 14 March 2016 at 05:24:48 UTC, stunaep wrote: On Monday, 14 March 2016 at 03:07:05 UTC, Nicholas Wilson wrote: [...] I'm currently on windows 7. The code you gave me prints 022. It's weird because it always tries to convert longs to ints and I think that is weird because the funct