Re: Windows integration [was: Re: There really needs to be some moderation]

2017-06-22 Thread Brad Anderson via Digitalmars-d
On Sunday, 18 June 2017 at 21:47:48 UTC, Laeeth Isharc wrote: [snip] Windows has been a bit of a pain, but mostly from the native code library side. It should be easy to install google snappy right? On Linux it is. On Windows, not so much... And that's just one library. vcpkg is making

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread H. S. Teoh via Digitalmars-d
On Thu, Jun 22, 2017 at 06:17:54AM +, MysticZach via Digitalmars-d wrote: > On Wednesday, 21 June 2017 at 19:34:53 UTC, H. S. Teoh wrote: > > This is a sticky point about D's current DbC implementation that > > myself and several others feel is a design flaw. In particular, that > >

Re: Manually calling postblots recursively

2017-06-22 Thread Johannes Loher via Digitalmars-d-learn
On Sunday, 18 June 2017 at 14:16:03 UTC, Basile B. wrote: On Sunday, 18 June 2017 at 09:41:01 UTC, Johannes Loher wrote: Hey, I'm trying to work on https://issues.dlang.org/show_bug.cgi?id=15708 so I decided it might be interesting to find a way to (recursively) call all postblits that belong

Re: gdc is in

2017-06-22 Thread Johannes Loher via Digitalmars-d
On Wednesday, 21 June 2017 at 15:11:39 UTC, Joakim wrote: the gcc tree: https://gcc.gnu.org/ml/gcc/2017-06/msg00111.html Congratulations to Iain and the gdc team. :) I found out because it's on the front page of HN right now, where commenters are asking questions about D. This is really

Re: What is your favorite D feature?

2017-06-22 Thread Paulo Pinto via Digitalmars-d
On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. Ideas: - favorite language construct - favorite code sample - "only

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread MysticZach via Digitalmars-d
On Wednesday, 21 June 2017 at 19:34:53 UTC, H. S. Teoh wrote: This is a sticky point about D's current DbC implementation that myself and several others feel is a design flaw. In particular, that in-contracts are executed as part of the *callee*, when the intent of DbC is really that it is the

Re: What is your favorite D feature?

