Re: C++ Expected converted to idiomatic D

2018-08-27 Thread Paul Backus via Digitalmars-d
On Thursday, 16 August 2018 at 20:37:33 UTC, Per Nordlöw wrote: In https://www.youtube.com/watch?v=nVzgkepAg5Y Andrei describes his proposal for STL `Expected` planned to be included in C++20. Have anybody converted the C++ proposal to idiomatic D, yet? Hopefully without the pointer-legacy

Re: concurrency call to arms

2018-08-27 Thread John Belmonte via Digitalmars-d
On Wednesday, 22 August 2018 at 16:49:01 UTC, Russel Winder wrote: Have you tried asyncio in the Python standard library? Is Trio better? The library that Guido admits is a disaster? https://twitter.com/gvanrossum/status/938445451908472832 Trio and libraries like it have evolved out of

[Issue 17638] A pragma inside a function body is seen as a statement

2018-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17638 --- Comment #3 from Nicholas Wilson --- void main(){ pragma(mangle, "aaa") __gshared int a = 1; // Is a declaration, incorrectly marked as a pragma statement. } see issue 19149. --

[Issue 17638] A pragma inside a function body is seen as a statement

2018-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17638 Nicholas Wilson changed: What|Removed |Added CC||iamthewilsona...@hotmail.co

[Issue 19149] pragma(mangle, "...") does not work for function local __gshared variables

2018-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19149 Nicholas Wilson changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Issue 19149] pragma(mangle, "...") does not work for function local __gshared variables

2018-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19149 --- Comment #1 from Nicholas Wilson --- duplicate of https://issues.dlang.org/show_bug.cgi?id=17638 --

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread tide via Digitalmars-d
On Tuesday, 28 August 2018 at 01:11:14 UTC, Walter Bright wrote: On 8/27/2018 10:08 AM, H. S. Teoh wrote: Const in D makes sense as-is. Though, granted, its infectiousness means its scope is actually very narrow, and as a result, we ironically can't use it in very many places, and so its

Re: Null-Coalescing Operator and Extensions

2018-08-27 Thread Basile B. via Digitalmars-d-learn
On Monday, 27 August 2018 at 14:59:20 UTC, SG wrote: On Monday, 27 August 2018 at 07:59:17 UTC, Simen Kjærås wrote: That's the null propagation operator (?.). What SG asked for is the null-coalescing operator (??). Of course, this can also be implemented in D (albeit with a slight more

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread Walter Bright via Digitalmars-d
On 8/27/2018 10:08 AM, H. S. Teoh wrote: Const in D makes sense as-is. Though, granted, its infectiousness means its scope is actually very narrow, and as a result, we ironically can't use it in very many places, and so its touted benefits only rarely apply. :-( Which also means that it's

Re: D is dead

2018-08-27 Thread Jonathan M Davis via Digitalmars-d
On Saturday, August 25, 2018 2:16:16 PM MDT Walter Bright via Digitalmars-d wrote: > On 8/25/2018 7:37 AM, Jonathan M Davis wrote: > > In general, any place where D was > > designed around the idea that something would _always_ be there (e.g. > > init values and default initialization) but we've

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread Sjoerd Nijboer via Digitalmars-d
On Monday, 27 August 2018 at 21:34:53 UTC, RhyS wrote: My question becomes, how is it possible that D supposedly only has a income of 3.2K ( opencollective ). Well, one could aquire grants from Mozila through MOSS or The Linux Foundation for development. One could market D as the very next

[Issue 19192] DMD generates invalid code for covariants for some interface <- abstract class <- class hierarchies

2018-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19192 Puneet Goel changed: What|Removed |Added Summary|DMD generates invalid code |DMD generates invalid code

Re: Distribute debug information so I can get informative stack traces?

2018-08-27 Thread spikespaz via Digitalmars-d
On Monday, 27 August 2018 at 22:46:31 UTC, tide wrote: On Monday, 27 August 2018 at 22:37:53 UTC, spikespaz wrote: I am compiling my project's executables with `-g`, so it outputs `pdb` files. I read that this is necessary to get a useful stack trace. When a user reports an issue, my program

Re: Distribute debug information so I can get informative stack traces?

2018-08-27 Thread tide via Digitalmars-d
On Monday, 27 August 2018 at 22:37:53 UTC, spikespaz wrote: I am compiling my project's executables with `-g`, so it outputs `pdb` files. I read that this is necessary to get a useful stack trace. When a user reports an issue, my program gives them a link where the issue body is pre-filled

