Re: Question about compile-time functions.

2016-12-14 Thread Nicholas Wilson via Digitalmars-d-learn
On Wednesday, 14 December 2016 at 07:15:08 UTC, Bauss wrote: If a function is only called during compile-time will it be available at runtime? It depends. When linking unused functions can be removed by -gc-sections, but only when linking an executable. But obviously if you use it at

Re: Issue with dmd, linker, visualD on windows 10

2016-12-14 Thread rikki cattermole via Digitalmars-d-learn
On 15/12/2016 12:06 AM, aberba wrote: I am trying to get a fellow to try D but just setting up on windows 10 has been headache. He's currently remote. Here's the problem. (Note I'm a Linux user and haven't used windows 10) 1. He installed dmd 2 but the command "dmd" is not recognized. He

rtInfo()

2016-12-14 Thread Satoshi via Digitalmars-d-learn
Hello, is rtInfo() already used by GC? I need to store some data for each class so I'm using this template and m_rtInfo in TypeInfo_Class but now it seems that GC is not working properly in some cases. Thanks.

Re: Question about compile-time functions.

2016-12-14 Thread Johan Engelen via Digitalmars-d-learn
On Wednesday, 14 December 2016 at 07:15:08 UTC, Bauss wrote: If a function is only called during compile-time will it be available at runtime? With "available at runtime", I guess you mean "will it be part of the object file". In that case: yes. Because even if a function is _never_ called,

Issue with dmd, linker, visualD on windows 10

2016-12-14 Thread aberba via Digitalmars-d-learn
I am trying to get a fellow to try D but just setting up on windows 10 has been headache. He's currently remote. Here's the problem. (Note I'm a Linux user and haven't used windows 10) 1. He installed dmd 2 but the command "dmd" is not recognized. He confirmed and c:\D\dmd2\windows\bin is in

Re: rtInfo()

2016-12-14 Thread rikki cattermole via Digitalmars-d-learn
On 14/12/2016 11:52 PM, Satoshi wrote: Hello, is rtInfo() already used by GC? I need to store some data for each class so I'm using this template and m_rtInfo in TypeInfo_Class but now it seems that GC is not working properly in some cases. Thanks. Doesn't look like it.

Re: Accessing members through pointers to structs (also, CTFE associative arrays)

2016-12-14 Thread Ali via Digitalmars-d-learn
On Tuesday, 13 December 2016 at 23:29:31 UTC, Ali Çehreli wrote: On 12/13/2016 01:36 PM, Ali wrote: Now about that second part of my problem I'm not entirely sure whether this should work but I think the problem is with mutating the 'frequencies' member of an immutable element of

Re: Alias variable from another class

2016-12-14 Thread ketmar via Digitalmars-d-learn
On Tuesday, 13 December 2016 at 19:13:24 UTC, Begah wrote: Any ideas? you can't.

Re: Issue with dmd, linker, visualD on windows 10

2016-12-14 Thread rumbu via Digitalmars-d-learn
On Wednesday, 14 December 2016 at 11:06:10 UTC, aberba wrote: I am trying to get a fellow to try D but just setting up on windows 10 has been headache. He's currently remote. Here's the problem. (Note I'm a Linux user and haven't used windows 10) 1. He installed dmd 2 but the command "dmd"

Dynamically Loading a D DLL From a D Program

2016-12-14 Thread Benjiro via Digitalmars-d-learn
Silly question: In this post about static / dynamic loading, i noticed that it uses the dlopen/dlclose, while there is a core.runtime for handling the loading. http://dlang.org/dll-linux.html#dso9 Dynamically Loading a D DLL From a D Program void* lh = dlopen("libdll.so", RTLD_LAZY); //

Re: DRY version of `static if(__traits(compiles, expr)) fun(expr)`

2016-12-14 Thread Ali Çehreli via Digitalmars-d-learn
On 12/14/2016 09:25 AM, Basile B. wrote: > On Tuesday, 13 December 2016 at 23:37:59 UTC, Timon Gehr wrote: >> I usually do >> >> enum code = q{expr}; >> static if(__traits(compiles,mixin(code))) >> fun(mixin(code)); > > Strangely if i put this in a templated enum that doesn't work. > If

Get fils at compile-time

2016-12-14 Thread bauss (wtf happend to my name took some old cached title LOL??) via Digitalmars-d-learn
Is there a way to get all files in a folder at compile-time. To be more specific I want to import the content of all files within a specific folder during compile-time. I know how to do it with a specific file using `import("filename")`, but what if I wanted to do it at compile-time for all

