Re: Two really good looking GUI libraries that can work for D

2018-05-12 Thread Rubn via Digitalmars-d
On Saturday, 12 May 2018 at 19:03:50 UTC, aberba wrote: On Friday, 11 May 2018 at 23:13:06 UTC, Rubn wrote: On Friday, 11 May 2018 at 21:43:24 UTC, aberba wrote: [...] If you are going to mention that then you might as well mention the (imo better) alternative ImGui.

Re: [DUB][DLS] building package dls doesn't finish

2018-05-10 Thread Rubn via Digitalmars-d
On Thursday, 10 May 2018 at 09:32:38 UTC, Kamil Koczurek wrote: Hello, I installed an atom extension for D support, but it requires dls package to be installed and built. When I fetch and attempt to build it (with --build=release) it just says that it's building and doesn't change even if I

Re: Two really good looking GUI libraries that can work for D

2018-05-11 Thread Rubn via Digitalmars-d
On Friday, 11 May 2018 at 21:43:24 UTC, aberba wrote: General Usage: Nuklear is a minimal state immediate mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any

Re: Why is 64-bit dmd not built as part of the Windows release?

2018-05-15 Thread Rubn via Digitalmars-d
On Tuesday, 15 May 2018 at 16:01:28 UTC, Atila Neves wrote: I don't know why even bother with 32-bit dmd to begin with, but at least there should be an option. I just spent 45min trying to build 64-bit dmd on Windows. It wasn't fun. "Isn't it just make -f win64.mak?", I hear you ask. Yes. If

Re: Why is 64-bit dmd not built as part of the Windows release?

2018-05-16 Thread Rubn via Digitalmars-d
On Wednesday, 16 May 2018 at 11:21:21 UTC, Atila Neves wrote: On Tuesday, 15 May 2018 at 19:41:25 UTC, Rubn wrote: On Tuesday, 15 May 2018 at 16:01:28 UTC, Atila Neves wrote: [...] Which DMD version are you using to compile with? There was an issue in DMD a while back that prevented the

Re: D's Destructors are What Scott Meyers Warned Us About

2018-05-23 Thread Rubn via Digitalmars-d
On Wednesday, 23 May 2018 at 22:47:21 UTC, sarn wrote: On Wednesday, 23 May 2018 at 02:13:13 UTC, rikki cattermole wrote: I would consider the current state with classes a bug. So ticket please, it should not require a DIP to change (although Walter may disagree). Unfortunately, the way

Re: On Forum Moderation

2018-05-26 Thread Rubn via Digitalmars-d
On Saturday, 26 May 2018 at 03:34:50 UTC, Walter Bright wrote: From time to time, the issue comes up. The standard here is professional demeanor. For what professional demeanor is, see: https://www.amazon.com/Etiquette-Society-Business-Politics-Home/dp/1497339979 Unprofessional demeanor

Re: Support alias this in module scope?

2018-05-24 Thread Rubn via Digitalmars-d
On Wednesday, 23 May 2018 at 03:44:36 UTC, Manu wrote: Okay, I'm still really angry about the stupid stupid decision to make C++ namespaces into scopes rather than just a detail used for mangling, with absolutely no consultation of the community, in particular the target audience, who are

Re: DIP 1014:Hooking D's struct move semantics--Community Review Round 1