[Issue 19192] DMD generates invalid code for covariants involving template classes

2018-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19192 ag0aep6g changed: What|Removed |Added Keywords||wrong-code CC|

Distribute debug information so I can get informative stack traces?

2018-08-27 Thread spikespaz via Digitalmars-d
I am compiling my project's executables with `-g`, so it outputs `pdb` files. I read that this is necessary to get a useful stack trace. When a user reports an issue, my program gives them a link where the issue body is pre-filled with the crash exception information. Example:

[Issue 1197] "static if" + enum.max/enum.min doesn't compile (D1 only)

2018-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=1197 ag0aep6g changed: What|Removed |Added Status|RESOLVED|REOPENED CC|

[Issue 340] [Tracker] Forward reference bugs and other order-of-declaration issues

2018-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=340 Issue 340 depends on issue 1197, which changed state. Issue 1197 Summary: "static if" + enum.max/enum.min doesn't compile (D1 only) https://issues.dlang.org/show_bug.cgi?id=1197 What|Removed |Added

Re: Is there a simple way to check if value is null for every case?

2018-08-27 Thread Alex via Digitalmars-d-learn
On Monday, 27 August 2018 at 19:36:29 UTC, aliak wrote: Then Nullable!(int*) would be the same as int*. Or even better maybe is to give a compiler error when you try and stuff a nullable type inside a Nullable. Because ... why? Isn't it arguable, whether this is desired? I mean, in the

Re: Looking for a mentor for SAoC

2018-08-27 Thread David Nadlinger via Digitalmars-d
On Monday, 27 August 2018 at 20:47:08 UTC, Stefam Koch wrote: generating it is not the problem but linking it on windows currently requires the MS linker. Is that true, though? DMD ships with LLD these days. — David

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread RhyS via Digitalmars-d
On Monday, 27 August 2018 at 18:20:04 UTC, Chris wrote: Then the D Foundation should work on it. Get companies on board etc. All I hear is "we don't have enough money, we depend on the good will of our community members..." Then leave it. There's no way D can compete with languages that are

Re: Looking for a mentor for SAoC

2018-08-27 Thread Stefam Koch via Digitalmars-d
On Sunday, 26 August 2018 at 16:47:47 UTC, solidstate1991 wrote: I've chosen to work on Mago, with the following goals: -Porting it to D first and foremost to make code maintenance and expansion easier in the future. -Add better support for Win32-COFF (there's a few more bugs compared to

Re: GDC with D frontend 2.081.2

2018-08-27 Thread Arun Chandrasekaran via Digitalmars-d-announce
On Monday, 27 August 2018 at 20:03:28 UTC, Iain Buclaw wrote: On 27 August 2018 at 20:59, Arun Chandrasekaran via Digitalmars-d-announce wrote: On Monday, 27 August 2018 at 17:44:01 UTC, Iain Buclaw wrote: On 27 August 2018 at 19:23, Arun Chandrasekaran via Digitalmars-d-announce wrote:

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread Ali via Digitalmars-d
On Monday, 27 August 2018 at 19:51:52 UTC, 12345swordy wrote: On Monday, 27 August 2018 at 18:20:04 UTC, Chris wrote: Then the D Foundation should work on it. Easier said then done. You can't go around demanding people to build factories without addressing the issues that comes with building

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread Chris via Digitalmars-d
On Monday, 27 August 2018 at 19:51:52 UTC, 12345swordy wrote: On Monday, 27 August 2018 at 18:20:04 UTC, Chris wrote: Then the D Foundation should work on it. Easier said then done. You can't go around demanding people to build factories without addressing the issues that comes with building

Re: GDC with D frontend 2.081.2

2018-08-27 Thread Iain Buclaw via Digitalmars-d-announce
On 27 August 2018 at 20:59, Anonymouse via Digitalmars-d-announce wrote: > On Monday, 27 August 2018 at 17:44:01 UTC, Iain Buclaw wrote: >> >> Raise a bug then? >> >> Iain. > > > How are we supposed to file GDC bugs when bugzilla account creation is > restricted? I even emailed you about it back

Re: Can passing an address of this to a non-copyable object be made trusted? - i.e. can I disable moving?

