Re: Two questions

2019-01-02 Thread IM via Digitalmars-d-learn
On Wednesday, 2 January 2019 at 17:49:52 UTC, H. S. Teoh wrote: On Wed, Jan 02, 2019 at 05:38:41PM +, IM via Digitalmars-d-learn wrote: 1- How do I do in D the equivalent of the following C++ macro? #define OUT_VAL(val) (count << #val << " = " << val << e

Re: Two questions

2019-01-02 Thread IM via Digitalmars-d-learn
On Wednesday, 2 January 2019 at 21:56:03 UTC, Steven Schveighoffer wrote: On 1/2/19 12:38 PM, IM wrote: [...] With those ... I have to guess. There are 2 possibilities. Possibility 1: there is a method named 'doSomeWork' which takes at least one parameter. This overrides the UFCS function

Two questions

2019-01-02 Thread IM via Digitalmars-d-learn
1- How do I do in D the equivalent of the following C++ macro? #define OUT_VAL(val) (count << #val << " = " << val << endl) In particular the #val above to the actual macro argument as a string? 2- Yesterday I was experimenting with something and I wrote something like the following:

Re: DLS (D Language Server) v0.20

2018-12-31 Thread IM via Digitalmars-d-announce
On Friday, 28 December 2018 at 20:35:44 UTC, Paolo Invernizzi wrote: On Friday, 28 December 2018 at 18:50:39 UTC, David Gileadi wrote: On 12/28/18 4:14 AM, Laurent Tréguier wrote: Hello, and merry Christmas! (a bit late, but whatever) This is an excellent update--the update Just Works™ with

Re: Noob question about structs allocation

2018-10-14 Thread IM via Digitalmars-d-learn
On Monday, 15 October 2018 at 03:33:04 UTC, Basile B. wrote: On Monday, 15 October 2018 at 03:19:07 UTC, IM wrote: I probably used to know the answer to this question, but it's been a long time since I last used D, and I don't remember. Suppose we have: struct S { int num; } Would

Noob question about structs allocation

2018-10-14 Thread IM via Digitalmars-d-learn
I probably used to know the answer to this question, but it's been a long time since I last used D, and I don't remember. Suppose we have: struct S { int num; } Would allocating an instance on the heap using: S* s = new S; use the GC, or do we have to call destroy() or delete on s

Re: Give DLS a try

2018-08-09 Thread IM via Digitalmars-d
On Wednesday, 8 August 2018 at 20:56:51 UTC, tide wrote: On Wednesday, 8 August 2018 at 07:57:49 UTC, Laurent Tréguier wrote: [...] Code-d overcomplicates things I find though. I can't even build it, there's so many dependencies attached to it that it isn't worth looking through to even

Re: When will the final DConf videos surface on YouTube?

2018-05-03 Thread IM via Digitalmars-d
On Friday, 4 May 2018 at 00:13:42 UTC, Nick Sabalausky (Abscissa) wrote: On 05/03/2018 05:09 PM, IM wrote: I can't wait to watch. Not sure if you're specifically talking about the videos being split up per talk, but you can rewatch the full first two days livestreams here: Day 1 Afternoon

When will the final DConf videos surface on YouTube?

2018-05-03 Thread IM via Digitalmars-d
I can't wait to watch.

Re: Official Dub package for DWT

2018-03-08 Thread IM via Digitalmars-d-announce
On Wednesday, 7 February 2018 at 21:33:22 UTC, Jacob Carlborg wrote: This has been long overdue but I would like to announce that I've just released an official Dub package for the DWT library [1]. For a usage example, please see the GitHub page [2]. [...] This is great, thanks! Any plans

Re: Release D 2.078.0

2018-01-04 Thread IM via Digitalmars-d-announce
On Wednesday, 3 January 2018 at 17:43:36 UTC, Martin Nowak wrote: Glad to announce D 2.078.0. This release comes with runtime detection of Visual Studio installation paths, an integral promotion transition for unary operations on byte and short sized integers, more -betterC features, and a

