Re: Using D within a rust codebase

2020-07-26 Thread Paul Backus via Digitalmars-d-learn
On Sunday, 26 July 2020 at 21:18:19 UTC, powerboat9 wrote: I have an existing rust project, and I'm trying to rewrite part of it in D. However, I'm not sure how to get rust -> dlang interop working. I've looked into rust -> c -> dlang interop, but I'm not sure how to get c -> dlang interop work

Re: Template error with gdc-10 but not with latest dmd and ldc

2020-07-26 Thread Per Nordlöw via Digitalmars-d-learn
On Sunday, 26 July 2020 at 21:48:09 UTC, Per Nordlöw wrote: I see. Thanks. The code long add_long_n0(alias T=void)(long x) { return x + 0; } should be long add_long_n0(T=void)(long x) { return x + 0; } . My mistake. Thanks.

Re: Template error with gdc-10 but not with latest dmd and ldc

2020-07-26 Thread Per Nordlöw via Digitalmars-d-learn
On Sunday, 26 July 2020 at 20:32:55 UTC, Iain Buclaw wrote: This feature? https://dlang.org/changelog/2.087.0.html#template_alias_matches_basic_types I see. Thanks.

Using D within a rust codebase

2020-07-26 Thread powerboat9 via Digitalmars-d-learn
I have an existing rust project, and I'm trying to rewrite part of it in D. However, I'm not sure how to get rust -> dlang interop working. I've looked into rust -> c -> dlang interop, but I'm not sure how to get c -> dlang interop working either.

Re: Template error with gdc-10 but not with latest dmd and ldc

2020-07-26 Thread Iain Buclaw via Digitalmars-d-learn
On Sunday, 26 July 2020 at 19:27:13 UTC, rikki cattermole wrote: 2.066.0 to 2.078.1: Failure with output: onlineapp.d(7): Error: template instance add_long_n0!void does not match template declaration add_long_n0(alias T = void)(long x) 2.079.1 to 2.086.1: Failure with output: onlineapp.d(7): Err

Re: Template error with gdc-10 but not with latest dmd and ldc

2020-07-26 Thread Per Nordlöw via Digitalmars-d-learn
On Sunday, 26 July 2020 at 19:27:13 UTC, rikki cattermole wrote: Old frontend: Up to 2.060 : Failure with output: onlineapp.d(2): Error: valid attribute identifiers are @property, @safe, @trusted, @system, @disable not @nogc 2.061 to 2.065.0: Failure with output: - onlineapp.d(2):

Re: Template error with gdc-10 but not with latest dmd and ldc

2020-07-26 Thread rikki cattermole via Digitalmars-d-learn
Old frontend: Up to 2.060 : Failure with output: onlineapp.d(2): Error: valid attribute identifiers are @property, @safe, @trusted, @system, @disable not @nogc 2.061 to 2.065.0: Failure with output: - onlineapp.d(2): Error: user defined attributes cannot appear as postfixes onlinea

Template error with gdc-10 but not with latest dmd and ldc

2020-07-26 Thread Per Nordlöw via Digitalmars-d-learn
The code example long add_long_n0(alias T=void)(long x) @safe pure nothrow @nogc { return x + 0; } int main(string[] args) { long long_sum = 0; long_sum += add_long_n0!(void)(cast(long)0); return cast(int)long_sum; } compiles without errors with dmd and ldc. But with gdc-10 as

Re: Help with Ranges

2020-07-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/26/20 3:10 AM, Charles wrote: Suppose I have the following line of code where arr is an array, doSomething is some predicate that does a lot of processing on each element, sort must come after the mapping, and there are more operations done to the range after sort: arr.map!doSomething.so

Re: Static link of glfw3 library fails for me

2020-07-26 Thread John Burton via Digitalmars-d-learn
On Sunday, 26 July 2020 at 10:41:27 UTC, Mike Parker wrote: On Sunday, 26 July 2020 at 08:28:29 UTC, John Burton wrote: And I get the following errors from the link :- lld-link: error: undefined symbol: __GSHandlerCheck lld-link: error: undefined symbol: __security_check_cookie lld-link: erro

Re: Static link of glfw3 library fails for me

2020-07-26 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 26 July 2020 at 08:28:29 UTC, John Burton wrote: versions "BindGLFW_Static" libs "glfw3" lflags "-L..\\work\\3rdparty\\lib" And by the way, you're going to need to link more libs than glfw3 for a static link. You'll need all of its dependencies, as well (OpenGL32.lib, gdi32.lib,

Re: Static link of glfw3 library fails for me

2020-07-26 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 26 July 2020 at 08:28:29 UTC, John Burton wrote: And I get the following errors from the link :- lld-link: error: undefined symbol: __GSHandlerCheck lld-link: error: undefined symbol: __security_check_cookie lld-link: error: undefined symbol: __security_cookie I believe that's bec

Static link of glfw3 library fails for me

2020-07-26 Thread John Burton via Digitalmars-d-learn
I'm trying to replicate a program I make in C++ using D. I am using the ldc2 compiler and want to *static* link in the glfw library. Following the docs I have an dub.sdl file that looks like the one below. The library I'm linking with is the vs2019 one from the GLFW zip file from their websit

Help with Ranges

2020-07-26 Thread Charles via Digitalmars-d-learn
Suppose I have the following line of code where arr is an array, doSomething is some predicate that does a lot of processing on each element, sort must come after the mapping, and there are more operations done to the range after sort: arr.map!doSomething.sort. ...; Sort fails to instantiate