2017-06-22 Thread Ecstatic Coder via Digitalmars-d
Lack of verbosity. Clear concise code, thanks to the automatic initialization of class members, native strings/arrays/maps/slices, UFCS, declaration-order independence, etc. class TOTO { bool IsCool; int Age; TUTU[] Tutus; TOTO[string] Totos; void Foo( TUTU tutu ) {

Re: GDC generate wrong .exe ("not a valid win32 application")

2017-06-22 Thread cym13 via Digitalmars-d-learn
On Thursday, 22 June 2017 at 05:57:59 UTC, bauss wrote: On Wednesday, 21 June 2017 at 15:55:27 UTC, David Nadlinger wrote: On Monday, 19 June 2017 at 14:08:56 UTC, Patric Dexheimer wrote: Fresh install of GDC. (tried with 32x ad 32_64x) Where did you get the GDC executable from? The GDC

Re: Go 1.9

2017-06-22 Thread Wulfklaue via Digitalmars-d
On Thursday, 22 June 2017 at 07:15:26 UTC, Bienlein wrote: In Java development there is almost no C or C++ and no Rust or D at all. Memory is no problem. Some server needs 256 GB RAM or maybe 512 GB? That is just sloppy... There is this bad trend in the industry, it has been going on for

Re: Go 1.9

2017-06-22 Thread Laeeth Isharc via Digitalmars-d
On Thursday, 22 June 2017 at 07:32:51 UTC, Wulfklaue wrote: On Thursday, 22 June 2017 at 07:15:26 UTC, Bienlein wrote: In Java development there is almost no C or C++ and no Rust or D at all. Memory is no problem. Some server needs 256 GB RAM or maybe 512 GB? That is just sloppy... There is

Re: What is your favorite D feature?

2017-06-22 Thread bauss via Digitalmars-d
On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. Ideas: - favorite language construct - favorite code sample - "only

Re: What is your favorite D feature? [Call for snippets]

2017-06-22 Thread Seb via Digitalmars-d
On Thursday, 22 June 2017 at 06:08:07 UTC, Paulo Pinto wrote: On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. Ideas: -

Re: DIP 1007--"future symbol"--Formal Review

2017-06-22 Thread Mike Parker via Digitalmars-d
On Wednesday, 7 June 2017 at 10:36:05 UTC, Mike Parker wrote: The first stage of the formal review for DIP 1007 [1], "'future symbol' Compiler Concept", is now underway. From now until 11:59 PM ET on June 21 (3:59 AM GMT on June 22), the community has the opportunity to provide last-minute

Re: What is your favorite D feature? [Call for snippets]

2017-06-22 Thread Seb via Digitalmars-d
On Thursday, 22 June 2017 at 01:00:42 UTC, Mike wrote: Beginning with most favorite: - CTFE - static if - If you don't consider that part of CTFE - Template Mixins - Templates - Pretty much goes along with the top 2 - String Mixins - Unit Tests DIP1000 may make that list too, if I ever

Re: What is your favorite D feature? [Call for snippets]

2017-06-22 Thread Mike via Digitalmars-d
On Thursday, 22 June 2017 at 07:10:14 UTC, Seb wrote: Nice list, but I was actually looking for more concise, actionable snippets or idea(s) for such. There are some real gems in this DConf Talk: https://www.youtube.com/watch?v=yMNMV9JlkcQ I started enumerating them on the Wiki here

Re: Unittests and extern(C)

2017-06-22 Thread Jacob Carlborg via Digitalmars-d
On 2017-06-22 00:19, H. S. Teoh via Digitalmars-d wrote: The code template says: extern(C) double funcImpl(double x, double y) But the function pointer type is declared as: alias FuncImpl = double function(double, double); Notice the lack of `extern(C)` in the latter. The

Re: GDC generate wrong .exe ("not a valid win32 application")

2017-06-22 Thread bauss via Digitalmars-d-learn
On Wednesday, 21 June 2017 at 15:55:27 UTC, David Nadlinger wrote: On Monday, 19 June 2017 at 14:08:56 UTC, Patric Dexheimer wrote: Fresh install of GDC. (tried with 32x ad 32_64x) Where did you get the GDC executable from? The GDC project doesn't currently offer any official builds that

Re: gdc is in

2017-06-22 Thread Johan Engelen via Digitalmars-d
On Wednesday, 21 June 2017 at 15:11:39 UTC, Joakim wrote: the gcc tree: https://gcc.gnu.org/ml/gcc/2017-06/msg00111.html Congratulations to Iain and the gdc team. :) Congratulations! Great achievement. - Johan

Re: dmd -betterC

2017-06-22 Thread Laeeth Isharc via Digitalmars-d
On Tuesday, 20 June 2017 at 01:51:26 UTC, Walter Bright wrote: Is getting a whole lot better: https://github.com/dlang/dmd/pull/6918 You can now build D executables that do not link in anything from Phobos - only from the standard C library. Very cool - this plus Adam's changes. The next

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread H. S. Teoh via Digitalmars-d
On Thu, Jun 22, 2017 at 05:46:06AM +, MysticZach via Digitalmars-d wrote: [...] > As far as syntax subtrees not belonging to their parent, I can see > where the cognitive dissonance comes from. But it just doesn't seem > that bad to me, since contracts are always executed as if they are >

Re: What is your favorite D feature? [Call for snippets]

2017-06-22 Thread Seb via Digitalmars-d
On Thursday, 22 June 2017 at 06:27:11 UTC, Ecstatic Coder wrote: Absolutely no syntactic noise !!! This is often overlooked, while D easily beats all its direct competitors (C++, Java, C#, etc) on that point. Just try to implement the same code as simply in C++ and you will be convinced

Re: What is your favorite D feature? [Call for snippets]

2017-06-22 Thread Seb via Digitalmars-d
On Thursday, 22 June 2017 at 06:02:54 UTC, bauss wrote: On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. Ideas: -

Re: Windows integration [was: Re: There really needs to be some moderation]

2017-06-22 Thread Mike Parker via Digitalmars-d
On Thursday, 22 June 2017 at 05:59:05 UTC, Brad Anderson wrote: On Sunday, 18 June 2017 at 21:47:48 UTC, Laeeth Isharc wrote: [snip] Windows has been a bit of a pain, but mostly from the native code library side. It should be easy to install google snappy right? On Linux it is. On Windows,

Re: dmd -betterC

2017-06-22 Thread Jacob Carlborg via Digitalmars-d
On 2017-06-21 09:28, Walter Bright wrote: It does work with C on Windows, Linux, OSX, and FreeBSD, and so it works with -betterC, too. For example, in C there's "__thread" and in C++ there's "thread_local". "__thread" doesn't work with all C++ types because it may contain a non-trivial

Re: Go 1.9

2017-06-22 Thread Bienlein via Digitalmars-d
I suspect though that like Go took Python more than C folk, Kotlin Native will take more Java that C++, Go and Rust folks. But speculation rarely turn out quite as speculated. In Java development there is almost no C or C++ and no Rust or D at all. Memory is no problem. Some server needs 256

Re: gdc is in

2017-06-22 Thread Antonio Corbi via Digitalmars-d
On Wednesday, 21 June 2017 at 15:11:39 UTC, Joakim wrote: the gcc tree: https://gcc.gnu.org/ml/gcc/2017-06/msg00111.html Congratulations to Iain and the gdc team. :) I found out because it's on the front page of HN right now, where commenters are asking questions about D. Congrats Iain!

Re: What is your favorite D feature?

2017-06-22 Thread qznc via Digitalmars-d
On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. Ideas: - favorite language construct - favorite code sample - "only

Re: Dealing with the interior pointers bug

2017-06-22 Thread Boris-Barboris via Digitalmars-d-learn
On Thursday, 22 June 2017 at 09:45:09 UTC, Russel Winder wrote: I think the term "systems programming language" contains no actual data, so needs to be retired. In this situation it provides no reason for conservative garbage collection. It means the intent of language designer to let you

Re: Go 1.9

2017-06-22 Thread Wulfklaue via Digitalmars-d
On Thursday, 22 June 2017 at 10:23:37 UTC, Russel Winder wrote: On Thu, 2017-06-22 at 10:00 +, Paulo Pinto via Digitalmars-d wrote: […] They were all about Swift, Java, Kotlin, C#. Those are also the major players in the market. C# Microsoft, Swift Apple, Java Oracle... so there is more

Re: What is your favorite D feature?

2017-06-22 Thread Era Scarecrow via Digitalmars-d
On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: I would love to hear about your favorite feature(s) in D. Arrays include length along with the pointer. Very easy built-in array support with foreach Ranges, that don't treat their input types as 'pointers' and get all levels of

Re: Go 1.9

2017-06-22 Thread Russel Winder via Digitalmars-d
On Thu, 2017-06-22 at 07:15 +, Bienlein via Digitalmars-d wrote: > > […] > In Java development there is almost no C or C++ and no Rust or D  > at all. Memory is no problem. Some server needs 256 GB RAM or  > maybe 512 GB? That's not an issue anywhere. As long as you get  > the performance

Re: Dealing with the interior pointers bug

2017-06-22 Thread Russel Winder via Digitalmars-d-learn
On Wed, 2017-06-21 at 10:23 -0700, H. S. Teoh via Digitalmars-d-learn wrote: > […] > > The reason the GC must be conservative is because (1) D is a systems > programming language, and also because (2) D interfaces directly with > C. I think the term "systems programming language" contains no

Re: Replacing Make for the DMD build

2017-06-22 Thread Russel Winder via Digitalmars-d
On Wed, 2017-06-21 at 14:11 +, Atila Neves via Digitalmars-d wrote: > […] > > I'm not the best at documentation. Funnily enough, I made an  > effort with reggae, which might just show how bad I am at this. Hopefully the era of programmers boasting how crap they are at documentation is over.

Re: Replacing Make for the DMD build

2017-06-22 Thread Russel Winder via Digitalmars-d
It is also worth noting for deployment purposes in package management systems, that it is important that all the build tools necessary have to be in the distribution in order for something to be accepted into the distribution. So for example Make is acceptable, but Reggae (at least currently)

Re: DirectX bindings

2017-06-22 Thread evilrat via Digitalmars-d-announce
On Sunday, 3 November 2013 at 05:27:24 UTC, evilrat wrote: https://github.com/evilrat666/directx-d I'm sorry to say that, but I have to quit the post of DirectX bindings maintainer. I haven't yet decided on what to do with dub package[1], but I'm in favor of completely deleting it so the

Re: What is your favorite D feature?

2017-06-22 Thread k-five via Digitalmars-d
On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. Ideas: - favorite language construct - favorite code sample - "only

Re: Replacing Make for the DMD build

2017-06-22 Thread Russel Winder via Digitalmars-d
On Tue, 2017-06-20 at 15:06 -0400, Nick Sabalausky (Abscissa) via Digitalmars-d wrote: > […] > > I'm convinced a big part of that is because DUB is ubiquitous and  > incredibly helpful in the D world for package management, but plays > very  > poorly with any build system that isn't DUB's

Re: What is your favorite D feature?

2017-06-22 Thread Guillaume Piolat via Digitalmars-d
On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. Ideas: - favorite language construct I think "alias this" is a good

Re: Go 1.9

2017-06-22 Thread Russel Winder via Digitalmars-d
On Thu, 2017-06-22 at 10:00 +, Paulo Pinto via Digitalmars-d wrote: > […] > > They were all about Swift, Java, Kotlin, C#. > Isn't Swift a native code language? > -- Russel. = Dr Russel Winder t: +44 20 7585

Re: dmd -betterC

2017-06-22 Thread Walter Bright via Digitalmars-d
On 6/22/2017 1:21 AM, Jacob Carlborg wrote: On 2017-06-21 09:28, Walter Bright wrote: It does work with C on Windows, Linux, OSX, and FreeBSD, and so it works with -betterC, too. For example, in C there's "__thread" and in C++ there's "thread_local". "__thread" doesn't work with all C++

Cannot implicitly convert expression (struct this)

2017-06-22 Thread Andre Pany via Digitalmars-d-learn
Hi, I created a custom type which enables me to have enums which have in their initial state, the init value of their base type. Something similiar to Nullable... enum Reason : string {CO = "Co", FU = "Fu", CA = "Ca"} struct TestStruct {InitialEnum!Reason reason;} This line raises the

Re: Go 1.9

2017-06-22 Thread Paulo Pinto via Digitalmars-d
On Thursday, 22 June 2017 at 07:15:26 UTC, Bienlein wrote: I suspect though that like Go took Python more than C folk, Kotlin Native will take more Java that C++, Go and Rust folks. But speculation rarely turn out quite as speculated. In Java development there is almost no C or C++ and no

Release candidates vibe.d 0.8.0-rc.1 and vibe-core 1.0.0-rc.1

2017-06-22 Thread Sönke Ludwig via Digitalmars-d-announce
After a last minute path type redesign, the state of the new vibe-core package now finally feels ready for the first official release. The library is in a pretty good shape, with the notable exception that sockets are not yet implemented on Windows in the new eventcore abstraction layer. This

Re: What is your favorite D feature?

2017-06-22 Thread Seb via Digitalmars-d
On Thursday, 22 June 2017 at 08:52:27 UTC, qznc wrote: On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: [...] H. S. Teoh calendar: https://wiki.dlang.org/Component_programming_with_ranges [...] Yes that's a great example, but sadly not standalone - we can only use Phobos for the

Re: Replacing Make for the DMD build

2017-06-22 Thread Russel Winder via Digitalmars-d
On Wed, 2017-06-21 at 14:48 +, jmh530 via Digitalmars-d wrote: > […] > This is what I was thinking: start with a simple project, show  > how you can build it with dub or with reggae, then show a  > slightly more complicated project that dub cannot handle well and  > show how you can use

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread Moritz Maxeiner via Digitalmars-d
On Thursday, 22 June 2017 at 05:46:06 UTC, MysticZach wrote: On Thursday, 22 June 2017 at 00:27:38 UTC, Timon Gehr wrote: But it still has a sticking point, which I want to resolve, namely that it elevates the existing `assert` functionality beyond the current requirement that one must

Re: Go 1.9

2017-06-22 Thread Paulo Pinto via Digitalmars-d
On Thursday, 22 June 2017 at 10:23:37 UTC, Russel Winder wrote: On Thu, 2017-06-22 at 10:00 +, Paulo Pinto via Digitalmars-d wrote: […] They were all about Swift, Java, Kotlin, C#. Isn't Swift a native code language? Just like Java when one uses any commercial JDK or C# when targeting

DIP 1010--Static foreach--Preliminary Review Round 1 Begins

2017-06-22 Thread Mike Parker via Digitalmars-d-announce
The first preliminary review round of DIP 1010, "Static foreach", has begun. http://forum.dlang.org/post/uvefmcbbbidvjdioq...@forum.dlang.org Also, don't forget that the first preliminary review round for DIP 1009, "Improve Contract Usability", is also under way.

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread MysticZach via Digitalmars-d
On Thursday, 22 June 2017 at 13:11:12 UTC, MysticZach wrote: As long as one is doing this, maybe a proposal for user-defined `assert` should be provided too? It'd be interesting to have a dedicated file for user-defined assert and contract configuration. The core idea is to allow *everyone*,

Re: Go 1.9

2017-06-22 Thread Paulo Pinto via Digitalmars-d
On Thursday, 22 June 2017 at 11:11:01 UTC, Wulfklaue wrote: On Thursday, 22 June 2017 at 10:23:37 UTC, Russel Winder wrote: On Thu, 2017-06-22 at 10:00 +, Paulo Pinto via Digitalmars-d wrote: […] They were all about Swift, Java, Kotlin, C#. Those are also the major players in the

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread MysticZach via Digitalmars-d
On Thursday, 22 June 2017 at 12:54:00 UTC, MysticZach wrote: On Thursday, 22 June 2017 at 10:59:18 UTC, Moritz Maxeiner wrote: Again, that's not what H.S. Teoh's proposal would do. All it does is install an *implementation agnostic*, *abtract* way to specify contracts into the grammar. Whether

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread MysticZach via Digitalmars-d
On Thursday, 22 June 2017 at 06:43:38 UTC, H. S. Teoh wrote: On Thu, Jun 22, 2017 at 05:46:06AM +, MysticZach via Digitalmars-d wrote: [...] As far as syntax subtrees not belonging to their parent, I can see where the cognitive dissonance comes from. But it just doesn't seem that bad to

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread MysticZach via Digitalmars-d
On Thursday, 22 June 2017 at 12:21:29 UTC, MysticZach wrote: I start to get the nagging feeling that your point about the limitation in D's DbC implementation is actually the fatal flaw here. It's currently _illegal_ (outside of interface declarations) to expose the signature separately from

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread MysticZach via Digitalmars-d
On Thursday, 22 June 2017 at 10:59:18 UTC, Moritz Maxeiner wrote: Again, that's not what H.S. Teoh's proposal would do. All it does is install an *implementation agnostic*, *abtract* way to specify contracts into the grammar. Whether that is lowered to assert, or anything else is an

Re: What is your favorite D feature? [Call for snippets]

2017-06-22 Thread Ecstatic Coder via Digitalmars-d
Thanks a lot, but I was looking for small snippets (< 10 LoC) than could be used to show the awesomeness of D at the roulette on https://dlang.org Any chance you could make your point a bit conciser? :) I agree with you, indeed it is much too long for a carousel ;) And it should be made even

DIP 1010--Static foreach--Preliminary Review Round 1

2017-06-22 Thread Mike Parker via Digitalmars-d
DIP 1010 is titled "Static foreach". https://github.com/dlang/DIPs/blob/master/DIPs/DIP1010.md All review-related feedback on and discussion of the DIP should occur in this thread. The review period will end at 11:59 PM ET on July 6 (3:59 AM GMT July 7), or when I make a post declaring it

C++ interop; object destruction

2017-06-22 Thread Manu via Digitalmars-d
How do I properly implement object destruction of extern(C++) classes (with virtual destructors)? I'm not going to embarrass myself by pasting some of my attempts to achieve this goal to date. I've asked before, but I've never yet seen a sufficiently solution to this problem. Situation: I have

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread Moritz Maxeiner via Digitalmars-d
On Thursday, 22 June 2017 at 13:11:12 UTC, MysticZach wrote: On Thursday, 22 June 2017 at 12:54:00 UTC, MysticZach wrote: On Thursday, 22 June 2017 at 10:59:18 UTC, Moritz Maxeiner wrote: Again, that's not what H.S. Teoh's proposal would do. All it does is install an *implementation agnostic*,

[Issue 17510] How could 509 be a byte value?

2017-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17510 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dlang.org https://github.com/dlang/dlang.org/commit/2116b1f58463c5aba351eeb84e82009f8a40f0db Fix Issue 17510 - How could 509 be a byte value?

Re: Dealing with the interior pointers bug

2017-06-22 Thread ag0aep6g via Digitalmars-d-learn
On 06/22/2017 12:34 PM, Boris-Barboris wrote: Everything the language allows to compile is allowed by it's type system, or is a bug in the compiler. No. D is not supposed to be completely verifiable by the compiler. For example, the type system guarantees that immutable data never changes.

Re: BetterC and TypeInfo Question

2017-06-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 22 June 2017 at 14:30:31 UTC, jmh530 wrote: I was looking through the C++ standard library headers and noticed that has a typeid also. One difference with D is that it is opt-in as there is some cost using it. C++ also leaves most the properties for typeinfo to be

Re: Analysis of D GC

2017-06-22 Thread Kagamin via Digitalmars-d
On Tuesday, 20 June 2017 at 15:16:01 UTC, Ecstatic Coder wrote: This is probably why Nim's author was once paid to wrap an open source game engine (Urho3D), and improve the language's native compatibility with C++ libraries. https://forum.nim-lang.org/t/870

Re: D Language accepted for inclusion in GCC

2017-06-22 Thread Sebastien Alaiwan via Digitalmars-d-announce
On Thursday, 22 June 2017 at 16:13:51 UTC, Gary Willoughby wrote: D Language accepted for inclusion in GCC: https://gcc.gnu.org/ml/gcc/2017-06/msg00111.html Well done Iain Buclaw! Reddit thread:

Is there s.th. like enforceSuffix for arrays (string)?

2017-06-22 Thread Andre Pany via Digitalmars-d-learn
Hi, i often need to check whether an array(string) ends with a specific text and if not I need to add this text. For example I have a variable url and / has to be added to the end in case it is missing. I want to write: ...new RegistryPackageSupplier(URL(url.enforceSuffix("/"))... Of

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread MysticZach via Digitalmars-d
On Thursday, 22 June 2017 at 14:08:32 UTC, jmh530 wrote: My recollection is that the most significant reason to use contracts in D is because of contract inheritance. There's a lot of focus in this discussion on normal functions, when I would say that contracts really aren't even needed. So

Re: struct template constructors

2017-06-22 Thread Ali Çehreli via Digitalmars-d-learn
On 06/22/2017 12:06 PM, Boris-Barboris wrote: > Hi > > https://dpaste.dzfl.pl/0def4e286564 > > Is there a cleaner way to go than the one on the line 26? And why is the > constructor > > /d475/f781.d(37): f781.UniquePtr!(A).UniquePtr.__ctor(DT)(ref scope > UniquePtr!DT rhs) > > unfit for line 51?

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread Timon Gehr via Digitalmars-d
On 22.06.2017 16:08, jmh530 wrote: My recollection is that the most significant reason to use contracts in D is because of contract inheritance. There's a lot of focus in this discussion on normal functions, when I would say that contracts really aren't even needed. They are needed if you

Re: Is there s.th. like enforceSuffix for arrays (string)?

2017-06-22 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Jun 22, 2017 at 06:18:22PM +, Andre Pany via Digitalmars-d-learn wrote: > Hi, > > i often need to check whether an array(string) ends with a specific > text and if not I need to add this text. > > For example I have a variable url and / has to be added to the end in > case it is

Re: Release candidates vibe.d 0.8.0-rc.1 and vibe-core 1.0.0-rc.1

2017-06-22 Thread aberba via Digitalmars-d-announce
On Thursday, 22 June 2017 at 08:55:06 UTC, Sönke Ludwig wrote: After a last minute path type redesign, the state of the new vibe-core package now finally feels ready for the first official release. The library is in a pretty good shape, with the notable exception that sockets are not yet

Re: What is your favorite D feature?

2017-06-22 Thread Andrey via Digitalmars-d
UDA snippet: class MyView : View { @ViewWidget Button okButton; @ViewWidget("cancelButton") Button myButton; @GroupViewWidgets Button[3] buttons; @OnClickListener("okButton") void onOkButtonClick(Widget widget) { ... } @Shortcut("TestGroup.cancel") void

Re: DirectX bindings

2017-06-22 Thread Igor Shirkalin via Digitalmars-d-announce
On Thursday, 22 June 2017 at 09:09:40 UTC, evilrat wrote: On Sunday, 3 November 2013 at 05:27:24 UTC, evilrat wrote: https://github.com/evilrat666/directx-d I'm sorry to say that, but I have to quit the post of DirectX bindings maintainer. I haven't yet decided on what to do with dub

dlang website design

2017-06-22 Thread Ecstatic Coder via Digitalmars-d
Following my previous post about showing to first-time visitors of dlang.org some code example that shows how simpler the D code looks like compared to mainstream scripting and programming languages, is there any plan to change the design of the landing page any time soon ? The current

Re: What is your favorite D feature?

2017-06-22 Thread Andrey via Digitalmars-d
On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. Ideas: - favorite language construct - favorite code sample - "only

Re: Dealing with the interior pointers bug

2017-06-22 Thread Cym13 via Digitalmars-d-learn
On Thursday, 22 June 2017 at 18:38:59 UTC, Boris-Barboris wrote: On Thursday, 22 June 2017 at 13:56:29 UTC, ag0aep6g wrote: For example, the type system guarantees that immutable data never changes. But the compiler allows you to cast from immutable to mutable and change the data. It's an

Re: dlang website design

2017-06-22 Thread Cym13 via Digitalmars-d
On Thursday, 22 June 2017 at 19:19:20 UTC, Ecstatic Coder wrote: Following my previous post about showing to first-time visitors of dlang.org some code example that shows how simpler the D code looks like compared to mainstream scripting and programming languages, is there any plan to change

Re: Dealing with the interior pointers bug

2017-06-22 Thread Boris-Barboris via Digitalmars-d-learn
On Thursday, 22 June 2017 at 19:11:19 UTC, Cym13 wrote: Here it's the programmer's fault really. You should never use casts in normal code, cast is the ultimate switch to say "Look, I know what I'm doing, so disable all safety, don't try to make sense of it, and let me do my thing. If I'm

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread H. S. Teoh via Digitalmars-d
On Thu, Jun 22, 2017 at 02:08:32PM +, jmh530 via Digitalmars-d wrote: [...] > My recollection is that the most significant reason to use contracts > in D is because of contract inheritance. There's a lot of focus in > this discussion on normal functions, when I would say that contracts >

Re: Dealing with the interior pointers bug

2017-06-22 Thread Boris-Barboris via Digitalmars-d-learn
On Thursday, 22 June 2017 at 13:56:29 UTC, ag0aep6g wrote: For example, the type system guarantees that immutable data never changes. But the compiler allows you to cast from immutable to mutable and change the data. It's an invalid operation, but the compiler is not expected to catch that for

D Language accepted for inclusion in GCC

2017-06-22 Thread Gary Willoughby via Digitalmars-d-announce
D Language accepted for inclusion in GCC: https://gcc.gnu.org/ml/gcc/2017-06/msg00111.html Well done Iain Buclaw! Reddit thread: https://www.reddit.com/r/programming/comments/6im1yo/david_edelsohn_d_language_accepted_for_inclusion/

Re: Unittests and extern(C)

2017-06-22 Thread H. S. Teoh via Digitalmars-d
On Thu, Jun 22, 2017 at 10:16:51AM +0200, Jacob Carlborg via Digitalmars-d wrote: > On 2017-06-22 00:19, H. S. Teoh via Digitalmars-d wrote: > > > The code template says: > > > > extern(C) double funcImpl(double x, double y) > > > > But the function pointer type is declared as: > > > >

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread H. S. Teoh via Digitalmars-d
On Thu, Jun 22, 2017 at 01:33:17PM +, Moritz Maxeiner via Digitalmars-d wrote: [...] > Regarding the location of contract checking: Yes, though I agree with > him that a fix for that need not be part of this DIP. If this DIP > cleanly separates contract specification from contract

Re: GDC generate wrong .exe ("not a valid win32 application")

2017-06-22 Thread Sebastien Alaiwan via Digitalmars-d-learn
On Thursday, 22 June 2017 at 05:57:59 UTC, bauss wrote: On Wednesday, 21 June 2017 at 15:55:27 UTC, David Nadlinger wrote: On Monday, 19 June 2017 at 14:08:56 UTC, Patric Dexheimer wrote: Fresh install of GDC. (tried with 32x ad 32_64x) Where did you get the GDC executable from? The GDC

struct template constructors

2017-06-22 Thread Boris-Barboris via Digitalmars-d-learn
Hi https://dpaste.dzfl.pl/0def4e286564 Is there a cleaner way to go than the one on the line 26? And why is the constructor /d475/f781.d(37): f781.UniquePtr!(A).UniquePtr.__ctor(DT)(ref scope UniquePtr!DT rhs) unfit for line 51? Is it because the expression " = UniquePtr!B.make()" cannot

Re: struct template constructors

2017-06-22 Thread Boris-Barboris via Digitalmars-d-learn
On Thursday, 22 June 2017 at 19:17:13 UTC, Ali Çehreli wrote: No time to think about the rest of the design but just to get the code compiled, replace 'ref' with 'auto ref' like so: this(DT)(scope auto ref UniquePtr!DT rhs) { // ... } Ali i added this static variable:

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread Timon Gehr via Digitalmars-d
On 22.06.2017 22:02, jmh530 wrote: The whole double parentheses is a bit ugly to me. Is there any problem with out(return > 0) out(a => { void foo()out(b => a == b){ return a; } return foo()>0; }());

Re: struct template constructors

2017-06-22 Thread Ali Çehreli via Digitalmars-d-learn
On 06/22/2017 12:57 PM, Boris-Barboris wrote: > On Thursday, 22 June 2017 at 19:17:13 UTC, Ali Çehreli wrote: >> No time to think about the rest of the design but just to get the code >> compiled, replace 'ref' with 'auto ref' like so: > > Ok, looks like this indeed passes rhs by reference, thank

Re: Dealing with the interior pointers bug

2017-06-22 Thread ag0aep6g via Digitalmars-d-learn
On 06/22/2017 08:38 PM, Boris-Barboris wrote: Casts are part of the type system. Yes, D type system allows invalid operations. It's not the compiler's fault, it's type system's fault. unittest { immutable int a = 4; int* b = cast(int*) *b = 5; assert(*() == 5);

Re: struct template constructors

2017-06-22 Thread Boris-Barboris via Digitalmars-d-learn
On Thursday, 22 June 2017 at 19:17:13 UTC, Ali Çehreli wrote: No time to think about the rest of the design but just to get the code compiled, replace 'ref' with 'auto ref' like so: Ok, looks like this indeed passes rhs by reference, thank you. destcalls - number of times UniquePtr destructor

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread Timon Gehr via Digitalmars-d
On 22.06.2017 23:51, MysticZach wrote: On Thursday, 22 June 2017 at 21:41:55 UTC, MysticZach wrote: The whole double parentheses is a bit ugly to me. Is there any problem with out(return > 0) instead of out(r) (r > 0) I'm sorry, I didn't read closely. I think that's just asking for trouble,

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread MysticZach via Digitalmars-d
On Thursday, 22 June 2017 at 21:56:29 UTC, Timon Gehr wrote: On 22.06.2017 23:51, MysticZach wrote: On Thursday, 22 June 2017 at 21:41:55 UTC, MysticZach wrote: The whole double parentheses is a bit ugly to me. Is there any problem with out(return > 0) instead of out(r) (r > 0) I'm sorry, I

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread jmh530 via Digitalmars-d
On Thursday, 22 June 2017 at 18:57:40 UTC, MysticZach wrote: [snip] I don't mind that so much, but you made a good point earlier on how out would work with it. The whole double parentheses is a bit ugly to me. Is there any problem with out(return > 0) instead of out(r) (r > 0) Also, I

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread jmh530 via Digitalmars-d
On Thursday, 22 June 2017 at 20:19:59 UTC, Timon Gehr wrote: On 22.06.2017 22:02, jmh530 wrote: The whole double parentheses is a bit ugly to me. Is there any problem with out(return > 0) out(a => { void foo()out(b => a == b){ return a; } return foo()>0; }()); I'm confused. The

Re: dlang website design

2017-06-22 Thread ag0aep6g via Digitalmars-d
On 06/22/2017 09:19 PM, Ecstatic Coder wrote: The current design may be fine to convincing C++ experts to switch to D, but I don't think it's that effective for less experienced programmers, looking for an alternative to JavaScript, Python or Ruby. I'm a big fan of the python.org website,

Re: struct template constructors

2017-06-22 Thread Boris-Barboris via Digitalmars-d-learn
On Thursday, 22 June 2017 at 20:05:46 UTC, Ali Çehreli wrote: To be complete, 'auto ref' passes lvalues by reference and rvalues by value, which you can detect with __traits(isRef): struct S{ } void foo()(auto ref S s) { static if (__traits(isRef, s)) { pragma(msg, "lvalue");

Re: struct template constructors

2017-06-22 Thread Boris-Barboris via Digitalmars-d-learn
On Thursday, 22 June 2017 at 21:16:40 UTC, Ali Çehreli wrote: And yes, there should be one destructor, which may be a no-op if you grab its resource and set it to null. On all compilers... That's a relief, thank you for your help.

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread MysticZach via Digitalmars-d
On Thursday, 22 June 2017 at 21:41:55 UTC, MysticZach wrote: The whole double parentheses is a bit ugly to me. Is there any problem with out(return > 0) instead of out(r) (r > 0) I'm sorry, I didn't read closely. I think that's just asking for trouble, wanting to use `return` as an

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread Timon Gehr via Digitalmars-d
On 23.06.2017 00:12, MysticZach wrote: On Thursday, 22 June 2017 at 21:56:29 UTC, Timon Gehr wrote: On 22.06.2017 23:51, MysticZach wrote: On Thursday, 22 June 2017 at 21:41:55 UTC, MysticZach wrote: The whole double parentheses is a bit ugly to me. Is there any problem with out(return > 0)

Re: Release candidates vibe.d 0.8.0-rc.1 and vibe-core 1.0.0-rc.1

2017-06-22 Thread Sönke Ludwig via Digitalmars-d-announce
Am 22.06.2017 um 20:52 schrieb aberba: On Thursday, 22 June 2017 at 08:55:06 UTC, Sönke Ludwig wrote: After a last minute path type redesign, the state of the new vibe-core package now finally feels ready for the first official release. The library is in a pretty good shape, with the notable

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-22 Thread Timon Gehr via Digitalmars-d
On 22.06.2017 22:43, jmh530 wrote: On Thursday, 22 June 2017 at 20:19:59 UTC, Timon Gehr wrote: On 22.06.2017 22:02, jmh530 wrote: The whole double parentheses is a bit ugly to me. Is there any problem with out(return > 0) out(a => { void foo()out(b => a == b){ return a; } return

Re: struct template constructors

2017-06-22 Thread Ali Çehreli via Digitalmars-d-learn
On 06/22/2017 02:08 PM, Boris-Barboris wrote: On Thursday, 22 June 2017 at 20:05:46 UTC, Ali Çehreli wrote: To be complete, 'auto ref' passes lvalues by reference and rvalues by value, which you can detect with __traits(isRef): struct S{ } void foo()(auto ref S s) { static if

  1   2   >