2018-08-27 Thread aliak via Digitalmars-d-learn
On Monday, 27 August 2018 at 00:15:18 UTC, Jonathan M Davis wrote: On Sunday, August 26, 2018 5:10:29 PM MDT Nicholas Wilson via So, soon™? Bah humbug. Was afraid of this :p Yeah. Hopefully, we're able to disable moving at some point in the near future. However, right now, it's definitely

Re: GDC with D frontend 2.081.2

2018-08-27 Thread Iain Buclaw via Digitalmars-d-announce
On 27 August 2018 at 20:59, Arun Chandrasekaran via Digitalmars-d-announce wrote: > On Monday, 27 August 2018 at 17:44:01 UTC, Iain Buclaw wrote: >> >> On 27 August 2018 at 19:23, Arun Chandrasekaran via Digitalmars-d-announce >> wrote: >>> >>> [...] >> >> >> Version print information is managed

Re: Optional and NotNull version 0.5.0 - swift optional like and scala option like

2018-08-27 Thread aliak via Digitalmars-d-announce
On Monday, 27 August 2018 at 05:22:30 UTC, FeepingCreature wrote: - Consider a short form for "dispatch". Purely for convenience: e.g.: john.d.residence.d.numberOfRooms; Why not .get, like Nullable? As long as you never alias it to this... ;) Mmm... get is indicative of getting the value.

[Issue 19199] Use core.bitops intrinsics during CTFE

2018-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19199 --- Comment #1 from Nathan S. --- Pull request: https://github.com/dlang/dmd/pull/8627 --

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread 12345swordy via Digitalmars-d
On Monday, 27 August 2018 at 18:20:04 UTC, Chris wrote: Then the D Foundation should work on it. Easier said then done. You can't go around demanding people to build factories without addressing the issues that comes with building factories, such as the big question of how is it going to be

[Issue 19199] New: Use core.bitops intrinsics during CTFE

2018-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19199 Issue ID: 19199 Summary: Use core.bitops intrinsics during CTFE Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement

Re: Is there a simple way to check if value is null for every case?

2018-08-27 Thread aliak via Digitalmars-d-learn
On Monday, 27 August 2018 at 14:11:32 UTC, SG wrote: On Monday, 27 August 2018 at 13:02:28 UTC, rikki cattermole wrote: So Nullable in D and C# is basically the same except C#'s has language support. The big difference is that in there I could do: int? i = null; string j = null; var

Re: GDC with D frontend 2.081.2

2018-08-27 Thread Arun Chandrasekaran via Digitalmars-d-announce
On Monday, 27 August 2018 at 17:44:01 UTC, Iain Buclaw wrote: On 27 August 2018 at 19:23, Arun Chandrasekaran via Digitalmars-d-announce wrote: [...] Version print information is managed outside of gdc. You can get this from __VERSION__ or output of -v [...] Ask dub maintainers why.

Re: GDC with D frontend 2.081.2

2018-08-27 Thread Anonymouse via Digitalmars-d-announce
On Monday, 27 August 2018 at 17:44:01 UTC, Iain Buclaw wrote: Raise a bug then? Iain. How are we supposed to file GDC bugs when bugzilla account creation is restricted? I even emailed you about it back in May, but I imagine I was filtered as spam.

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread Chris via Digitalmars-d
On Monday, 27 August 2018 at 18:02:21 UTC, 12345swordy wrote: On Monday, 27 August 2018 at 16:32:15 UTC, Joakim wrote: On Monday, 27 August 2018 at 16:15:37 UTC, 12345swordy wrote: On Monday, 27 August 2018 at 14:26:08 UTC, Chris wrote: On Monday, 27 August 2018 at 13:48:42 UTC, 12345swordy

Re: How to pass alias as template parameter?

2018-08-27 Thread Everlast via Digitalmars-d-learn
On Monday, 27 August 2018 at 09:50:01 UTC, Andrey wrote: Hello, This code doesn't compile: --- import std.meta; import std.stdio; enum Option : string { First = "-first" , Second = "-second", Qwerty = "-qwerty" }

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread 12345swordy via Digitalmars-d
On Monday, 27 August 2018 at 16:32:15 UTC, Joakim wrote: On Monday, 27 August 2018 at 16:15:37 UTC, 12345swordy wrote: On Monday, 27 August 2018 at 14:26:08 UTC, Chris wrote: On Monday, 27 August 2018 at 13:48:42 UTC, 12345swordy wrote: On Monday, 27 August 2018 at 09:36:43 UTC, Chris wrote:

Re: GDC with D frontend 2.081.2

2018-08-27 Thread Eugene Wissner via Digitalmars-d-announce
On Monday, 27 August 2018 at 17:23:04 UTC, Arun Chandrasekaran wrote: 1. It would be good to print the DMD frontend version with `gdc --version`. It is helpful in reporting bugs. LDC does this. Unfortunately it doesn't seem to be possible. GCC doesn't allow to change --version output:

Re: GDC with D frontend 2.081.2

2018-08-27 Thread Iain Buclaw via Digitalmars-d-announce
On 27 August 2018 at 19:23, Arun Chandrasekaran via Digitalmars-d-announce wrote: > On Friday, 24 August 2018 at 05:35:13 UTC, Eugene Wissner wrote: >> >> As some of you may know D frontend was merged into GDC some time ago and >> is up to date. D version currently supported by GDC is 2.081.2 and

Re: GDC with D frontend 2.081.2

2018-08-27 Thread Arun Chandrasekaran via Digitalmars-d-announce
On Friday, 24 August 2018 at 05:35:13 UTC, Eugene Wissner wrote: As some of you may know D frontend was merged into GDC some time ago and is up to date. D version currently supported by GDC is 2.081.2 and it can be found in "gdc-7" and "gdc-8" branches. I will say a bit more about GDC

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread Stefam Koch via Digitalmars-d
On Monday, 27 August 2018 at 04:56:22 UTC, Walter Bright wrote: On 8/26/2018 6:11 PM, Manu wrote: I'm sure I recall experimental patches where those operators were available to try out... was I dreaming? :/ Andrei has worked on this for a long while, and finally came to the conclusion that

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread H. S. Teoh via Digitalmars-d
On Sun, Aug 26, 2018 at 11:27:57PM -0700, Manu via Digitalmars-d wrote: > On Sun, 26 Aug 2018 at 21:50, Walter Bright via Digitalmars-d > wrote: > > Going the other way, though, is even worse - what do you mean, I > > have to write forward declarations? Why can't I pass a string > > literal to a

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread Joakim via Digitalmars-d
On Monday, 27 August 2018 at 16:15:37 UTC, 12345swordy wrote: On Monday, 27 August 2018 at 14:26:08 UTC, Chris wrote: On Monday, 27 August 2018 at 13:48:42 UTC, 12345swordy wrote: On Monday, 27 August 2018 at 09:36:43 UTC, Chris wrote: On Monday, 27 August 2018 at 01:15:49 UTC, Laeeth Isharc

Re: How to pass alias as template parameter?

2018-08-27 Thread Paul Backus via Digitalmars-d-learn
On Monday, 27 August 2018 at 09:50:01 UTC, Andrey wrote: alias Pair(alias key, alias value) = AliasSeq!(key, value); alias Pairs = AliasSeq!(Pair!(Option.First, handler!(Option.First)), Pair!(Option.Second, handler!(Option.Second)), handler); You can't nest AliasSeqs. If you examine Pairs

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread 12345swordy via Digitalmars-d
On Monday, 27 August 2018 at 14:26:08 UTC, Chris wrote: On Monday, 27 August 2018 at 13:48:42 UTC, 12345swordy wrote: On Monday, 27 August 2018 at 09:36:43 UTC, Chris wrote: On Monday, 27 August 2018 at 01:15:49 UTC, Laeeth Isharc wrote: [...] I think D has reached the point where that'd

Re: Is there a simple way to check if value is null for every case?

2018-08-27 Thread Jacob Shtokolov via Digitalmars-d-learn
On Monday, 27 August 2018 at 14:11:32 UTC, SG wrote: On Monday, 27 August 2018 at 13:02:28 UTC, rikki cattermole wrote: So Nullable in D and C# is basically the same except C#'s has language support. Shouldn't it be in the standard library? I think it's worth it to create a feature request

the "from" template and parameterized functions

2018-08-27 Thread aliak via Digitalmars-d-learn
I can't get the from template [0] to work in the following situation, is it possible? --- module m; import std.stdio; package template from(string moduleName) { mixin("import from = " ~ moduleName ~ ";"); } version(works) { struct S {} void t(from!"m".S param) {} auto a =

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread H. S. Teoh via Digitalmars-d
On Sun, Aug 26, 2018 at 11:12:10PM +, FeepingCreature via Digitalmars-d wrote: [...] > Can I just throw in here that I like autodecoding and I think it's > good? If you want ranges that iterate over bytes, then just use > arrays of bytes. If you want Latin1 text, use Latin1 strings. If you

