Re: Derelict on Ubuntu with CODE::BLOCKS

2018-05-02 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 3 May 2018 at 03:18:02 UTC, RegeleIONESCU wrote: The only problem I have with DUB is that all added dependencies are "old". For example added dependency "derelict-sdl2" is version="~>2.1.4" while on DUB site the last version is 3.1.0-alpha.3. I tried the --upgrade plus --prerel

Re: C++ / Wrong function signature generated for reference parameter

2018-05-02 Thread Robert M. Münch via Digitalmars-d-learn
On 2018-05-03 02:23:27 +, Rubn said: If "Image" is a class then all classes are based as pointers to their respective object. Hi, ok. Didn't remember that this is always the case. So passing a ref to a class is kind of redundant. Yes, that's why I was confused. You want to use a struc

Re: Why does enumerate over range return dchar, when ranging without returns char?

2018-05-02 Thread rikki cattermole via Digitalmars-d-learn
On 03/05/2018 5:44 PM, James Blachly wrote: I am puzzled why enumerating in a foreach returns a dchar (which forces me to cast), whereas without the enumerate the range returns a char as expected. Example: ``` import std.stdio; import std.range : enumerate; void main() { char[] s = ['a'

Why does enumerate over range return dchar, when ranging without returns char?

2018-05-02 Thread James Blachly via Digitalmars-d-learn
I am puzzled why enumerating in a foreach returns a dchar (which forces me to cast), whereas without the enumerate the range returns a char as expected. Example: ``` import std.stdio; import std.range : enumerate; void main() { char[] s = ['a','b','c']; char[3] x; auto i = 0;

Re: Derelict on Ubuntu with CODE::BLOCKS

2018-05-02 Thread RegeleIONESCU via Digitalmars-d-learn
On Monday, 11 December 2017 at 07:34:47 UTC, Mike Parker wrote: On Sunday, 10 December 2017 at 16:50:10 UTC, RegeleIONESCU wrote: [...] My advice is to ditch Code::Blocks and use something like VS Code or Sublime Text in conjunction with DUB. It's by far the easiest way to get started with D

Re: Ambiguous template parameter names

2018-05-02 Thread Meta via Digitalmars-d-learn
On Thursday, 3 May 2018 at 02:48:10 UTC, jmh530 wrote: On Thursday, 3 May 2018 at 00:52:58 UTC, Meta wrote: [snip] It's not a big per se. It's a consequence of the declaration expanding to the real template function form (I can't type it all out as I'm on my phone), thus the inner `val` from

Re: Ambiguous template parameter names

2018-05-02 Thread jmh530 via Digitalmars-d-learn
On Thursday, 3 May 2018 at 00:52:58 UTC, Meta wrote: [snip] It's not a big per se. It's a consequence of the declaration expanding to the real template function form (I can't type it all out as I'm on my phone), thus the inner `val` from the function shadows the one from the template. That

Re: C++ / Wrong function signature generated for reference parameter

2018-05-02 Thread Rubn via Digitalmars-d-learn
On Wednesday, 2 May 2018 at 21:55:31 UTC, Robert M. Münch wrote: I have the following C++ function signature: uint _begin(Image& image, const InitParams* initParams) and the following D code: class InitParams { } class B2D { uint _begin(ref Image image, InitParams initParams); } B

Re: Ambiguous template parameter names

2018-05-02 Thread Meta via Digitalmars-d-learn
On Wednesday, 2 May 2018 at 20:32:43 UTC, jmh530 wrote: In the function below, there is a template parameter and a normal parameter both with the same name. However, the function returns the normal parameter. The template parameter is effectively ignored. I was surprised by this behavior. Is

Re: Out of memory during compilation

2018-05-02 Thread Joakim via Digitalmars-d-learn
On Wednesday, 2 May 2018 at 15:13:58 UTC, Matt Gamble wrote: On Wednesday, 2 May 2018 at 14:30:19 UTC, Joakim wrote: On Wednesday, 2 May 2018 at 14:25:35 UTC, Matt Gamble wrote: I have a large program (for me) with several thousand lines of code. Recently when I've tried to compile under debug

Re: Digger v3.0 alpha 5 / DMD 2.080.0 / Can't build...

2018-05-02 Thread Seb via Digitalmars-d-learn
On Wednesday, 2 May 2018 at 21:13:03 UTC, Robert M. Münch wrote: On 2018-05-02 09:39:41 +, Seb said: [...] Hi, not that I know about... [...] Looks like it's an issue with the windows bootstrapping. I would recommend to report a bug to Vladimir's issue tracker: https://github.com/Cyber

Re: Ambiguous template parameter names

2018-05-02 Thread user1234 via Digitalmars-d-learn
On Wednesday, 2 May 2018 at 20:32:43 UTC, jmh530 wrote: In the function below, there is a template parameter and a normal parameter both with the same name. However, the function returns the normal parameter. The template parameter is effectively ignored. I was surprised by this behavior. Is

C++ / Wrong function signature generated for reference parameter

2018-05-02 Thread Robert M. Münch via Digitalmars-d-learn
I have the following C++ function signature: uint _begin(Image& image, const InitParams* initParams) and the following D code: class InitParams { } class B2D { uint _begin(ref Image image, InitParams initParams); } But this compiles to the following signature which is not found by

Re: Digger v3.0 alpha 5 / DMD 2.080.0 / Can't build...

2018-05-02 Thread Robert M. Münch via Digitalmars-d-learn
On 2018-05-02 09:39:41 +, Seb said: Works fine for me with 2.080.0. Did you maybe modify your working directory locally? Hi, not that I know about... If so, try nuking `work` away. I did and digger downloaded a bunch of things and failed wiht this: D:\develop\d-language\Digger> .\digg

Ambiguous template parameter names

2018-05-02 Thread jmh530 via Digitalmars-d-learn
In the function below, there is a template parameter and a normal parameter both with the same name. However, the function returns the normal parameter. The template parameter is effectively ignored. I was surprised by this behavior. Is this a bug or intentional? I did not see it documented a

Re: How to curl!

2018-05-02 Thread ikod via Digitalmars-d-learn
On Wednesday, 2 May 2018 at 16:58:35 UTC, IntegratedDimensions wrote: On Wednesday, 2 May 2018 at 03:03:19 UTC, ikod wrote: On Wednesday, 2 May 2018 at 00:04:49 UTC, IntegratedDimensions wrote: On Tuesday, 1 May 2018 at 23:35:42 UTC, Arun Chandrasekaran wrote: [...] Ok, first try: Unhandled

Thread-safe cache

2018-05-02 Thread bauss via Digitalmars-d-learn
What would the most performent way to create a thread-safe cache that can be used across threads/fibers in D? Lock-free as much as possible. What I ultimately want to do is to cache some data I pull from a database (Or elsewhere for that matter) and then cache it somewhere, so I can avoid hav

Re: Create variable for RedBlackTree range

2018-05-02 Thread Meta via Digitalmars-d-learn
On Wednesday, 2 May 2018 at 10:39:29 UTC, ag0aep6g wrote: On 04/28/2018 06:36 PM, Gerald wrote: What is the appropriate way to create a variable for the range returned by RedBlackTree lowerBound and upperBound. For example, given this code: ``` RedBlackTree!long promptPosition = redBlackTree!

Re: How to curl!

2018-05-02 Thread IntegratedDimensions via Digitalmars-d-learn
On Wednesday, 2 May 2018 at 03:03:19 UTC, ikod wrote: On Wednesday, 2 May 2018 at 00:04:49 UTC, IntegratedDimensions wrote: On Tuesday, 1 May 2018 at 23:35:42 UTC, Arun Chandrasekaran wrote: [...] Ok, first try: Unhandled exception: object.Exception can't complete call to TLS_method at requ

Re: Out of memory during compilation

2018-05-02 Thread rikki cattermole via Digitalmars-d-learn
On 03/05/2018 3:21 AM, Matt Gamble wrote: On Wednesday, 2 May 2018 at 14:31:16 UTC, rikki cattermole wrote: On 03/05/2018 2:25 AM, Matt Gamble wrote: [...] Let me start by saying shared library support doesn't work (some people will say it does work partially, but it doesn't). The problem

Re: Out of memory during compilation

2018-05-02 Thread Matt Gamble via Digitalmars-d-learn
On Wednesday, 2 May 2018 at 14:31:16 UTC, rikki cattermole wrote: On 03/05/2018 2:25 AM, Matt Gamble wrote: [...] Let me start by saying shared library support doesn't work (some people will say it does work partially, but it doesn't). The problem for you (I think) is that dmd is compiled a

Re: Out of memory during compilation

2018-05-02 Thread Matt Gamble via Digitalmars-d-learn
On Wednesday, 2 May 2018 at 14:30:19 UTC, Joakim wrote: On Wednesday, 2 May 2018 at 14:25:35 UTC, Matt Gamble wrote: I have a large program (for me) with several thousand lines of code. Recently when I've tried to compile under debug (-g -unittest) with VS2017, dmd2.076.1, windows 10, 8Gb ram)

Re: Out of memory during compilation

2018-05-02 Thread Joakim via Digitalmars-d-learn
On Wednesday, 2 May 2018 at 14:25:35 UTC, Matt Gamble wrote: I have a large program (for me) with several thousand lines of code. Recently when I've tried to compile under debug (-g -unittest) with VS2017, dmd2.076.1, windows 10, 8Gb ram), I've had the following output: Compiling SKaTERoptim

Re: Out of memory during compilation

2018-05-02 Thread rikki cattermole via Digitalmars-d-learn
On 03/05/2018 2:25 AM, Matt Gamble wrote: I have a large program (for me) with several thousand lines of code. Recently when I've tried to compile under debug (-g -unittest)  with VS2017, dmd2.076.1, windows 10, 8Gb ram), I've had the following output: Compiling SKaTERoptimizerD.d... Fatal Err

Out of memory during compilation

2018-05-02 Thread Matt Gamble via Digitalmars-d-learn
I have a large program (for me) with several thousand lines of code. Recently when I've tried to compile under debug (-g -unittest) with VS2017, dmd2.076.1, windows 10, 8Gb ram), I've had the following output: Compiling SKaTERoptimizerD.d... Fatal Error: Out of memory Building x64\Debug\SKaTE

Re: Concatenate strings at compile-time

2018-05-02 Thread Stefan Koch via Digitalmars-d-learn
On Wednesday, 2 May 2018 at 12:38:25 UTC, Jonathan M. Wilbur wrote: I have a method that cannot be @nogc only because it concatenates strings for a long exception message, as seen below. throw new ASN1ValuePaddingException ( "This exception was thrown be

Re: Concatenate strings at compile-time

2018-05-02 Thread rikki cattermole via Digitalmars-d-learn
On 03/05/2018 12:38 AM, Jonathan M. Wilbur wrote: I have a method that cannot be @nogc only because it concatenates strings for a long exception message, as seen below.     throw new ASN1ValuePaddingException     (     "This exception was thrown because you attemp

Concatenate strings at compile-time

2018-05-02 Thread Jonathan M. Wilbur via Digitalmars-d-learn
I have a method that cannot be @nogc only because it concatenates strings for a long exception message, as seen below. throw new ASN1ValuePaddingException ( "This exception was thrown because you attempted to decode " ~ "an INTEGER that wa

Re: Create variable for RedBlackTree range

2018-05-02 Thread ag0aep6g via Digitalmars-d-learn
On 04/28/2018 06:36 PM, Gerald wrote: What is the appropriate way to create a variable for the range returned by RedBlackTree lowerBound and upperBound. For example, given this code: ``` RedBlackTree!long promptPosition = redBlackTree!long(); long row = to!long(vte.getVadjustment().getValue())

Re: Digger v3.0 alpha 5 / DMD 2.080.0 / Can't build...

2018-05-02 Thread Seb via Digitalmars-d-learn
On Wednesday, 2 May 2018 at 09:36:23 UTC, Robert M. Münch wrote: Hi, digger won't build because it sees some local changes to file, which I didn't do: [...] Works fine for me with 2.080.0. Did you maybe modify your working directory locally? If so, try nuking `work` away. (btw digger is us

Digger v3.0 alpha 5 / DMD 2.080.0 / Can't build...

2018-05-02 Thread Robert M. Münch via Digitalmars-d-learn
Hi, digger won't build because it sees some local changes to file, which I didn't do: D:\develop\d-language\Digger> ./digger build --model=64 digger: Building spec: master digger: Adding D:\develop\d-language\Digger\work\dl\git\cmd to PATH. digger: Updating repo... Fetching origin digger: Starti