Re: RFC: Units of measurement for D (Phobos?)

2015-09-10 Thread David Nadlinger via Digitalmars-d
On Wednesday, 9 September 2015 at 15:21:22 UTC, HaraldZealot wrote: One big problem is, that in SI base unit for mass is kilogram not gram. This is definitely not a "big problem". There is nothing that sets apart the "base" units in my old library from any other units, except for the fact

Re: "Programming in D" paper book is available for purchase

2015-09-10 Thread Ali Çehreli via Digitalmars-d-announce
On 09/09/2015 11:16 PM, Rory McGuire via Digitalmars-d-announce wrote: > the CreateSpace edition is made from cheap paper with a low > density I don't know whether it's an indicator but permanent marker ink bleeds through the page and stains even the next one. I will report whether

Re: friends with phobos, workaround?

2015-09-10 Thread Daniel N via Digitalmars-d-learn
On Thursday, 10 September 2015 at 08:22:29 UTC, Daniel N wrote: import std.typecons; class Awesome1 { private: int val; this(string caller = __MODULE__)(int val) if(caller == "std.conv") // Use scoped!Awesome { this.val = val; } } class Awesome2 { private: int val;

Re: using std.algorithm to find intersection of DateTime[][] arg

2015-09-10 Thread Artem Tarasov via Digitalmars-d-learn
On Wednesday, 9 September 2015 at 20:28:35 UTC, Laeeth Isharc wrote: so setIntersection(arg[0],arg[1],arg[2] .. arg[$-1]) except that I don't know how many series are in arg at compile time. what's the most efficient way to use Phobos to find these? (I could write a loop, but I am trying

Re: Beta D 2.068.2-b1

2015-09-10 Thread ponce via Digitalmars-d-announce
On Thursday, 10 September 2015 at 03:38:31 UTC, Martin Nowak wrote: Please test any of your code against this beta to help finding bugs. All green here.

Re: Beta D 2.068.2-b1

2015-09-10 Thread anonymous via Digitalmars-d-announce
On Thursday, 10 September 2015 at 03:38:31 UTC, Martin Nowak wrote: Due to a regression in 2.068.1 we'll directly follow up with an unplanned point release 2.068.2. This is the beta for that point release. http://downloads.dlang.org/pre-releases/2.x/2.068.2/ Please test any of your code

Re: Status of Win32 C++ interop

2015-09-10 Thread Benjamin Thaut via Digitalmars-d-learn
On Tuesday, 8 September 2015 at 12:56:00 UTC, Laeeth Isharc wrote: This is really very clear and helpful, and I appreciate your taking the time. I will place it on the wiki if that's okay. Thats ok. Library support is surely one of the largest impediments to the adoption of D, and we

Re: friends with phobos, workaround?

2015-09-10 Thread Daniel N via Digitalmars-d-learn
On Wednesday, 9 September 2015 at 23:44:14 UTC, Idan Arye wrote: How about using a mixin template(http://dlang.org/template-mixin.html)? Thanks, it's a good solution. My only reservation is I would prefer to find a way to directly invoke a symbol in std.* as otherwise different frameworks

Re: RFC: Units of measurement for D (Phobos?)

2015-09-10 Thread David Nadlinger via Digitalmars-d
On Wednesday, 9 September 2015 at 07:04:05 UTC, Per Nordlöw wrote: - David's library and quantities use different interal representation. Davids 7-dimensional vector of rational integers (a la Boost) is hardcoded to represent SI units. You must be confusing the library with something else (or

[Issue 15024] Wrong keyword color for Visual Studio Dark theme

2015-09-10 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15024 Rainer Schuetze changed: What|Removed |Added CC||r.sagita...@gmx.de

Re: Beta D 2.068.2-b1

2015-09-10 Thread wobbles via Digitalmars-d-announce
On Thursday, 10 September 2015 at 08:12:19 UTC, anonymous wrote: On Thursday, 10 September 2015 at 03:38:31 UTC, Martin Nowak wrote: [...] I tested a vibe.d project and got lots of linker errors starting with ../../.dub/packages/vibe-d-0.7.24/libvibe-d.a(libevent2_38e3_5d7.o): In Funktion

Re: Beta D 2.068.2-b1

2015-09-10 Thread tchaloupka via Digitalmars-d-announce
On Thursday, 10 September 2015 at 03:38:31 UTC, Martin Nowak wrote: Due to a regression in 2.068.1 we'll directly follow up with an unplanned point release 2.068.2. This is the beta for that point release. http://downloads.dlang.org/pre-releases/2.x/2.068.2/ Please test any of your code

[Issue 15033] Element type of float iota is double

2015-09-10 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15033 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 15033] Element type of float iota is double

2015-09-10 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15033 --- Comment #1 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/c548f3d2e4ea3149ac4ca3f27bb185460211a3f0 Merge pull request

[Issue 15035] New: Possible regression between 2.068.0 and 2.068.1 (2.068.2-b1 also)

2015-09-10 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15035 Issue ID: 15035 Summary: Possible regression between 2.068.0 and 2.068.1 (2.068.2-b1 also) Product: D Version: D2 Hardware: x86_64 OS: Windows

[Issue 14593] operator overloading can't be used with expression templates

2015-09-10 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14593 Martin Nowak changed: What|Removed |Added Status|RESOLVED|REOPENED

Re: using std.algorithm to find intersection of DateTime[][] arg

2015-09-10 Thread deed via Digitalmars-d-learn
On Wednesday, 9 September 2015 at 20:28:35 UTC, Laeeth Isharc wrote: I have a DateTime[][] arg ... I would like to find the intersection of the dates. A suggestion: auto minLength = arg.map!(a => a.length).reduce!min; auto minIdx = arg.map!(a => a.length).countUntil(minLength);

Re: std.experimental.testing formal review

2015-09-10 Thread Atila Neves via Digitalmars-d
On Wednesday, 9 September 2015 at 18:54:30 UTC, Brian Schott wrote: On Wednesday, 9 September 2015 at 15:20:41 UTC, Robert burner Schadek wrote: This post marks the start of the two week review process of std.experimental.testing. PR: https://github.com/D-Programming-Language/phobos/pull/3207

Re: Beta D 2.068.2-b1

2015-09-10 Thread anonymous via Digitalmars-d-announce
On Thursday, 10 September 2015 at 09:56:40 UTC, wobbles wrote: Maybe try running dub build --force (to make it rebuild all of vibes dependencies also. Might solve it... no effect:(

[Issue 14593] operator overloading can't be used with expression templates

2015-09-10 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14593 --- Comment #4 from Martin Nowak --- The worst with string arguments is that they can't use variables from the calling scope. --

Re: What is the difference between D and C++ regarding Unique, RefCounted and Scoped?

2015-09-10 Thread Gary Willoughby via Digitalmars-d-learn
On Wednesday, 9 September 2015 at 23:22:49 UTC, ponce wrote: - RefCounted Only for D structs. std::shared_ptr works for all. RefCounted works with classes as well. http://dlang.org/phobos/std_typecons.html#.RefCounted

Re: What is the difference between D and C++ regarding Unique, RefCounted and Scoped?

2015-09-10 Thread Gary Willoughby via Digitalmars-d-learn
On Thursday, 10 September 2015 at 12:34:54 UTC, Daniel Kozák wrote: On Thu, 10 Sep 2015 11:38:35 + "Gary Willoughby" wrote: On Wednesday, 9 September 2015 at 23:22:49 UTC, ponce wrote: > - RefCounted > > Only for D structs. std::shared_ptr works for all. RefCounted works

Re: friends with phobos, workaround?

2015-09-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 9 September 2015 at 23:44:14 UTC, Idan Arye wrote: public: mixin MakeUnique!(int); I actually think that should be a free function in the module because then it can be used by derived classes too without having to mix it in each of them as well.

Re: friends with phobos, workaround?

2015-09-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 10 September 2015 at 08:22:29 UTC, Daniel N wrote: this(string caller = __MODULE__)(int val) if(caller == "std.conv") // Use scoped!Awesome That's disgustingly genius. I'm a bit jealous I didn't think of it myself! One slight problem though: you couldn't call super() from

Re: ref parameter qualifier and static arrays

2015-09-10 Thread Paul via Digitalmars-d-learn
On Wednesday, 9 September 2015 at 20:35:53 UTC, anonymous wrote: When you pass a slice (without ref), what's actually passed is a pointer and length. The contents are not copied. That means, when you alter an array element, the change will be done the original, even without ref: Thanks

[Issue 15035] Possible regression between 2.068.0 and 2.068.1 (2.068.2-b1 also)

2015-09-10 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15035 --- Comment #1 from Tomáš Chaloupka --- Hm, as I tried to reproduce it it works with 2.068.0, does not work with 2.068.1 and after reinstalation it seems to work with 2.068.2-b1 althought I'm pretty sure that was the version I

Re: std.allocator ready for some abuse

2015-09-10 Thread Ilya Yaroshenko via Digitalmars-d
On Friday, 1 November 2013 at 02:33:57 UTC, Andrei Alexandrescu wrote: Added SharedFreelist, a lock-free freelist. http://erdani.com/d/phobos-prerelease/std_allocator.html#.SharedFreelist Andrei Hi Andrei, Please check this bug fix for SharedFreelist

Re: Programming in D – Tutorial and Reference

2015-09-10 Thread burjui via Digitalmars-d-announce
On Monday, 31 August 2015 at 01:22:58 UTC, puming wrote: Can we post a text without link and people could copy/paste the address? Will HN check that also? There's no way for them to do that, since all they will have access to is the URL. But if you click the link, your browser will add a

Re: What is the difference between D and C++ regarding Unique, RefCounted and Scoped?

2015-09-10 Thread Daniel Kozák via Digitalmars-d-learn
On Thu, 10 Sep 2015 11:38:35 + "Gary Willoughby" wrote: > On Wednesday, 9 September 2015 at 23:22:49 UTC, ponce wrote: > > - RefCounted > > > > Only for D structs. std::shared_ptr works for all. > > RefCounted works with classes as well. > >

Re: Sum and other algorithm functions

2015-09-10 Thread anonymous via Digitalmars-d-learn
On Thursday 10 September 2015 15:48, Namal wrote: > Hello, > > how can I define the range for the sum function which I want to > sum up? For instance how do I sum up the first 3 elements of an > array > > int[] a = [1,2,3,4,5,6,7,8,9]; > > or the last 3? First you slice the first/last 3,

Re: Sum and other algorithm functions

2015-09-10 Thread Andrea Fontana via Digitalmars-d-learn
On Thursday, 10 September 2015 at 13:48:16 UTC, Namal wrote: Hello, how can I define the range for the sum function which I want to sum up? For instance how do I sum up the first 3 elements of an array int[] a = [1,2,3,4,5,6,7,8,9]; or the last 3? In this case, you can simply slice array

Re: std.experimental.testing formal review

2015-09-10 Thread Dmitry Olshansky via Digitalmars-d
On 09-Sep-2015 18:20, Robert burner Schadek wrote: This post marks the start of the two week review process of std.experimental.testing. PR: https://github.com/D-Programming-Language/phobos/pull/3207 Dub: http://code.dlang.org/packages/unit-threaded Doc: See CyberShadow/DAutoTest for up-to-date

Re: What's the ETA for 2.068?

2015-09-10 Thread Marco Leise via Digitalmars-d
Am Wed, 17 Jun 2015 14:12:46 +0200 schrieb Marco Leise : > Am Sat, 13 Jun 2015 09:01:27 + > schrieb "Vladimir Panteleev" : > > > On Saturday, 13 June 2015 at 00:13:23 UTC, Marco Leise wrote: > > > Am Thu, 11 Jun 2015 06:26:29 + > > >

Sum and other algorithm functions

2015-09-10 Thread Namal via Digitalmars-d-learn
Hello, how can I define the range for the sum function which I want to sum up? For instance how do I sum up the first 3 elements of an array int[] a = [1,2,3,4,5,6,7,8,9]; or the last 3?

[Issue 14824] A stale function might get called when unloading shared libraries on FBSD

2015-09-10 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14824 ponce changed: What|Removed |Added CC||alil...@gmail.com --- Comment #1

Re: std.experimental.testing formal review

2015-09-10 Thread wobbles via Digitalmars-d
On Thursday, 10 September 2015 at 14:03:31 UTC, Dmitry Olshansky wrote: On 09-Sep-2015 18:20, Robert burner Schadek wrote: This post marks the start of the two week review process of std.experimental.testing. PR: https://github.com/D-Programming-Language/phobos/pull/3207 Dub:

[Issue 13989] add system-specific ext to -of parameter if ext is invalid

2015-09-10 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13989 bb.t...@gmx.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

Re: Member function pointers

2015-09-10 Thread John Colvin via Digitalmars-d
On Thursday, 10 September 2015 at 01:52:17 UTC, digitalmars.D wrote: On 10 September 2015 at 04:55, Walter Bright via Digitalmars-d wrote: On 6/10/2013 7:33 AM, Manu wrote: [...] Sorry to say, your n.g. poster is back to its old tricks :-) We've resolved

Re: Beta D 2.068.2-b1

2015-09-10 Thread anonymous via Digitalmars-d-announce
On Thursday, 10 September 2015 at 11:44:42 UTC, anonymous wrote: On Thursday, 10 September 2015 at 09:56:40 UTC, wobbles wrote: Maybe try running dub build --force (to make it rebuild all of vibes dependencies also. Might solve it... no effect:( After uninstalling dmd 2.068 andinstalling

Re: Member function pointers

2015-09-10 Thread Vladimir Panteleev via Digitalmars-d
On Thursday, 10 September 2015 at 16:18:13 UTC, John Colvin wrote: On Thursday, 10 September 2015 at 01:52:17 UTC, digitalmars.D wrote: On 10 September 2015 at 04:55, Walter Bright via Digitalmars-d wrote: On 6/10/2013 7:33 AM, Manu wrote: [...] Sorry to say,

Re: Better lambdas!!!!!!!!!!

2015-09-10 Thread Ali Çehreli via Digitalmars-d
On 09/10/2015 10:55 AM, Prudence wrote: > How bout this: > > void myfunc(double delegate(int i, int z, float f)) {} > > > myfunc((int i, int z, float f) { return i*z*f; } } > > vs > > myfunc({ return i*z*f; }) // Names of parameters are inferred from > signature. Considering other features

Re: Beta D 2.068.2-b1

2015-09-10 Thread Martin Nowak via Digitalmars-d-announce
On Thursday, 10 September 2015 at 08:12:19 UTC, anonymous wrote: I tested a vibe.d project and got lots of linker errors starting with ../../.dub/packages/vibe-d-0.7.24/libvibe-d.a(libevent2_38e3_5d7.o): In Funktion

Re: Beta D 2.068.2-b1

2015-09-10 Thread Martin Nowak via Digitalmars-d-announce
On Thursday, 10 September 2015 at 17:14:03 UTC, anonymous wrote: After uninstalling dmd 2.068 andinstalling the .deb package instead of downloading+extracting the tar.xz everything works fine! The tar.xz package should work as well.

Better lambdas!!!!!!!!!!

2015-09-10 Thread Prudence via Digitalmars-d
How bout this: void myfunc(double delegate(int i, int z, float f)) {} myfunc((int i, int z, float f) { return i*z*f; } } vs myfunc({ return i*z*f; }) // Names of parameters are inferred from signature. by specifying the parameter names in the signature, we don't have to specify

Re: Better lambdas!!!!!!!!!!

2015-09-10 Thread anonymous via Digitalmars-d
On Thursday, 10 September 2015 at 17:55:06 UTC, Prudence wrote: Of course, this hides the names outside the lambda, but a warning could be issued(no different than if one does it explicitly. This makes the parameter names part of the API. The author of a library is unable to rename parameter

Re: Version for windows/console compilation?

2015-09-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 10 September 2015 at 18:06:43 UTC, Prudence wrote: Is there a flag for knowing when a project is compiling for windows(Uses WinMain) vs a console(normal main)? You'd have to choose the main yourself anyway, so document what process you use for that for people to use. BTW it is

Re: Release D 2.068.1

2015-09-10 Thread Jack Stouffer via Digitalmars-d-announce
On Sunday, 6 September 2015 at 22:32:54 UTC, Martin Nowak wrote: Glad to announce D 2.068.1. http://downloads.dlang.org/releases/2.x/2.068.1/ This point release comes with many regression and bug fixes over 2.068.0, see the changelog for more details. http://dlang.org/changelog.html#2.068.1

Re: Detecting premature end of spawned threads with std.concurrency

2015-09-10 Thread Ali Çehreli via Digitalmars-d-learn
On 09/03/2015 02:20 PM, Matt Kline wrote: > neither the docs nor the current Phobos implementation > make any mention of such exceptions. There is LinkTerminated but you must use spawnLinked(): http://dlang.org/phobos/std_concurrency.html#.LinkTerminated

Version for windows/console compilation?

2015-09-10 Thread Prudence via Digitalmars-d-learn
Is there a flag for knowing when a project is compiling for windows(Uses WinMain) vs a console(normal main)? version(Windows) is always valid for a console app, so it is useless to disambiguate between a console app and a windows app. (Say I have both a main and a winmain in my code, I need

Re: Release D 2.068.1

2015-09-10 Thread Steven Schveighoffer via Digitalmars-d-announce
On 9/10/15 1:46 PM, Jack Stouffer wrote: On Sunday, 6 September 2015 at 22:32:54 UTC, Martin Nowak wrote: Glad to announce D 2.068.1. http://downloads.dlang.org/releases/2.x/2.068.1/ This point release comes with many regression and bug fixes over 2.068.0, see the changelog for more details.

Re: Release D 2.068.1

2015-09-10 Thread Martin Nowak via Digitalmars-d-announce
On Thursday, 10 September 2015 at 18:27:08 UTC, Steven Schveighoffer wrote: I think we can fix this. Looks like the version string is generated on build, and has no effect on the code at all. -Steve Will check what went wrong there.

Re: Member function pointers

2015-09-10 Thread via Digitalmars-d
On Thursday, 10 September 2015 at 21:29:15 UTC, Vladimir Panteleev wrote: Doesn't happen here, so that's something local to you, almost surely unrelated to the above. Try clearing your cookies. Yes, it was caused by cookies, but it wasn't local since it returned a HTTP status 500. It happend

Re: private selective import not so private ?

2015-09-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 11 September 2015 at 00:52:00 UTC, BBasile wrote: While trying to get why some call to memmove without the right import didn't lead to a compilation failure i've found that imported symbols are not private ! Is that a bug ? The specs don't say that a selective import is public !

Re: Version for windows/console compilation?

2015-09-10 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 10 September 2015 at 18:10:43 UTC, Adam D. Ruppe wrote: BTW it is pretty rare that you should actually write a WinMain in D. The right thing to do in most cases is to write a normal main function. You can still get the windows gui subsystem with a linker flag. Specifically,

Re: Looking for someone that could work on 32 bits support for SDC

2015-09-10 Thread deadalnix via Digitalmars-d
On Friday, 11 September 2015 at 01:12:21 UTC, Brandon Ragland wrote: On Wednesday, 9 September 2015 at 20:33:43 UTC, deadalnix wrote: All is in the title. ARM/Mips/pNaCl/WebAssembly require 32bits to work. These are valuable targets IMO. I can provide support, but I just don't have the

Re: Beta D 2.068.2-b1

2015-09-10 Thread Brian Schott via Digitalmars-d-announce
On Thursday, 10 September 2015 at 03:38:31 UTC, Martin Nowak wrote: Due to a regression in 2.068.1 we'll directly follow up with an unplanned point release 2.068.2. This is the beta for that point release. http://downloads.dlang.org/pre-releases/2.x/2.068.2/ Please test any of your code

Re: Better lambdas!!!!!!!!!!

2015-09-10 Thread Idan Arye via Digitalmars-d
On Thursday, 10 September 2015 at 21:03:12 UTC, Meta wrote: On Thursday, 10 September 2015 at 20:56:58 UTC, Ola Fosheim Grøstad wrote: If there is a conflict you should use a regular lambda on the outer one? You could, but then doesn't that defeat the point a bit? My example was

Re: A collection of DIPs

2015-09-10 Thread Brandon Ragland via Digitalmars-d
On Wednesday, 9 September 2015 at 18:21:32 UTC, NX wrote: On Wednesday, 9 September 2015 at 14:00:52 UTC, Brandon Ragland wrote: It's slow, really slow, and stopping the entire world is painful, even in trivial user applications. A pause for even half a second or less on the UI makes the

Re: A collection of DIPs

2015-09-10 Thread Brandon Ragland via Digitalmars-d
On Wednesday, 9 September 2015 at 20:42:35 UTC, Laeeth Isharc wrote: On Wednesday, 9 September 2015 at 14:00:52 UTC, Brandon Ragland wrote: D has zero use in anything time sensitive. You mean, for example, like dealing with data for a billion customers and responding in a few hundred

Re: shared array?

2015-09-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 11 September 2015 at 00:48:28 UTC, Prudence wrote: static Array!(bool delegate(int, WPARAM, LPARAM)) callbacks; Try just using a regular array instead of the library Array. static bool delegate(int, WPARAM, LPARAM)[] callbacks; my guess is the Array library thing isn't marked as

Re: Looking for someone that could work on 32 bits support for SDC

2015-09-10 Thread Brandon Ragland via Digitalmars-d
On Wednesday, 9 September 2015 at 20:33:43 UTC, deadalnix wrote: All is in the title. ARM/Mips/pNaCl/WebAssembly require 32bits to work. These are valuable targets IMO. I can provide support, but I just don't have the bandwidth to pull it by myself. If someone could step up, that'd be

shared array?

2015-09-10 Thread Prudence via Digitalmars-d-learn
I can't create a shared array: static Array!(bool delegate(int, WPARAM, LPARAM)) callbacks; (prepending shared produce a ton of errors with the Array class) I've tried making it a pointer and other things. The array must be static and must be shared. Without shared everything works but I

Re: "Programming in D" paper book is available for purchase

2015-09-10 Thread Ali Çehreli via Digitalmars-d-announce
On 09/10/2015 12:40 PM, Rory McGuire via Digitalmars-d-announce wrote: > the content of the book and the contents layout is really very > well done. Thank you for the kind words. It took a lot of time but there is still room for improvement. I had to repeat "good enough is good enough." :) >

Re: private selective import not so private ?

2015-09-10 Thread BBasile via Digitalmars-d-learn
On Friday, 11 September 2015 at 00:55:41 UTC, Adam D. Ruppe wrote: On Friday, 11 September 2015 at 00:52:00 UTC, BBasile wrote: While trying to get why some call to memmove without the right import didn't lead to a compilation failure i've found that imported symbols are not private ! Is that

Re: A collection of DIPs

2015-09-10 Thread Brandon Ragland via Digitalmars-d
On Wednesday, 9 September 2015 at 18:21:32 UTC, NX wrote: On Wednesday, 9 September 2015 at 14:00:52 UTC, Brandon Ragland wrote: It's slow, really slow, and stopping the entire world is painful, even in trivial user applications. A pause for even half a second or less on the UI makes the

Re: Member function pointers

2015-09-10 Thread Vladimir Panteleev via Digitalmars-d
On Thursday, 10 September 2015 at 21:24:17 UTC, Ola Fosheim Grøstad wrote: On Thursday, 10 September 2015 at 20:15:15 UTC, Vladimir Panteleev wrote: On Thursday, 10 September 2015 at 19:40:02 UTC, Ola Fosheim Grøstad wrote: On Thursday, 10 September 2015 at 16:24:52 UTC, Vladimir Panteleev

Re: Member function pointers

2015-09-10 Thread data man via Digitalmars-d
On Thursday, 10 September 2015 at 16:24:52 UTC, Vladimir Panteleev wrote: ... Heh. My fault. Fixed (though it'll stick for that post in some views). Correct a "D-Runtime" topic, please. It is not updated.

private selective import not so private ?

2015-09-10 Thread BBasile via Digitalmars-d-learn
While trying to get why some call to memmove without the right import didn't lead to a compilation failure i've found that imported symbols are not private ! Is that a bug ? The specs don't say that a selective import is public ! -- other.d -- module other; private import core.stdc.string:

Re: Enumap -- a lightweight AA alternative when your keys are enums

2015-09-10 Thread SimonN via Digitalmars-d-announce
On Friday, 11 September 2015 at 04:02:17 UTC, rcorre wrote: On Friday, 11 September 2015 at 03:25:58 UTC, SimonN wrote: Hi, I've ran into a compilation error when iterating over a const Enumap. In the following code: Interesting, thanks for pointing that out. I don't think I did a great job

Re: Version for windows/console compilation?

2015-09-10 Thread Prudence via Digitalmars-d-learn
On Friday, 11 September 2015 at 01:36:31 UTC, Mike Parker wrote: On Thursday, 10 September 2015 at 18:10:43 UTC, Adam D. Ruppe wrote: BTW it is pretty rare that you should actually write a WinMain in D. The right thing to do in most cases is to write a normal main function. You can still get

Re: std.allocator ready for some abuse

2015-09-10 Thread bitwise via Digitalmars-d
On Thursday, 24 October 2013 at 19:53:56 UTC, Andrei Alexandrescu wrote: Code: https://github.com/andralex/phobos/blob/allocator/std/allocator.d Dox: http://erdani.com/d/phobos-prerelease/std_allocator.html Am I the only one seeing dead links?

Re: Enumap -- a lightweight AA alternative when your keys are enums

2015-09-10 Thread rcorre via Digitalmars-d-announce
On Friday, 11 September 2015 at 03:25:58 UTC, SimonN wrote: Hi, this looks excellent! I've been playing around with it, and am looking forward to using it regularly. I've ran into a compilation error when iterating over a const Enumap. In the following code: import std.stdio;

Enumap -- a lightweight AA alternative when your keys are enums

2015-09-10 Thread rcorre via Digitalmars-d-announce
I frequently find myself needing a data structure that maps each member of an enum to a value; something similar what Java calls an EnumMap (http://docs.oracle.com/javase/7/docs/api/java/util/EnumMap.html). I couldn't find any D implementation out there, so I wrote a little module for it.

Re: shared array?

2015-09-10 Thread Prudence via Digitalmars-d-learn
On Friday, 11 September 2015 at 00:50:15 UTC, Adam D. Ruppe wrote: On Friday, 11 September 2015 at 00:48:28 UTC, Prudence wrote: static Array!(bool delegate(int, WPARAM, LPARAM)) callbacks; Try just using a regular array instead of the library Array. static bool delegate(int, WPARAM,

Re: Enumap -- a lightweight AA alternative when your keys are enums

2015-09-10 Thread SimonN via Digitalmars-d-announce
On Friday, 11 September 2015 at 02:17:25 UTC, rcorre wrote: I frequently find myself needing a data structure that maps each member of an enum to a value; something similar what Java calls an EnumMap (http://docs.oracle.com/javase/7/docs/api/java/util/EnumMap.html). I couldn't find any D

[Issue 15027] cannot pass arguments of type DirEntry to std.file functions

2015-09-10 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15027 --- Comment #1 from Kenji Hara --- It's hard to resolve issue with current D language features. Reduced case: void popFront(T)(ref T[] a) { a = a[1..$]; } enum bool isInputRange(R) = is(typeof( { R r;

[Issue 14870] incorrect use of assert to detect environmental errors in core.time

2015-09-10 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14870 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/druntime https://github.com/D-Programming-Language/druntime/commit/3f9c4a6f3daa4e296e3404fe9714d1f03d73dc50 Fix issue 14870 -

Re: Better lambdas!!!!!!!!!!

2015-09-10 Thread wobbles via Digitalmars-d
On Thursday, 10 September 2015 at 18:23:52 UTC, Jonathan M Davis wrote: On Thursday, 10 September 2015 at 18:05:43 UTC, anonymous wrote: On Thursday, 10 September 2015 at 17:55:06 UTC, Prudence wrote: Of course, this hides the names outside the lambda, but a warning could be issued(no

Re: Better lambdas!!!!!!!!!!

2015-09-10 Thread via Digitalmars-d
On Thursday, 10 September 2015 at 17:55:06 UTC, Prudence wrote: by specifying the parameter names in the signature, we don't have to specify them in the lamba creation. This doesn't replace the original way, just adds the ability to infer the names if they are not specified. Of course, this

[Issue 14798] [etc.c.sqlite3] sqlite3_errstr definition missing

2015-09-10 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14798 --- Comment #2 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/ac701a6cb9adac80d83f98b08faf2a0baf59e664 etc.c.sqlite3: Fix and

[Issue 14870] incorrect use of assert to detect environmental errors in core.time

2015-09-10 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14870 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

Re: Member function pointers

2015-09-10 Thread via Digitalmars-d
On Thursday, 10 September 2015 at 16:24:52 UTC, Vladimir Panteleev wrote: Heh. My fault. Fixed (though it'll stick for that post in some views). Now the main index says: "Unexpected end of input when converting from type string to type long".

Re: "Programming in D" paper book is available for purchase

2015-09-10 Thread Rory McGuire via Digitalmars-d-announce
On Thu, Sep 10, 2015 at 8:16 AM, Rory McGuire wrote: > On Thu, Sep 10, 2015 at 6:18 AM, Paul O'Neil via Digitalmars-d-announce < > digitalmars-d-announce@puremagic.com> wrote: > >> On 09/08/2015 02:43 AM, Ali Çehreli wrote: >> I understand that you may not have the

[Issue 14798] [etc.c.sqlite3] sqlite3_errstr definition missing

2015-09-10 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14798 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

C# Proposal for Nullability Checking

2015-09-10 Thread Meta via Digitalmars-d
https://github.com/dotnet/roslyn/issues/5032 There've always been rumblings here about removing nullable references from D, but that's a large break in backwards compatibility that we can't really afford at this point (outside some magic compiler switch). This C# proposal has some

Re: Better lambdas!!!!!!!!!!

2015-09-10 Thread Meta via Digitalmars-d
On Thursday, 10 September 2015 at 19:37:53 UTC, Ola Fosheim Grøstad wrote: How about just having numbered parameters like this: { $2 < ($1*$2) } What about this situation? [[1, 2], [3, 4], [5, 6]].reduce!{ auto localMax = { $1 > $2 ? $1 : $2; } auto first = $1.reduce!localMax;

Re: Better lambdas!!!!!!!!!!

2015-09-10 Thread Meta via Digitalmars-d
On Thursday, 10 September 2015 at 20:10:49 UTC, Meta wrote: On Thursday, 10 September 2015 at 19:37:53 UTC, Ola Fosheim Grøstad wrote: How about just having numbered parameters like this: { $2 < ($1*$2) } What about this situation? [[1, 2], [3, 4], [5, 6]].reduce!{ auto localMax = { $1

Re: Better lambdas!!!!!!!!!!

2015-09-10 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 10 September 2015 at 19:37:53 UTC, Ola Fosheim Grøstad wrote: How about just having numbered parameters like this: { $2 < ($1*$2) } The string lambdas Phobos supports basically does this: `b < a*b` would work in there. These are falling out of favor with the new syntax in the

Re: Better lambdas!!!!!!!!!!

2015-09-10 Thread via Digitalmars-d
On Thursday, 10 September 2015 at 20:51:18 UTC, Adam D. Ruppe wrote: The string lambdas Phobos supports basically does this: `b < a*b` would work in there. These are falling out of favor with the new syntax in the language, but they are still supported by most the library. Isn't that a

Re: Better lambdas!!!!!!!!!!

2015-09-10 Thread via Digitalmars-d
On Thursday, 10 September 2015 at 20:10:49 UTC, Meta wrote: How can the compiler tell which $1 and $2 is which? What if one wants to access both the outer $1 and the inner $1 in localMax? If there is a conflict you should use a regular lambda on the outer one?

Re: Better lambdas!!!!!!!!!!

2015-09-10 Thread Meta via Digitalmars-d
On Thursday, 10 September 2015 at 20:56:58 UTC, Ola Fosheim Grøstad wrote: If there is a conflict you should use a regular lambda on the outer one? You could, but then doesn't that defeat the point a bit? My example was off-the-cuff, but the point is that we already have a fairly concise

Re: Can we get a video tutorial?

2015-09-10 Thread Stephen via Digitalmars-d-learn
On Friday, 4 September 2015 at 16:11:59 UTC, Stephen wrote: On Friday, 4 September 2015 at 05:51:02 UTC, Mike Parker wrote: * What was previously said * * Bump * Hopefully I'm allowed to bump this...?

Re: Member function pointers

2015-09-10 Thread Vladimir Panteleev via Digitalmars-d
On Thursday, 10 September 2015 at 19:40:02 UTC, Ola Fosheim Grøstad wrote: On Thursday, 10 September 2015 at 16:24:52 UTC, Vladimir Panteleev wrote: Heh. My fault. Fixed (though it'll stick for that post in some views). Now the main index says: "Unexpected end of input when converting from

Re: Member function pointers

2015-09-10 Thread via Digitalmars-d
On Thursday, 10 September 2015 at 20:15:15 UTC, Vladimir Panteleev wrote: On Thursday, 10 September 2015 at 19:40:02 UTC, Ola Fosheim Grøstad wrote: On Thursday, 10 September 2015 at 16:24:52 UTC, Vladimir Panteleev wrote: Heh. My fault. Fixed (though it'll stick for that post in some views).

Re: Better lambdas!!!!!!!!!!

2015-09-10 Thread via Digitalmars-d
On Thursday, 10 September 2015 at 21:03:12 UTC, Meta wrote: On Thursday, 10 September 2015 at 20:56:58 UTC, Ola Fosheim Grøstad wrote: If there is a conflict you should use a regular lambda on the outer one? You could, but then doesn't that defeat the point a bit? My example was

Re: "Programming in D" paper book is available for purchase

2015-09-10 Thread Rory McGuire via Digitalmars-d-announce
On Thu, Sep 10, 2015 at 6:18 AM, Paul O'Neil via Digitalmars-d-announce < digitalmars-d-announce@puremagic.com> wrote: > On 09/08/2015 02:43 AM, Ali Çehreli wrote: > I understand that you may not have the IngramSpark edition yet, so an > answer may have to wait: > > Which publisher produces the

Calling D from C, C++, Python…

2015-09-10 Thread Russel Winder via Digitalmars-d-learn
Is there an easy way of knowing when you do not have to initialize the D runtime system to call D code from, in this case, Python via a C adapter? I naïvely transformed some C++ to D, without consideration of D runtime systems, compiled it and it all worked. Which is good, but… -- Russel.

Re: Better lambdas!!!!!!!!!!

2015-09-10 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 10 September 2015 at 17:55:06 UTC, Prudence wrote: void myfunc(double delegate(int i, int z, float f)) {} myfunc((int i, int z, float f) { return i*z*f; } } You could also write `myfunc((i,z,f) => i*z*f);` right now. The names are easy to do.

Re: Better lambdas!!!!!!!!!!

2015-09-10 Thread Jonathan M Davis via Digitalmars-d
On Thursday, 10 September 2015 at 18:05:43 UTC, anonymous wrote: On Thursday, 10 September 2015 at 17:55:06 UTC, Prudence wrote: Of course, this hides the names outside the lambda, but a warning could be issued(no different than if one does it explicitly. This makes the parameter names part