[Issue 19198] Transfer the entire development DMD to LLVM: WebAssembly, dynamic scripting..

2018-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19198 anonymous4 changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

Re: Beta 2.082.0

2018-08-27 Thread Kagamin via Digitalmars-d-announce
On Saturday, 18 August 2018 at 16:51:18 UTC, Martin Nowak wrote: Beta is 2 weeks sounds fine then. So please download and install the beta, sth. you should always do ;). The download should probably happen through Edge too: it runs SmartScreen on the downloaded file. OT: more news:

Re: Null-Coalescing Operator and Extensions

2018-08-27 Thread SG via Digitalmars-d-learn
On Monday, 27 August 2018 at 07:59:17 UTC, Simen Kjærås wrote: That's the null propagation operator (?.). What SG asked for is the null-coalescing operator (??). Of course, this can also be implemented in D (albeit with a slight more horrible syntax): Exactly, and I know it is an example, but

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread Chris via Digitalmars-d
On Monday, 27 August 2018 at 13:48:42 UTC, 12345swordy wrote: On Monday, 27 August 2018 at 09:36:43 UTC, Chris wrote: On Monday, 27 August 2018 at 01:15:49 UTC, Laeeth Isharc wrote: [...] I think D has reached the point where that'd make perfect sense. Move from the garage to a proper

Re: Is there a simple way to check if value is null for every case?

2018-08-27 Thread SG via Digitalmars-d-learn
On Monday, 27 August 2018 at 13:02:28 UTC, rikki cattermole wrote: So Nullable in D and C# is basically the same except C#'s has language support. The big difference is that in there I could do: int? i = null; string j = null; var k = null; and test all like: i == null; j

Re: D is dead

2018-08-27 Thread Don via Digitalmars-d
On Monday, 27 August 2018 at 07:34:37 UTC, Walter Bright wrote: On 8/23/2018 8:53 PM, David Nadlinger wrote: On Thursday, 23 August 2018 at 23:27:51 UTC, Walter Bright wrote: D deals with it via "chained exceptions", which is terrifyingly difficult to understand. If you believe it is

[Issue 1197] "static if" + enum.max/enum.min doesn't compile (D1 only)

2018-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=1197 Stefan Koch changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 340] [Tracker] Forward reference bugs and other order-of-declaration issues

2018-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=340 Issue 340 depends on issue 1197, which changed state. Issue 1197 Summary: "static if" + enum.max/enum.min doesn't compile (D1 only) https://issues.dlang.org/show_bug.cgi?id=1197 What|Removed |Added

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread 12345swordy via Digitalmars-d
On Monday, 27 August 2018 at 09:36:43 UTC, Chris wrote: On Monday, 27 August 2018 at 01:15:49 UTC, Laeeth Isharc wrote: [...] I think D has reached the point where that'd make perfect sense. Move from the garage to a proper factory :) Who's going to pay for the factory? -Alex

Re: Is there a simple way to check if value is null for every case?

2018-08-27 Thread vit via Digitalmars-d-learn
On Monday, 27 August 2018 at 12:54:59 UTC, SG wrote: On Monday, 27 August 2018 at 03:21:04 UTC, rikki cattermole wrote: Templates make it the easiest way, since common patterns, like arrays, classes and pointers have the exact same null check syntax. I see. That code is only for classes. C#

Re: I want change package name for dub , how to do it?

2018-08-27 Thread JN via Digitalmars-d
On Monday, 27 August 2018 at 10:54:22 UTC, Eugene Wissner wrote: On Monday, 27 August 2018 at 10:25:42 UTC, Brian wrote: My team want change packages name: hunt -> hunt-framework entity -> hunt-entity database -> hunt-database cache -> hunt-cache How to do it? Must delete package before add

Re: Is there a simple way to check if value is null for every case?

2018-08-27 Thread rikki cattermole via Digitalmars-d-learn
On 28/08/2018 12:54 AM, SG wrote: The same thing for struct in C# Struct S{    public int? i; } S.i == null; // This works nicely. https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/nullable-types/index So Nullable in D and C# is basically the same except C#'s has language

Re: Is there a simple way to check if value is null for every case?