2018-05-18 Thread Rubn via Digitalmars-d
On Thursday, 17 May 2018 at 20:25:26 UTC, Shachar Shemesh wrote: Obviously, Something can be an enum or a boolean. If it is, however, then we have to perform a condition to select the correct value. The problem with conditionals is that if the CPU misses a guess about what they are (and in our

Re: Dll support: testers needed

2018-01-06 Thread Rubn via Digitalmars-d
Looks good. If you want testers though, providing binaries would be beneficial. Compiling dmd/druntime/phobos on Windows can be a pain.

Re: Alias Vs. Enum?

2018-01-06 Thread Rubn via Digitalmars-d
Tab + Enter + No Delete/Edit = :/ template valueOf(alias v) // <-- alias { alias valueOf = v; } alias aa = valueOf!(10 == 10); enum ee = 10 == 10; alias err = 10 == 10; // error Can't alias just be extended to support enum values as well instead of having this workaround with

Alias Vs. Enum?

2018-01-06 Thread Rubn via Digitalmars-d
Is there a reason for the differences between Enum and Alias? For the most part enums are only used for things that have a value, but alias is used more for types. But with templates you can get around this and you basically get the funcitonality of Enum for alias. Oddly enough from the

Re: Dscanner - DCD - Dfix ... Editor support or the lack of it.

2018-01-25 Thread Rubn via Digitalmars-d
On Thursday, 25 January 2018 at 21:18:23 UTC, Benny wrote: It seems to be that they understand the value of better tooling and friendly platform support. Whereas its my impression that a lot of resources get focused on making D its compiler / language better but the rest seems to be ignored.

Re: Tuple DIP

2018-01-12 Thread Rubn via Digitalmars-d
Should include an example of returning a tuple from a function. I know one of the pains with variadic templates is that they can't be returned. So maybe something that goes over the following use case: auto returnTuple(Args...)(Args args) { return args; } (int a, float b) =

Re: Dscanner - DCD - Dfix ... Editor support or the lack of it.

2018-01-26 Thread Rubn via Digitalmars-d
On Friday, 26 January 2018 at 15:37:15 UTC, Benny wrote: On Friday, 26 January 2018 at 03:40:26 UTC, Rubn wrote: You seem to be short tempered You think after two days trying to get a series of plugins to work? you tried 2 plugins rather quickly, without even trying to see if there were

Re: My choice to pick Go over D ( and Rust ), mostly non-technical

2018-02-02 Thread Rubn via Digitalmars-d
On Friday, 2 February 2018 at 15:06:35 UTC, Benny wrote: HTTP: If you are focusing on Http then yah Go is probably the better choice, it looks like it is entire geared towards http development. I wouldn't use D for http just like I wouldn't use C++ for http.

Re: My choice to pick Go over D ( and Rust ), mostly non-technical

2018-02-03 Thread Rubn via Digitalmars-d
On Saturday, 3 February 2018 at 08:18:57 UTC, H. S. Teoh wrote: On Fri, Feb 02, 2018 at 08:16:25PM -0800, Walter Bright via Digitalmars-d wrote: On 2/2/2018 7:06 AM, Benny wrote: > Other languages have slogans, they have selling points. > > When i hear Go, you hear uniformal, fast, simple

Re: Annoyance with new integer promotion deprecations

2018-02-05 Thread Rubn via Digitalmars-d
On Tuesday, 6 February 2018 at 01:07:21 UTC, Meta wrote: On Tuesday, 6 February 2018 at 00:18:08 UTC, Jonathan M Davis wrote: On Monday, February 05, 2018 15:27:45 H. S. Teoh via Digitalmars-d wrote: On Mon, Feb 05, 2018 at 01:56:33PM -0800, Walter Bright via Digitalmars-d wrote: > The idea

Re: A betterC base

2018-02-08 Thread Rubn via Digitalmars-d
On Thursday, 8 February 2018 at 18:06:38 UTC, Walter Bright wrote: I.e. it isn't an issue of us D guys being dumb about the GC. So you could say it's a design flaw of D, attempting to use a GC where it isn't suited? If going malloc didnt lose you a bunch of features and bring a bunch of

Re: My choice to pick Go over D ( and Rust ), mostly non-technical

2018-02-03 Thread Rubn via Digitalmars-d
On Saturday, 3 February 2018 at 23:07:30 UTC, Norm wrote: On Saturday, 3 February 2018 at 15:22:37 UTC, Rubn wrote: On Saturday, 3 February 2018 at 08:18:57 UTC, H. S. Teoh wrote: On Fri, Feb 02, 2018 at 08:16:25PM -0800, Walter Bright via Digitalmars-d wrote: On 2/2/2018 7:06 AM, Benny

Re: A betterC base

2018-02-09 Thread Rubn via Digitalmars-d
On Friday, 9 February 2018 at 02:09:57 UTC, Jonathan M Davis wrote: On Thursday, February 08, 2018 23:57:45 Rubn via Digitalmars-d wrote: On Thursday, 8 February 2018 at 18:06:38 UTC, Walter Bright wrote: > I.e. it isn't an issue of us D guys being dumb about the GC. So you could say i

Re: Vulkan

2018-02-16 Thread Rubn via Digitalmars-d
On Friday, 16 February 2018 at 22:58:30 UTC, Ivan Trombley wrote: On Wednesday, 14 February 2018 at 02:40:18 UTC, Mike Parker wrote: What [does] it mean to say they don't work? Have you reported any issues? I don't see any in the DerelictVulkan repo. If something's broken, please report it so

Re: Slow code, slow

2018-02-23 Thread Rubn via Digitalmars-d
On Friday, 23 February 2018 at 20:52:47 UTC, H. S. Teoh wrote: On Fri, Feb 23, 2018 at 08:35:44PM +, Rubn via Digitalmars-d wrote: [...] It's not that big of a slow down. Using "fast" you don't import any modules so they never have to be parsed. That's pretty much all of phobos

Re: Slow code, slow

2018-02-23 Thread Rubn via Digitalmars-d
On Friday, 23 February 2018 at 21:10:25 UTC, H. S. Teoh wrote: On Fri, Feb 23, 2018 at 08:51:20PM +, Rubn via Digitalmars-d wrote: [...] This slowdown for this specific example isn't cause by templates, it's caused by having to parse all the extra lines of code from phobos. I didn't say

Re: Slow code, slow

2018-02-23 Thread Rubn via Digitalmars-d
On Friday, 23 February 2018 at 20:15:12 UTC, H. S. Teoh wrote: Now that I got your attention: https://issues.dlang.org/show_bug.cgi?id=18511 tl;dr: A trivial piece of code, written as ostensibly "idiomatic D" with std.algorithm and std.range templates, compiles *an order of

Re: Slow code, slow

2018-02-23 Thread Rubn via Digitalmars-d
On Friday, 23 February 2018 at 20:41:17 UTC, bauss wrote: On Friday, 23 February 2018 at 20:35:44 UTC, Rubn wrote: On Friday, 23 February 2018 at 20:15:12 UTC, H. S. Teoh wrote: Now that I got your attention: https://issues.dlang.org/show_bug.cgi?id=18511 tl;dr: A trivial piece of

Re: Is there any good reason why C++ namespaces are "closed" in D?

2018-08-02 Thread Rubn via Digitalmars-d
On Thursday, 2 August 2018 at 04:59:52 UTC, Walter Bright wrote: On 8/1/2018 7:09 PM, Rubn wrote: On Wednesday, 1 August 2018 at 23:04:01 UTC, Walter Bright wrote: An example of silent hijacking:    extern (C++, "ab") void foo(long); // original code    ... lots of code ...    extern (C++,

Re: Is there any good reason why C++ namespaces are "closed" in D?

2018-07-31 Thread Rubn via Digitalmars-d
On Tuesday, 31 July 2018 at 16:23:55 UTC, Manu wrote: On Tue., 31 Jul. 2018, 3:40 am Jacob Carlborg via Digitalmars-d, < digitalmars-d@puremagic.com> wrote: On 2018-07-31 10:12, Manu wrote: > Given your favourite example: > > module a; > extern(C++, ns) void foo(); > > module b; >

Re: Is there any good reason why C++ namespaces are "closed" in D?

2018-08-03 Thread Rubn via Digitalmars-d
On Friday, 3 August 2018 at 21:20:37 UTC, Walter Bright wrote: On 8/2/2018 2:26 AM, Daniel N wrote: Personally I would never *bind* to two different namespaces in a single file, You'd be amazed at what people do and then set their entire store based on it. If the language spec allows it,

Re: Is there any good reason why C++ namespaces are "closed" in D?

2018-08-01 Thread Rubn via Digitalmars-d
On Wednesday, 1 August 2018 at 23:04:01 UTC, Walter Bright wrote: An example of silent hijacking: extern (C++, "ab") void foo(long); // original code ... lots of code ... extern (C++, "cd") void foo(int); // added later by intern, should have been

Re: implicit construction operator

2018-02-27 Thread Rubn via Digitalmars-d
On Monday, 26 February 2018 at 19:32:44 UTC, ketmar wrote: WebFreak001 wrote: Now before you would have only been able to do this: --- Nullable!Foo a; foo(a, Nullable!int(5)); --- but now you should also be able to do: --- Nullable!Foo x = null; Nullable!Foo y = 5; foo(null, 5); please

Re: rvalues -> ref (yup... again!)

2018-03-26 Thread Rubn via Digitalmars-d
On Monday, 26 March 2018 at 14:40:03 UTC, Atila Neves wrote: C++ T&& (Rvalue reference) -> D T Not really, in C++ it is an actual reference and you get to choose which function actually does the move. In D it just does the copy when passed to the function. So you can't do this in D. void

Re: rvalues -> ref (yup... again!)

2018-03-27 Thread Rubn via Digitalmars-d
On Tuesday, 27 March 2018 at 23:35:44 UTC, kinke wrote: On Tuesday, 27 March 2018 at 21:52:25 UTC, Rubn wrote: It happens with LDC too, not sure how it would be able to know to do any kind of optimization like that unless it was able to inline every single function called into one function and

Re: rvalues -> ref (yup... again!)

2018-03-27 Thread Rubn via Digitalmars-d
On Wednesday, 28 March 2018 at 00:56:29 UTC, kinke wrote: On Tuesday, 27 March 2018 at 23:59:09 UTC, Rubn wrote: Just adding a few writeln it isn't able to remove the function entirely anymore and can't optimize it out. Well writeln() here involves number -> string formatting, GC, I/O,

Re: #dbugfix Issue 16486 200$

2018-03-30 Thread Rubn via Digitalmars-d
On Friday, 30 March 2018 at 06:11:22 UTC, 9il wrote: Hello, Bugfix for the Issue 16486 [1] (originally [2]) is required for mir-algorithm types [3], [4]. For example, packed triangular matrix can be represented as Slice!(Contiguous, [1], StairsIterator!(T*)) Slice!(Contiguous, [1],

Re: rvalues -> ref (yup... again!)

2018-03-29 Thread Rubn via Digitalmars-d
On Thursday, 29 March 2018 at 19:11:30 UTC, Dgame wrote: Just to be sure it does not got los: You know that you can avoid the temp/copy if you add one method to your struct, yes? import std.stdio; struct Big { string name; float[1000] values; this(string name) {

Re: rvalues -> ref (yup... again!)

2018-03-24 Thread Rubn via Digitalmars-d
On Saturday, 24 March 2018 at 23:03:36 UTC, John Colvin wrote: Auto ref allows the unnecessary copy to be avoided for lvalues and creates a temporary (as part of passing the value) for rvalues. It has downsides (virtual functions and extern(C++), but it does directly address the problem you're

Re: rvalues -> ref (yup... again!)

2018-03-24 Thread Rubn via Digitalmars-d
On Saturday, 24 March 2018 at 11:57:25 UTC, John Colvin wrote: I understand what you want, but I'm struggling to understand why it's such a huge deal. The reason you want to pass by reference is for performance, to avoid copying the data at the call boundary. It's pretty simple: float

Re: rvalues -> ref (yup... again!)

2018-03-24 Thread Rubn via Digitalmars-d
On Saturday, 24 March 2018 at 23:03:36 UTC, John Colvin wrote: Here is a small proof of concept I made to demonstrate how easy it seems to be to use `auto ref` to call a C++ virtual const& function without incurring any more copies than would happen with the same calls from C++. I'm sure it

Re: rvalues -> ref (yup... again!)

2018-03-24 Thread Rubn via Digitalmars-d
On Sunday, 25 March 2018 at 01:43:43 UTC, Jonathan M Davis wrote: On Sunday, March 25, 2018 00:34:38 Rubn via Digitalmars-d wrote: On Saturday, 24 March 2018 at 23:03:36 UTC, John Colvin wrote: > Auto ref allows the unnecessary copy to be avoided for > lvalues and creates a temporary (a

Re: Am I reading this wrong, or is std.getopt *really* this stupid?

2018-03-25 Thread Rubn via Digitalmars-d
On Sunday, 25 March 2018 at 09:27:31 UTC, Walter Bright wrote: On 3/23/2018 10:55 PM, Chris Katko wrote: Last question though, is there any kind of list of features, and minor features and fixes that can or need to be done? Perhaps it already exists, And here it is: https://issues.dlang.org/

Re: Binding rvalues to ref parameters

2018-03-25 Thread Rubn via Digitalmars-d
On Saturday, 24 March 2018 at 12:51:07 UTC, Andrei Alexandrescu wrote: Filing a DIP is like filing a police report: once it's in the system, we're obligated to work on it. There's a guarantee of a response. https://wiki.dlang.org/DIP36 Guess there's no point in writing another one then is

Re: D compiles fast, right? Right??

2018-04-03 Thread Rubn via Digitalmars-d
On Tuesday, 3 April 2018 at 19:07:54 UTC, Jonathan Marler wrote: On Tuesday, 3 April 2018 at 10:24:15 UTC, Atila Neves wrote: On Monday, 2 April 2018 at 18:52:14 UTC, Jonathan Marler wrote: My point was that if you want to compare "compile-time" performance, you should not include the

Re: rvalues -> ref (yup... again!)

2018-03-29 Thread Rubn via Digitalmars-d
On Thursday, 29 March 2018 at 20:22:47 UTC, Dgame wrote: On Thursday, 29 March 2018 at 20:05:48 UTC, Rubn wrote: On Thursday, 29 March 2018 at 19:11:30 UTC, Dgame wrote: Just to be sure it does not got los: You know that you can avoid the temp/copy if you add one method to your struct, yes?

Re: rvalues -> ref (yup... again!)

2018-03-27 Thread Rubn via Digitalmars-d
On Tuesday, 27 March 2018 at 07:33:12 UTC, Atila Neves wrote: On Tuesday, 27 March 2018 at 00:30:24 UTC, Rubn wrote: On Monday, 26 March 2018 at 14:40:03 UTC, Atila Neves wrote: C++ T&& (Rvalue reference) -> D T Not really, in C++ it is an actual reference and you get to choose which

Re: rvalues -> ref (yup... again!)

2018-03-27 Thread Rubn via Digitalmars-d
On Tuesday, 27 March 2018 at 15:50:37 UTC, Atila Neves wrote: It's fine for references to just be references in D. We're not struggling to make references move-able in D, that's not a thing, we already have move semantics. Any extension of this conversation about references into C++

Re: rvalues -> ref (yup... again!)

2018-03-26 Thread Rubn via Digitalmars-d
On Monday, 26 March 2018 at 22:48:38 UTC, Walter Bright wrote: On 3/26/2018 12:24 PM, Manu wrote: On 26 March 2018 at 07:40, Atila Neves via Digitalmars-d C++ const T& -> D T Yeah, no... T may be big. Copying a large thing sucks. Memory copying is the slowest thing computers can do. As an

Re: Binding rvalues to ref parameters

2018-03-25 Thread Rubn via Digitalmars-d
On Sunday, 25 March 2018 at 14:28:30 UTC, Andrei Alexandrescu wrote: On 3/25/18 9:40 AM, Rubn wrote: On Saturday, 24 March 2018 at 12:51:07 UTC, Andrei Alexandrescu wrote: Filing a DIP is like filing a police report: once it's in the system, we're obligated to work on it. There's a guarantee

Re: rvalues -> ref (yup... again!)

2018-03-27 Thread Rubn via Digitalmars-d
On Tuesday, 27 March 2018 at 20:38:35 UTC, H. S. Teoh wrote: On Tue, Mar 27, 2018 at 08:25:36PM +, Rubn via Digitalmars-d wrote: [...] _D7example__T3fooTSQr3FooZQnFNbNiNfQrZv: push rbp mov rbp, rsp sub rsp, 3104 lea rax, [rbp + 16] lea rdi, [rbp - 2048] lea rcx, [rbp - 1024

Re: CTFE ^^ (pow)

2018-03-18 Thread Rubn via Digitalmars-d
On Sunday, 18 March 2018 at 04:37:32 UTC, ketmar wrote: Manu wrote: What is so hard about implementing a pow intrinsic that CTFE can use? It's ridiculous that we can't CTFE any non-linear function... It's one of those blocker bugs that's been there almost 10 years. nobody bothered. it is

Re: #dbugfix Issue 5710

2018-03-19 Thread Rubn via Digitalmars-d
On Tuesday, 20 March 2018 at 00:00:22 UTC, ciechowoj wrote: Digging out and old yet important issue. That's one of those bugs that even if a solution gets implemented, it won't get accepted and pulled in. Soweone up top needs to figure out how they want it to be implemented in an acceptable

Re: phobo's std.file is completely broke!

2018-09-15 Thread Rubn via Digitalmars-d
On Saturday, 15 September 2018 at 12:59:25 UTC, Josphe Brigmo wrote: This is the typical mindset with D. There are all these "minor" problems that people(the D community pretends are all that big a deal but when you couple all these problems together it results in a very unpleasant programming

Re: Funding for code-d/serve-d

2018-05-05 Thread Rubn via Digitalmars-d-announce
On Saturday, 5 May 2018 at 11:21:29 UTC, Mike Parker wrote: This morning at the Hackathon I announced that the D Foundation is raising money for code-d/serve-d, the plugin for Visual Studio Code and its companion Microsoft Language Server Protocol implementation for D. We've set up a goal of

Re: C++ / const class pointer signature / unable to find correct D syntax

2018-05-06 Thread Rubn via Digitalmars-d-learn
On Friday, 4 May 2018 at 07:57:26 UTC, Uknown wrote: On Friday, 4 May 2018 at 07:49:02 UTC, Robert M. Münch wrote: I have a static C++ and can't make it to get a correct binding for one function: DMD: public: unsigned int __cdecl b2d::Context2D::_begin(class b2d::Image & __ptr64,class

Re: UFCS syntax I never saw before.

2018-05-21 Thread Rubn via Digitalmars-d-learn
On Monday, 21 May 2018 at 11:38:12 UTC, SrMordred wrote: After all this time I saw this: writeln = iota = 5; what?? I never saw that before! This is interesting, there is something useful that i can do with this kind of call? I probably wouldn't use that. That wasn't what it was intended

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); }

Re: New integer promotion rules

2018-01-17 Thread Rubn via Digitalmars-d-learn
On Wednesday, 17 January 2018 at 20:30:07 UTC, rumbu wrote: And here is why is bothering me: auto max = isNegative ? cast(Unsigned!T)(-T.min) : cast(Unsigned!T)T.max); The generic code above (which worked for all signed integral types T in 2.077) must be rewritten like this in 2.078:

Re: New integer promotion rules

2018-01-17 Thread Rubn via Digitalmars-d-learn
On Wednesday, 17 January 2018 at 22:30:11 UTC, rumbu wrote: code like "m = n < 0 ? -n : n" doesn't worth a wrapper That code is worth a wrapper, it's called "abs"... m = abs(n);

Union Initialization

2018-01-30 Thread Rubn via Digitalmars-d-learn
Is there any way to initialize an array of unions with more than just the first union type? struct A { float a; } struct B { uint b; } union Test { A a; B b; } Test[2] test = [ Test(A(1.0f)), Test(B(10)), // ERROR ]; AFAIK there's no way to specify to use D with an

Re: Setting up DMD on windows

2018-02-04 Thread Rubn via Digitalmars-d-learn
On Sunday, 4 February 2018 at 01:33:05 UTC, Seb wrote: On Sunday, 4 February 2018 at 01:23:50 UTC, Rubn wrote: On Saturday, 3 February 2018 at 23:42:28 UTC, welkam wrote: [...] I think you have to build with an old version of MSVC, 2010 maybe? It's been a while since I built it I don't

Re: Setting up DMD on windows

2018-02-03 Thread Rubn via Digitalmars-d-learn
On Saturday, 3 February 2018 at 23:42:28 UTC, welkam wrote: Tried to use DMD compiler that I built from source by following these instructions https://wiki.dlang.org/Building_under_Windows They are outdated but I managed to compile it but I get this error when I tried to compile some code.

Re: Beta 2.079.0

2018-02-22 Thread Rubn via Digitalmars-d-announce
On Friday, 23 February 2018 at 00:05:59 UTC, Martin Nowak wrote: - each imported module should be on it's own line That's your opinion, my opinion is that importing 6 symbols from 6 different modules for a tiny cli tool sucks and bloats code example. So the alternative is to not use

Re: Are there any working instructions about how to build and test dmd on Windows?

2018-03-13 Thread Rubn via Digitalmars-d-learn
Yah it's not fun. Some notes: You might need to set MSVC_CC environment variable cause it doesn't use the right format for VS path, depending on your version. https://github.com/dlang/dmd/blob/v2.079.0/src/vcbuild/msvc-dmc.d#L19 You could open a command prompt with the batch file running

Re: Declare and Define Before Use? [rant]

2018-04-04 Thread Rubn via Digitalmars-d-learn
On Wednesday, 4 April 2018 at 20:01:55 UTC, Ali wrote: On Wednesday, 4 April 2018 at 19:51:27 UTC, kdevel wrote: On Wednesday, 4 April 2018 at 19:19:30 UTC, Ali wrote: BTW: You can't write void main () { x.writeln; int x; } import std.stdio; This is because x is not

Add property-like Function to Type ?

2018-04-24 Thread Rubn via Digitalmars-d-learn
I was wondering if I could create my own property in a way that can be used the same way as something like "T.sizeof". Right now I have the following to replace length: uint length32(T)(T[] array) { return cast(uint)array.length; } I want something similar to be able to do the following:

Re: Fast GC allocation of many small objects

2018-03-31 Thread Rubn via Digitalmars-d-learn
On Friday, 30 March 2018 at 20:46:43 UTC, Per Nordlöw wrote: On Friday, 30 March 2018 at 20:38:35 UTC, rikki cattermole wrote: Use a custom allocator (that could be backed by the GC) using std.experimental.allocators :) https://dlang.org/phobos/std_experimental_allocator.html is massive. I

Re: User Stories: Funkwerk

2018-03-16 Thread Rubn via Digitalmars-d-announce
On Wednesday, 14 March 2018 at 14:17:50 UTC, Mike Parker wrote: foreach(auto element: elements) ":" is C++ syntax

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Rubn via Digitalmars-d-announce
On Monday, 12 November 2018 at 22:07:39 UTC, Walter Bright wrote: One could have be treated as "better than" , and it sounds like a good idea, but even C++, not known for simplicity, tried that and had to abandon it as nobody could figure it out once the code examples got beyond trivial

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-13 Thread Rubn via Digitalmars-d-announce
On Monday, 12 November 2018 at 22:07:39 UTC, Walter Bright wrote: On 11/12/2018 12:34 PM, Neia Neutuladh wrote: Tell me more about this "consistency". int f(short s) { return 1; } int f(int i) { return 2; } enum : int { a = 0 } enum A : int { a = 0 } pragma (msg, f(a)); // calls f(int)

Re: DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

2018-11-14 Thread Rubn via Digitalmars-d-announce
On Wednesday, 14 November 2018 at 02:45:38 UTC, Walter Bright wrote: On 11/13/2018 3:29 PM, Rubn wrote: > enum A : int { a = 127 } `a` is a manifest constant of type `A` with a value of `127`. Remember that `A` is not an `int`. It is implicitly convertible to an integer type that its value

Re: Forward declaration inside Function block, no error?

2019-01-06 Thread Rubn via Digitalmars-d-learn
On Sunday, 6 January 2019 at 18:38:44 UTC, Benjamin Thaut wrote: Today I found a bug in my D code. import std.stdio; // Type your code here, or load an example. void grow() { writeln("grow"); } void someFunc(bool condition) { if(condition) { void grow(); } } I tried

Re: Am I misusing with?

2019-01-19 Thread Rubn via Digitalmars-d-learn
On Saturday, 19 January 2019 at 17:49:31 UTC, faissaloo wrote: This seems to work fine file = File("test.txt", "r"); with (file) { scope(exit) close(); foreach (string line; file.lines()) { line_array ~= line; } } however: file =

Re: How to initialize a globle variable nicely and properly?

2018-12-14 Thread Rubn via Digitalmars-d-learn
On Saturday, 15 December 2018 at 02:54:55 UTC, Heromyth wrote: We have a module including many globle variables which are needed to be initialized firstly in "shared static this() {}", see here https://github.com/huntlabs/hunt/blob/master/source/hunt/time/Init.d. The problem is that these

Re: DConf 2019: Shepherd's Pie Edition

2018-12-23 Thread Rubn via Digitalmars-d-announce
On Sunday, 23 December 2018 at 10:07:40 UTC, Walter Bright wrote: BTW, another point for the presentations is that we cover the air fare and hotel expenses for the presenters. Quite a lot of people have been able to attend because of this. It's our way of giving a little bit back to strong

Re: difficulties with const structs and alias this / template functions

2018-11-18 Thread Rubn via Digitalmars-d-learn
On Sunday, 18 November 2018 at 17:30:18 UTC, Dennis wrote: I'm making a fixed point numeric type and want it to work correctly with const. First problem: ``` const q16 a = 6; a /= 2; // compiles! despite `a` being const. writeln(a); // still 6 a.toQ32 /= 2;// what's actually

Re: Blog post: What D got wrong

2018-12-19 Thread Rubn via Digitalmars-d-announce
On Wednesday, 19 December 2018 at 19:58:53 UTC, Neia Neutuladh wrote: On Wed, 19 Dec 2018 17:28:01 +, Vijay Nayar wrote: Could you please elaborate a little bit more on this? In the linked program, I had expected that "ref" would return a reference to "a" that would behave similar to a

Re: DIP 1016--ref T accepts r-values--Formal Assessment

2019-01-24 Thread Rubn via Digitalmars-d-announce
On Thursday, 24 January 2019 at 09:24:19 UTC, Nicholas Wilson wrote: On Thursday, 24 January 2019 at 07:18:58 UTC, Mike Parker wrote: Walter and Andrei have declined to accept DIP 1016, "ref T accepts r-values", on the grounds that it has two fundamental flaws that would open holes in the

Re: DIP 1016--ref T accepts r-values--Formal Assessment

2019-01-24 Thread Rubn via Digitalmars-d-announce
On Thursday, 24 January 2019 at 23:18:11 UTC, kinke wrote: Proposed `out` semantics: --- void increment(out long value) { ++value; } increment(out value); --- vs. pointer version with current `out` semantics: --- void increment(long* pValue) { ++(*pValue); } increment(); --- The pointer

Re: DIP 1016--ref T accepts r-values--Formal Assessment

2019-01-24 Thread Rubn via Digitalmars-d-announce
On Thursday, 24 January 2019 at 20:01:45 UTC, kinke wrote: On Thursday, 24 January 2019 at 09:49:14 UTC, Manu wrote: We discussed and concluded that one mechanism to mitigate this issue was already readily available, and it's just that 'out' gains a much greater sense of identity (which is

Re: DIP 1016--ref T accepts r-values--Formal Assessment

2019-01-26 Thread Rubn via Digitalmars-d-announce
On Saturday, 26 January 2019 at 06:15:22 UTC, Walter Bright wrote: On 1/25/2019 7:44 PM, Manu wrote: I never said anything about 'rvalue references', The DIP mentions them several times in the "forum threads" section. I see you want to distinguish the DIP from that; I recommend a section

Re: Using const to Enforce Design Decisions

2019-03-25 Thread Rubn via Digitalmars-d-announce
On Monday, 25 March 2019 at 13:00:07 UTC, Mike Parker wrote: Marco de Wild has penned a tutorial on D's const for the D blog. He gives an overview of the feature, how it differs from C++, and shows how he employed it in his mahjong game. The blog:

Re: How to pass variables to string mixins?

2019-02-25 Thread Rubn via Digitalmars-d-learn
On Tuesday, 26 February 2019 at 00:07:54 UTC, Victor Porton wrote: I want to create a string mixin based on a supplementary variable (name2 below): Let we have something like: mixin template X(string name) { immutable string name2 = '_' ~ name; mixin("struct " ~ name2 ~ "{ int i; }"); }

Re: DIP 1016 should use expression lowering, not statement lowering

2019-01-29 Thread Rubn via Digitalmars-d-announce
On Tuesday, 29 January 2019 at 15:44:02 UTC, Nicholas Wilson wrote: On Tuesday, 29 January 2019 at 11:52:40 UTC, Andrei Alexandrescu wrote: While writing this example: int[] a = cast(int[]) alloc.allocate(100 * int.sizeof); if (alloc.reallocate(a, 200 * int.sizeof)) { assert(a.length ==

Re: DIP 1016--ref T accepts r-values--Formal Assessment

2019-01-25 Thread Rubn via Digitalmars-d-announce
On Friday, 25 January 2019 at 11:56:58 UTC, Walter Bright wrote: On 1/24/2019 11:53 PM, Nicholas Wilson wrote: That the conflation of pass by reference to avoid copying and mutation is not only deliberate but also mitigated by @disable. The first oddity about @disable is it is attached to the

Re: DIP 1016--ref T accepts r-values--Formal Assessment

2019-01-31 Thread Rubn via Digitalmars-d-announce
On Thursday, 31 January 2019 at 22:00:10 UTC, Walter Bright wrote: On 1/31/2019 1:46 PM, Andrei Alexandrescu wrote: The proposal could actually disallow rvalues that have lvalue syntax, such as "symbol", "symbol[expr]", "symbol.symbol", "symbol.symbol[expr]", etc. Ugh. Gets hairy quickly.

Re: Static struct?

2019-04-24 Thread Rubn via Digitalmars-d-learn
On Wednesday, 24 April 2019 at 21:12:10 UTC, JN wrote: I noticed a construct I haven't seen before in D when reading the description for automem - https://github.com/atilaneves/automem static struct Point { int x; int y; } What does "static" do in this case? How does it