Re: What don't you switch to GitHub issues

2018-01-03 Thread IM via Digitalmars-d
On Tuesday, 2 January 2018 at 16:32:50 UTC, H. S. Teoh wrote: On Tue, Jan 02, 2018 at 09:57:08AM +, Patrick Schluter via Digitalmars-d wrote: On Monday, 1 January 2018 at 18:32:37 UTC, Pjotr Prins wrote: [...] > I am just going to share my thoughts a little. Github, in my > opinion, is

Re: What do you want to see for a mature DLang?

2018-01-01 Thread IM via Digitalmars-d
On Sunday, 31 December 2017 at 21:16:35 UTC, Walter Bright wrote: On 12/31/2017 8:18 AM, IM wrote: What do you think? Do you agree that a process is needed? We've tried adding process before. It does not work, for the simple reason that it requires a dedicated group of people to dedicate

Re: What do you want to see for a mature DLang?

2017-12-31 Thread IM via Digitalmars-d
On Sunday, 31 December 2017 at 07:43:35 UTC, Walter Bright wrote: On 12/30/2017 11:23 PM, IM wrote: While we are discussing it here, could you please let me know what the bug triage process for each release cycle is? Is it random that anyone picks up whatever bug s/he feels like fixing? Or is

Re: What do you want to see for a mature DLang?

2017-12-30 Thread IM via Digitalmars-d
On Sunday, 31 December 2017 at 05:43:57 UTC, Walter Bright wrote: On 12/30/2017 6:42 AM, Muld wrote: In contrast this same problem exists for Bugzilla. You say it's working cause it's better than using notepad or some other stupid shit. Bugzilla isn't the issue, it's the fact the people

Re: What do you want to see for a mature DLang?

2017-12-29 Thread IM via Digitalmars-d
On Friday, 29 December 2017 at 17:29:47 UTC, Adam D. Ruppe wrote: On Friday, 29 December 2017 at 07:53:51 UTC, IM wrote: -- Better compiler errors, better compiler errors, better compiler errors. This is the only thing I greatly care about anymore. Biggest problem D has in real world

Re: What do you want to see for a mature DLang?

2017-12-29 Thread IM via Digitalmars-d
On Saturday, 30 December 2017 at 01:40:39 UTC, Adam D. Ruppe wrote: On Friday, 29 December 2017 at 23:24:45 UTC, Walter Bright wrote: That's been closed for a while now. Well, take your pick: https://issues.dlang.org/show_bug.cgi?id=12694 https://issues.dlang.org/show_bug.cgi?id=13340

Re: Compiler bug?

2017-12-29 Thread IM via Digitalmars-d
On Friday, 29 December 2017 at 07:55:08 UTC, Daniel Kozak wrote: But maybe you can propose cjange from ref R r to auto ref R r If this will make it work with both lvalues and rvalues, then yes, this would be a nice fix. No need to force users to cache string line = readln(); first and then

What do you want to see for a mature DLang?

2017-12-28 Thread IM via Digitalmars-d
I will start: -- Better compiler errors, better compiler errors, better compiler errors. I really wish that the compiler errors could receive some refinement. Mostly it feels like some error text just being thrown at me. It needs to be better formatted, more helpful, with suggestions

Compiler bug?

2017-12-28 Thread IM via Digitalmars-d
The following code: int guess; readln().formattedRead!"%d"(guess); produces the following compiler error: Error: template std.format.formattedRead cannot deduce function from argument types !("%s")(string, int), candidates are: /usr/include/dmd/phobos/std/format.d(635):

Compiler gets confused with ambiguity when `int` matches both `real` and `float`.

2017-12-22 Thread IM via Digitalmars-d-learn
The following expression: import std.math : sqrt; sqrt(400); produces the following compiler error: std.math.sqrt called with argument types (int) matches both: /usr/include/dmd/phobos/std/math.d(1592,7): std.math.sqrt(float x) and: /usr/include/dmd/phobos/std/math.d(1598,6):