2018-08-27 Thread SG via Digitalmars-d-learn
On Monday, 27 August 2018 at 03:21:04 UTC, rikki cattermole wrote: Templates make it the easiest way, since common patterns, like arrays, classes and pointers have the exact same null check syntax. I see. That code is only for classes. C# also has structs which are a value type. Which it

Re: How to use math functions in dcompute?

2018-08-27 Thread Nicholas Wilson via Digitalmars-d-learn
On Monday, 27 August 2018 at 09:57:18 UTC, Sobaya wrote: On Monday, 27 August 2018 at 09:41:34 UTC, 9il wrote: On Monday, 27 August 2018 at 08:25:14 UTC, Sobaya wrote: I'm using dcompute(https://github.com/libmir/dcompute). In the development, I have got to use math functions such as sqrt in

Re: How to mixin repeated text?

2018-08-27 Thread Andrey via Digitalmars-d-learn
On Monday, 27 August 2018 at 11:56:08 UTC, Kamil Koczurek wrote: Mixins seem to be an overkill here. Maybe something like this would suffice: data[index + 1 .. index + 5].map!(k => k[0]).array == "" Here there is dynamic code, with memory allocs. I found solution:

Re: How to mixin repeated text?

2018-08-27 Thread Kamil Koczurek via Digitalmars-d-learn
On Monday, 27 August 2018 at 11:52:02 UTC, Andrey wrote: Hello again, I have this part of code: ... if(index + 3 >= data.length || data[index + 1][0] == '&' || data[index + 2][0] == '&' || data[index + 3][0] == '&' || data[index + 4][0] == '&') { writeln("Some text..."); } I don't want

How to mixin repeated text?

2018-08-27 Thread Andrey via Digitalmars-d-learn
Hello again, I have this part of code: ... if(index + 3 >= data.length || data[index + 1][0] == '&' || data[index + 2][0] == '&' || data[index + 3][0] == '&' || data[index + 4][0] == '&') { writeln("Some text..."); } I don't want to write manually these four "or" conditions because in

Re: "Constructor" was a Very Bad name choice we have never recovered from (Was Re: D is dead)