Re: Get fils at compile-time

2016-12-14 Thread bauss via Digitalmars-d-learn
On Wednesday, 14 December 2016 at 20:47:23 UTC, bauss (wtf happend to my name took some old cached title LOL??) wrote: Is there a way to get all files in a folder at compile-time. To be more specific I want to import the content of all files within a specific folder during compile-time. I know

Simplest way to build a DMD compatible C lib, and how to link using DUB.

2016-12-14 Thread hardreset via Digitalmars-d-learn
I built Freetype with MSVC13 and tried to link it but DMD didnt like the format, so what should compiler (free) should I use for building DMD compatible static libs? Once I've build the lib, made a di file, where do I put these things in the dub directory structure? thanks,

Re: Dynamically Loading a D DLL From a D Program

2016-12-14 Thread Nicholas Wilson via Digitalmars-d-learn
On Wednesday, 14 December 2016 at 21:38:27 UTC, Benjiro wrote: Silly question: In this post about static / dynamic loading, i noticed that it uses the dlopen/dlclose, while there is a core.runtime for handling the loading. http://dlang.org/dll-linux.html#dso9 Dynamically Loading a D DLL From

Re: Simplest way to build a DMD compatible C lib, and how to link using DUB.

2016-12-14 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 14 December 2016 at 23:08:30 UTC, hardreset wrote: I built Freetype with MSVC13 and tried to link it but DMD didnt like the format, so what should compiler (free) should I use for building DMD compatible static libs? Once I've build the lib, made a di file, where do I put these

Re: DRY version of `static if(__traits(compiles, expr)) fun(expr)`

2016-12-14 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 14 December 2016 at 22:06:35 UTC, Ali Çehreli wrote: On 12/14/2016 09:25 AM, Basile B. wrote: > On Tuesday, 13 December 2016 at 23:37:59 UTC, Timon Gehr wrote: >> I usually do >> >> enum code = q{expr}; >> static if(__traits(compiles,mixin(code))) >> fun(mixin(code)); > >

Re: Simplest way to build a DMD compatible C lib, and how to link using DUB.

2016-12-14 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 14 December 2016 at 23:08:30 UTC, hardreset wrote: I built Freetype with MSVC13 and tried to link it but DMD didnt like the format, so what should compiler (free) should I use for building DMD compatible static libs? The MS linker produces COFF format. By default, DMD uses the

Re: Get fils at compile-time

2016-12-14 Thread rikki cattermole via Digitalmars-d-learn
I did a lot of work in this area. There are two solutions: 1) Use a package file and public import all modules via it. From this do some form of 'registration' in a module constructor. Using __traits(allMembers, retrieve the imports and with that the other modules. 2) Before compilation create

Re: Get fils at compile-time

2016-12-14 Thread Bauss via Digitalmars-d-learn
On Thursday, 15 December 2016 at 02:58:11 UTC, rikki cattermole wrote: I did a lot of work in this area. There are two solutions: 1) Use a package file and public import all modules via it. From this do some form of 'registration' in a module constructor. Using __traits(allMembers, retrieve

Re: Get fils at compile-time

2016-12-14 Thread rikki cattermole via Digitalmars-d-learn
On 15/12/2016 8:11 PM, Bauss wrote: On Thursday, 15 December 2016 at 02:58:11 UTC, rikki cattermole wrote: I did a lot of work in this area. There are two solutions: 1) Use a package file and public import all modules via it. From this do some form of 'registration' in a module constructor.

Re: DRY version of `static if(__traits(compiles, expr)) fun(expr)`

2016-12-14 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 13 December 2016 at 23:37:59 UTC, Timon Gehr wrote: On 14.12.2016 00:00, Timothee Cour via Digitalmars-d-learn wrote: what's the best (and DRY) way to achieve: ``` static if(__traits(compiles, expr)) fun(expr); ``` ie, without repeating the expression inside expr? eg: ```

Re: Issue with dmd, linker, visualD on windows 10

2016-12-14 Thread aberba via Digitalmars-d-learn
On Wednesday, 14 December 2016 at 12:06:01 UTC, rumbu wrote: On Wednesday, 14 December 2016 at 11:06:10 UTC, aberba wrote: [...] If he runs the command in an already open console window, that's normal. A new console window launch will be enough to know about the recent environment path