Re: Is it possible to request a code review?

2017-12-15 Thread IM via Digitalmars-d
On Friday, 15 December 2017 at 21:34:48 UTC, Neia Neutuladh wrote: On Wednesday, 13 December 2017 at 03:15:11 UTC, IM wrote: https://code.dlang.org/packages/libdtasks I'd get rid of the ITaskRunner interface and rename AbstractTaskRunner to TaskRunner. Interfaces are fine when you need

Re: Is it possible to request a code review?

2017-12-15 Thread IM via Digitalmars-d
I'm still looking for feedback about these points: - Any candidate class that can be better switched to a struct or even a template? - The use of shared and __gshared, did I get those right? I find the TLS concept unpleasant, because it makes me unsure what's the right thing to do. For

Re: Is it possible to request a code review?

2017-12-15 Thread IM via Digitalmars-d
On Thursday, 14 December 2017 at 12:51:07 UTC, rjframe wrote: On Wed, 13 Dec 2017 03:15:11 +, IM wrote: [...] I like this API design. I would separate each unit test to its own `unittest` block (you have three tests in a single block in `SingleThreadTaskRunner.d`); it doesn't really

Re: Is it possible to request a code review?

2017-12-14 Thread IM via Digitalmars-d
On Thursday, 14 December 2017 at 07:47:58 UTC, Ali Çehreli wrote: On 12/13/2017 07:57 PM, IM wrote: > - Is this the idiomatic way to define a singleton in D?: > https://gitlab.com/3d_immortal/libdtasks/blob/master/src/tasks/TaskSystem.d#L24. > I got this from Ali's book. I think you

Re: Is it possible to request a code review?

2017-12-13 Thread IM via Digitalmars-d
On Thursday, 14 December 2017 at 04:12:33 UTC, rikki cattermole wrote: On 14/12/2017 3:57 AM, IM wrote: snip     - Is this the idiomatic way to define a singleton in D?: https://gitlab.com/3d_immortal/libdtasks/blob/master/src/tasks/TaskSystem.d#L24. You say singleton I think wrong. Use

Re: Is it possible to request a code review?

2017-12-13 Thread IM via Digitalmars-d
On Wednesday, 13 December 2017 at 07:30:55 UTC, Jonathan M Davis wrote: On Wednesday, December 13, 2017 06:14:04 bauss via Digitalmars-d wrote: Documentation can be done like this for multiline: /** * ... * ... * etc. */ Instead of: /// ... /// ... /// etc. You can also do /** ... ...

Re: Is it possible to request a code review?

2017-12-13 Thread IM via Digitalmars-d
On Wednesday, 13 December 2017 at 07:02:47 UTC, Ali Çehreli wrote: On 12/12/2017 07:15 PM, IM wrote: I started learning D recently. Welcome! There is also the Learn newsgroup[1]. ;) Ali [1] Available through a forum interface here: http://forum.dlang.org/group/learn Thanks, I posted a

Re: Is it possible to request a code review?

2017-12-13 Thread IM via Digitalmars-d
On Wednesday, 13 December 2017 at 06:14:04 UTC, bauss wrote: On Wednesday, 13 December 2017 at 03:15:11 UTC, IM wrote: Thanks! First thing. Generally in D module names are kept lower-case. To give an example your: AbstractTaskRunner.d module tasks.AbstractTaskRunner; Would usually be:

Is it possible to request a code review?

2017-12-12 Thread IM via Digitalmars-d
I started learning D recently. As part of the learning process, I started working on some D projects to experiment and learn. My first project is a tasking system library that I plan to use in another D project I'm working on. The goal is to be able to post and run any task asynchronously on

Re: Invoking writeln() from a lot of threads running concurrently --> crash

2017-12-09 Thread IM via Digitalmars-d
On Saturday, 9 December 2017 at 10:36:08 UTC, Messenger wrote: On Saturday, 9 December 2017 at 09:38:05 UTC, IM wrote: For purposes of debugging, I'm using writeln() to print stuff out from tasks running concurrently on many threads. At some point it crashes with the following stack trace:

Re: Invoking writeln() from a lot of threads running concurrently --> crash

2017-12-09 Thread IM via Digitalmars-d
On Sunday, 10 December 2017 at 01:12:37 UTC, Walter Bright wrote: On 12/9/2017 5:56 AM, Seb wrote: IIRC the implementation of LockingTextWriter isn't thread-safe. There's no bugzilla issue on this. So I added one: https://issues.dlang.org/show_bug.cgi?id=18052 Please, folks, I can't

Invoking writeln() from a lot of threads running concurrently --> crash

2017-12-09 Thread IM via Digitalmars-d
For purposes of debugging, I'm using writeln() to print stuff out from tasks running concurrently on many threads. At some point it crashes with the following stack trace: Thread 4 received signal SIGUSR1, User defined signal 1. [Switching to Thread 0x75ec2700 (LWP 19267)]

Re: Abstract Classes

2017-12-06 Thread IM via Digitalmars-d-learn
On Wednesday, 6 December 2017 at 23:16:54 UTC, Ali Çehreli wrote: On 12/06/2017 03:01 PM, IM wrote: > On Wednesday, 6 December 2017 at 07:54:21 UTC, Ali Çehreli wrote: >> On 12/05/2017 11:23 PM, IM wrote: >>> [...] >> >> Just remove the override keywords in this case. No function is >>

Re: Abstract Classes

2017-12-06 Thread IM via Digitalmars-d-learn
On Wednesday, 6 December 2017 at 07:54:21 UTC, Ali Çehreli wrote: On 12/05/2017 11:23 PM, IM wrote: [...] Just remove the override keywords in this case. No function is overriding any implementation here, they both implement an interface function. The fact that override can be used for

Abstract Classes

2017-12-05 Thread IM via Digitalmars-d-learn
Assume the following: interface IFace { void foo(); void bar(); } abstract class A : IFace { override void foo() {} } class B : A { override void bar() {} } Now why this fails to compiler with the following message: --->>> function bar does not override any function, did you mean to

Re: Thoughts about D

2017-11-27 Thread IM via Digitalmars-d
On Monday, 27 November 2017 at 08:33:42 UTC, IM wrote: - More exposure. I sometimes feel like there isn't enough D material to consume on a regular basis (and I and certainly many others are eager to learn more and more about the language). i.e. one blog post (weekly?), and a single DConf

Re: Thoughts about D

2017-11-27 Thread IM via Digitalmars-d
On Monday, 27 November 2017 at 02:56:34 UTC, Walter Bright wrote: On 11/26/2017 4:14 PM, IM wrote: I'm a full-time C++ software engineer in Silicon Valley. I've been learning D and using it in a couple of personal side projects for a few months now. Great! Glad you're enjoying it and took

Re: Thoughts about D

2017-11-27 Thread IM via Digitalmars-d
On Monday, 27 November 2017 at 05:11:06 UTC, Neia Neutuladh wrote: On Monday, 27 November 2017 at 00:14:40 UTC, IM wrote: - ‎It's quite clear that D was influenced a lot by Java at some point, which led to borrowing (copying?) a lot of Java features that may not appeal to everyone. Have you

Re: Thoughts about D

2017-11-27 Thread IM via Digitalmars-d
On Monday, 27 November 2017 at 03:01:24 UTC, Jon Degenhardt wrote: Forum discussions are valuable venue. Since you are in Silicon Valley, you might also consider attending one of the Silicon Valley D meetups (https://www.meetup.com/D-Lang-Silicon-Valley). It's hard to beat face-to-face

Thoughts about D

2017-11-26 Thread IM via Digitalmars-d
Hi, I'm a full-time C++ software engineer in Silicon Valley. I've been learning D and using it in a couple of personal side projects for a few months now. First of all, I must start by saying that I like D, and wish to use it everyday. I'm even considering to donate to the D foundation.