2018-08-27 Thread FeepingCreature via Digitalmars-d
On Monday, 27 August 2018 at 11:02:14 UTC, Guillaume Piolat wrote: C++ binds the two in the same operation. D does not, T.init must be a valid object. This is a major cultural change, though I believe the D way is superior on the efficiency stand-point (you can create large arrays of valid

[Issue 19198] Transfer the entire development DMD to LLVM: WebAssembly, dynamic scripting..

2018-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19198 --- Comment #1 from OlegZ --- SPIR-V (bytecode of Vulkan API and OpenCL) can be translated to LLVM and back https://github.com/KhronosGroup/SPIRV-LLVM LLVM can generate code for AMD/NVIDIA extension cards (graphics, math..) --

[Issue 19198] New: Transfer the entire development DMD to LLVM: WebAssembly, dynamic scripting..

2018-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19198 Issue ID: 19198 Summary: Transfer the entire development DMD to LLVM: WebAssembly, dynamic scripting.. Product: D Version: D2 Hardware: All OS: All

Re: GDC with D frontend 2.081.2

2018-08-27 Thread Daniel Kozak via Digitalmars-d-announce
On Sat, Aug 25, 2018 at 11:20 PM Anonymouse via Digitalmars-d-announce < digitalmars-d-announce@puremagic.com> wrote: > On Saturday, 25 August 2018 at 20:59:56 UTC, Daniel Kozak wrote: > > August 10th. I'll wait for -2 then. > > > Installed Size : 243.72 MiB > > Packager: Unknown

Re: "Constructor" was a Very Bad name choice we have never recovered from (Was Re: D is dead)

2018-08-27 Thread Guillaume Piolat via Digitalmars-d
On Monday, 27 August 2018 at 03:06:17 UTC, John Carter wrote: The last few years I have told myself (and anyone who doesn't back away fast enough) that "Constructors" do _not_ construct objects, they are "Name Binders." (Sort of like lisp's "let" macro) They bind instance variable names to

Re: I want change package name for dub , how to do it?

2018-08-27 Thread Eugene Wissner via Digitalmars-d
On Monday, 27 August 2018 at 10:25:42 UTC, Brian wrote: My team want change packages name: hunt -> hunt-framework entity -> hunt-entity database -> hunt-database cache -> hunt-cache How to do it? Must delete package before add it again? Yes. And change the name in dub.json/dub.sdl.

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread Basile B. via Digitalmars-d
On Monday, 27 August 2018 at 01:15:49 UTC, Laeeth Isharc wrote: There's no question from my perspective that D is much better than a year ago and unimaginably better from when I first picked it up in 2014. One can't be serious suggesting that D isn't flourishing as far as adoption goes. I

I want change package name for dub , how to do it?

2018-08-27 Thread Brian via Digitalmars-d
My team want change packages name: hunt -> hunt-framework entity -> hunt-entity database -> hunt-database cache -> hunt-cache How to do it? Must delete package before add it again?

Re: How to use math functions in dcompute?

2018-08-27 Thread 9il via Digitalmars-d-learn
On Monday, 27 August 2018 at 09:57:18 UTC, Sobaya wrote: On Monday, 27 August 2018 at 09:41:34 UTC, 9il wrote: On Monday, 27 August 2018 at 08:25:14 UTC, Sobaya wrote: I'm using dcompute(https://github.com/libmir/dcompute). In the development, I have got to use math functions such as sqrt in

Re: Looking for a mentor for SAoC

2018-08-27 Thread Mike Parker via Digitalmars-d
On Monday, 27 August 2018 at 07:45:03 UTC, Manu wrote: I think one of the only people qualified to help you is Rainer Schutze. I think he knows the details of Mago better than anyone. Rainer is unable to participate in SAoC as a mentor this time around. So we're looking for anyone with

Re: How to use math functions in dcompute?

2018-08-27 Thread Sobaya via Digitalmars-d-learn
On Monday, 27 August 2018 at 09:41:34 UTC, 9il wrote: On Monday, 27 August 2018 at 08:25:14 UTC, Sobaya wrote: I'm using dcompute(https://github.com/libmir/dcompute). In the development, I have got to use math functions such as sqrt in @compute function. But LDC says "can only call

How to pass alias as template parameter?

2018-08-27 Thread Andrey via Digitalmars-d-learn
Hello, This code doesn't compile: --- import std.meta; import std.stdio; enum Option : string { First = "-first" , Second = "-second", Qwerty = "-qwerty" } void handler(Option option)(string[] args, ref ushort

Re: How to use math functions in dcompute?

2018-08-27 Thread 9il via Digitalmars-d-learn
On Monday, 27 August 2018 at 08:25:14 UTC, Sobaya wrote: I'm using dcompute(https://github.com/libmir/dcompute). In the development, I have got to use math functions such as sqrt in @compute function. But LDC says "can only call functions from other @compute modules in @compute code", so

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread Chris via Digitalmars-d
On Monday, 27 August 2018 at 01:15:49 UTC, Laeeth Isharc wrote: I wonder if we are approaching the point where enterprise crowd-funding of missing features or capabilities in the ecosystem could make sense. If you look at how Liran managed to find David Nadlinger to help him, it could just

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread Paolo Invernizzi via Digitalmars-d
On Monday, 27 August 2018 at 01:15:49 UTC, Laeeth Isharc wrote: It's simple, I went to GitLab to see the code of the tool, and I found the articles among the other projects of the author. I don't think he was very happy about the process around DIP1000 but I am not myself well placed to

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread Chris via Digitalmars-d
On Sunday, 26 August 2018 at 22:44:05 UTC, Walter Bright wrote: On 8/26/2018 8:43 AM, Chris wrote: I wanted to get rid of autodecode and I even offered to test it on my string heavy code to see what breaks (and maybe write guidelines for the transition), but somehow the whole idea of getting

How to use math functions in dcompute?

2018-08-27 Thread Sobaya via Digitalmars-d-learn
I'm using dcompute(https://github.com/libmir/dcompute). In the development, I have got to use math functions such as sqrt in @compute function. But LDC says "can only call functions from other @compute modules in @compute code", so can't I call any math functions with dcompute? Is there

Re: Null-Coalescing Operator and Extensions

2018-08-27 Thread Basile B. via Digitalmars-d-learn
On Saturday, 25 August 2018 at 19:16:26 UTC, Jacob Carlborg wrote: On 2018-08-25 15:33, SG wrote: Hi, 1) I program in C# and I'm wondering if there is something like ?? (Null-Coalescing Operator) in D? (I remember some proposals in the past). Not in the language but it can be implemented

[Issue 19175] @safe code can escape local array references

2018-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19175 --- Comment #6 from anonymous4 --- Same for pointers: @safe: struct A(T) { int* r; this(int* q){r=q;} } int* escape(T)(int* r) { return A!int(r).r; } int* f() { int x; return escape!int(); } --

Re: Null-Coalescing Operator and Extensions

2018-08-27 Thread Simen Kjærås via Digitalmars-d-learn
On Saturday, 25 August 2018 at 19:16:26 UTC, Jacob Carlborg wrote: On 2018-08-25 15:33, SG wrote: Hi, 1) I program in C# and I'm wondering if there is something like ?? (Null-Coalescing Operator) in D? (I remember some proposals in the past). Not in the language but it can be implemented

Re: A site like cppinsights.io, but for D?

2018-08-27 Thread Stefan Koch via Digitalmars-d
On Sunday, 26 August 2018 at 17:39:22 UTC, Alexander Nicholi wrote: I just ran across this website that does some pretty interesting deconstructions of C++ code, and I was wondering if anything like this exists for D. Apparently the main purpose is source-to-source

Re: Looking for a mentor for SAoC

2018-08-27 Thread Manu via Digitalmars-d
On Sun, 26 Aug 2018 at 09:50, solidstate1991 via Digitalmars-d wrote: > > I've chosen to work on Mago, with the following goals: > > -Porting it to D first and foremost to make code maintenance and > expansion easier in the future. > -Add better support for Win32-COFF (there's a few more bugs >

Re: D is dead

2018-08-27 Thread Walter Bright via Digitalmars-d
On 8/23/2018 8:53 PM, David Nadlinger wrote: On Thursday, 23 August 2018 at 23:27:51 UTC, Walter Bright wrote: D deals with it via "chained exceptions", which is terrifyingly difficult to understand. If you believe it is understandable, just try to understand the various devious test cases in

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread Andre Pany via Digitalmars-d
On Monday, 27 August 2018 at 00:35:12 UTC, tide wrote: On Sunday, 26 August 2018 at 23:39:32 UTC, Manu wrote: [...] It's not just VisualD, the debug info DMD produces just doesn't include things like global variables for some reason. I use VS Code to debug, I get around it by using -gc

[Issue 19194] version for `-mscrtlib` specification

2018-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19194 --- Comment #2 from Manu --- I have work-arounds in place. Work-arounds aren't confidence inspiring. Shit needs to just-work right ;) I figure settings a version for the selected crtlib offers the most information, and guarantees that we won't need

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread Walter Bright via Digitalmars-d
On 8/26/2018 6:25 PM, Neia Neutuladh wrote: Same here. I do make unicode errors more often than I'd care to admit (someString[$-1] being the most common; I need to write a lastChar helper function), but autodecoding means I can avoid that class of errors. Autodecoding doesn't prevent you from

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread Nicholas Wilson via Digitalmars-d
On Monday, 27 August 2018 at 01:10:17 UTC, Manu wrote: On Sun, 26 Aug 2018 at 18:08, Manu wrote: Actually, I'm really mostly interested in DX12 shader output right now... I think there are tools that can convert LLVM to DX shaders? I haven't looked into it yet, but it's on my backlog. Next

[Issue 19197] New: Replace instances of typeid(T).getHash(..) with hashOf

2018-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19197 Issue ID: 19197 Summary: Replace instances of typeid(T).getHash(..) with hashOf Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread Manu via Digitalmars-d
On Sun, 26 Aug 2018 at 21:50, Walter Bright via Digitalmars-d wrote: > > Going the other way, though, is even worse - what do you mean, I have to write > forward declarations? Why can't I pass a string literal to a template? No user > defined attributes? Why doesn't CTFE work? Who can actually

[Issue 19196] DMD thinks storage size for pointer or dynamic array isn't always known

2018-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19196 --- Comment #3 from | --- Created PR https://github.com/dlang/dmd/pull/8623 --

Re: Dicebot on leaving D: It is anarchy driven development in all its glory.

2018-08-27 Thread Manu via Digitalmars-d
On Sun, 26 Aug 2018 at 21:50, Walter Bright via Digitalmars-d wrote: > > On 8/26/2018 5:40 PM, Manu wrote: > > By contrast, another colleague tried writing a small game in his own > > time. His feedback was that it felt 'fine', but he didn't encounter > > anything that made it "simpler than C++",

[Issue 19194] version for `-mscrtlib` specification

2018-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19194 Nicholas Wilson changed: What|Removed |Added CC||iamthewilsona...@hotmail.co