Re: DMD 2.066 Alpha

2014-06-11 Thread deadalnix via Digitalmars-d-announce
On Wednesday, 11 June 2014 at 04:17:04 UTC, Andrew Edwards wrote: On 6/10/14, 10:01 PM, Brian Schott wrote: Please do not tag anything until we decide if virtual is a keyword in D. See: https://github.com/D-Programming-Language/dlang.org/pull/584 The branch will not be created until 30

Re: hap.random: a new random number library for D

2014-06-11 Thread Joseph Rushton Wakeling via Digitalmars-d-announce
On Tuesday, 10 June 2014 at 23:08:33 UTC, Chris Cain wrote: I had an opportunity to give the entire code a good once over read and I have a few comments. Thanks! :-) 1. Biggest thing about the new hap.random is how much nicer it is to actually READ. The first few times I went through the

Re: hap.random: a new random number library for D

2014-06-11 Thread Joseph Rushton Wakeling via Digitalmars-d-announce
On Tuesday, 10 June 2014 at 23:48:09 UTC, bearophile wrote: Please stop, I am not worth that, and I don't even know how much good that generator is. So for you it's better to focus on more important matters of the new random module. Extra generators can be added later if needed. After all

Re: hap.random: a new random number library for D

2014-06-11 Thread Joseph Rushton Wakeling via Digitalmars-d-announce
On Monday, 9 June 2014 at 18:09:21 UTC, Joseph Rushton Wakeling wrote: Hello all, Incidentally, would it be a good idea to post a link to the blog post on r/programming? Haven't done so yet, as generally I prefer to leave decisions about D publicity to others, but can do so if people would

Re: Adam D. Ruppe's D Cookbook now available!

2014-06-11 Thread Jacob Carlborg via Digitalmars-d-announce
On 10/06/14 19:43, Adam D. Ruppe wrote: blargh, I thought it could do more. Does it at least work to pull out extern C functions from a C++ header? Hmm, I haven't tried that. You need to specified which language to use. Currently DStep has hard coded its language support, in which C++ is not

Re: hap.random: a new random number library for D

2014-06-11 Thread Nick Sabalausky via Digitalmars-d-announce
On 6/10/2014 7:08 PM, Chris Cain wrote: 3. I'd also REALLY like to see seed support ranges/values giving ANY type of integer and guarantee that few bytes are wasted (so, if it supplies 64-bit ints and the generator's internal state array only accepts 32-bit ints, it should spread the 64-bit int

Re: hap.random: a new random number library for D

2014-06-11 Thread Nick Sabalausky via Digitalmars-d-announce
On 6/11/2014 2:41 AM, Joseph Rushton Wakeling wrote: 5. Another possible improvement would be something akin to a remix function. It should work identically to reseeding, but instead of setting the internal state to match the seed (as I see in

Re: hap.random: a new random number library for D

2014-06-11 Thread Chris Cain via Digitalmars-d-announce
On Wednesday, 11 June 2014 at 06:41:34 UTC, Joseph Rushton Wakeling wrote: That would be very cool. Can you point me at your code examples? It's written in Nimrod (in a way that someone who learned Nimrod the day before would write them, because I learned Nimrod the day before and worked on

Re: hap.random: a new random number library for D

2014-06-11 Thread Andrea Fontana via Digitalmars-d-announce
Have you any plan to implement CMWC? http://en.wikipedia.org/wiki/Multiply-with-carry#Complementary-multiply-with-carry_generators On Monday, 9 June 2014 at 18:09:21 UTC, Joseph Rushton Wakeling wrote: Hello all, Some of you may remember my earlier draft of a class-based std.random

Re: QtE - D small binding for Qt.

2014-06-11 Thread MGW via Digitalmars-d-announce
Example of D (dmd 2.065 64) with Qt 64 Windows64/Linux64. Running programs *.EXE with key --debug. http://yadi.sk/d/qLE7Kgz9SpKEX

Re: DlangUI

2014-06-11 Thread Vadim Lopatin via Digitalmars-d-announce
On Thursday, 5 June 2014 at 14:22:46 UTC, Mike James wrote: First problem: you need to add gl3n to the git clone list for developing under Visual-D. Fixed. I've removed gl3n and libpng references from project. I am having problems running (debugging) the example1 program. When loading the

Re: hap.random: a new random number library for D

2014-06-11 Thread Joseph Rushton Wakeling via Digitalmars-d-announce
On Wednesday, 11 June 2014 at 07:42:10 UTC, Andrea Fontana wrote: Have you any plan to implement CMWC? http://en.wikipedia.org/wiki/Multiply-with-carry#Complementary-multiply-with-carry_generators I hadn't made any concrete plans about that particular family of generators (my impression was

Re: DlangUI

2014-06-11 Thread Vadim Lopatin via Digitalmars-d-announce
On Thursday, 5 June 2014 at 19:58:10 UTC, Casper Færgemand wrote: On Thursday, 5 June 2014 at 16:10:00 UTC, Mike James wrote: I checked the sub-directory the loading refers to and all the pngs seems to be there. I managed to get the files from github just fine, but dub says it is unable to

Re: DMD 2.066 Alpha

2014-06-11 Thread Andrew Edwards via Digitalmars-d-announce
On 6/11/14, 2:23 AM, deadalnix wrote: I'll be there to test and bug report ! Thank for being the release lieutenant. In my world a lieutenant is absolutely useless. Given the tutelage and guidance of solid staff non-commissioned officer, some day they will become productive members of the

Re: DMD 2.066 Alpha

2014-06-11 Thread Iain Buclaw via Digitalmars-d-announce
On 11 June 2014 14:19, Andrew Edwards via Digitalmars-d-announce digitalmars-d-announce@puremagic.com wrote: On 6/11/14, 2:23 AM, deadalnix wrote: I'll be there to test and bug report ! Thank for being the release lieutenant. In my world a lieutenant is absolutely useless. Given the

Re: hap.random: a new random number library for D

2014-06-11 Thread Kagamin via Digitalmars-d-announce
On Tuesday, 10 June 2014 at 10:57:32 UTC, bearophile wrote: Kagamin: Pass it by reference, I see no reason why MT can't be pure. I meant strongly pure :-) I'm afraid, this pure rng pattern precludes all pure optimizations, so it's effectively weakly pure.

Re: hap.random: a new random number library for D

2014-06-11 Thread Kagamin via Digitalmars-d-announce
On Tuesday, 10 June 2014 at 23:08:33 UTC, Chris Cain wrote: 4. I'd just like to say the idea of using ranges for seeds gets me giddy because I could totally see a range that queries https://random.org for true random bits to seed with, wrapped by a range that zeroes out the memory on popFront.

Re: DMD 2.066 Alpha

2014-06-11 Thread Andrew Edwards via Digitalmars-d-announce
On 6/11/14, 11:24 AM, Iain Buclaw via Digitalmars-d-announce wrote: On 11 June 2014 14:19, Andrew Edwards via Digitalmars-d-announce digitalmars-d-announce@puremagic.com wrote: On 6/11/14, 2:23 AM, deadalnix wrote: I'll be there to test and bug report ! Thank for being the release lieutenant.

Re: DMD 2.066 Alpha

2014-06-11 Thread Nick Sabalausky via Digitalmars-d-announce
On 6/11/2014 9:19 AM, Andrew Edwards wrote: On 6/11/14, 2:23 AM, deadalnix wrote: I'll be there to test and bug report ! Thank for being the release lieutenant. In my world a lieutenant is absolutely useless. Given the tutelage and guidance of solid staff non-commissioned officer, some day

Re: DMD 2.066 Alpha

2014-06-11 Thread Iain Buclaw via Digitalmars-d-announce
On 11 June 2014 17:56, Andrew Edwards via Digitalmars-d-announce digitalmars-d-announce@puremagic.com wrote: On 6/11/14, 11:24 AM, Iain Buclaw via Digitalmars-d-announce wrote: On 11 June 2014 14:19, Andrew Edwards via Digitalmars-d-announce digitalmars-d-announce@puremagic.com wrote: On

Re: hap.random: a new random number library for D

2014-06-11 Thread Nick Sabalausky via Digitalmars-d-announce
On 6/11/2014 12:35 PM, Kagamin wrote: In some scenarios impredictability is not enough. For example, when you generate a session id, an attacker doesn't have to predict it ahead of time, he can guess it at any time later. And if they listen to radio waves - that's an open protocol, an attacker

Re: DConf 2014 Day 1 Talk 4: Inside the Regular Expressions in D by Dmitry Olshansky

2014-06-11 Thread Atila Neves via Digitalmars-d-announce
On Tuesday, 10 June 2014 at 19:36:57 UTC, bearophile wrote: At about 40.42 in the Thoughts on static regex there is written even compile-time printf would be awesome. There is a patch about __ctWrite in GitHug, it should be fixed and merged. Bye, bearophile I wish I'd taken the mic at the

Re: Embarrassment of riches: another talk came online today

2014-06-11 Thread justme via Digitalmars-d-announce
On Tuesday, 10 June 2014 at 16:30:31 UTC, Andrei Alexandrescu wrote: Leverage - my talk at Lang.NEXT. http://www.reddit.com/r/programming/comments/27sp6r/langnext_2014_leverage_by_andrei_alexandrescu/ https://news.ycombinator.com/newest

Re: Embarrassment of riches: another talk came online today

2014-06-11 Thread Peter Alexander via Digitalmars-d-announce
On Tuesday, 10 June 2014 at 16:30:31 UTC, Andrei Alexandrescu wrote: Leverage - my talk at Lang.NEXT. I think this is one of your better D talks. It's refreshing to see honest admittance of the shortcomings of D's features, although I think a little too much time was spent talking about

Re: Embarrassment of riches: another talk came online today

2014-06-11 Thread Jesse Phillips via Digitalmars-d-announce
On Wednesday, 11 June 2014 at 18:06:03 UTC, justme wrote: I cannot accept 10. .iota; // The space here is unacceptable. Please have the programmer change 10. to 10.0 so that we have 10.0.iota; // Cleaner, obvious, and doesn't look like a typo. Thank you. The point wasn't about how best to

Re: hap.random: a new random number library for D

2014-06-11 Thread Joseph Rushton Wakeling via Digitalmars-d-announce
On Wednesday, 11 June 2014 at 07:24:11 UTC, Chris Cain wrote: I almost always like all the D posts I see on r/programming, but in general if any language highlighted the efforts in the RNG part of the standard library, I would like it. Too many languages get it wrong or don't care enough about

Re: Embarrassment of riches: another talk came online today

2014-06-11 Thread Andrei Alexandrescu via Digitalmars-d-announce
On 6/11/14, 11:06 AM, justme wrote: On Tuesday, 10 June 2014 at 16:30:31 UTC, Andrei Alexandrescu wrote: Leverage - my talk at Lang.NEXT. http://www.reddit.com/r/programming/comments/27sp6r/langnext_2014_leverage_by_andrei_alexandrescu/ https://news.ycombinator.com/newest

Re: DConf 2014 Day 1 Talk 4: Inside the Regular Expressions in D by Dmitry Olshansky

2014-06-11 Thread Adam D. Ruppe via Digitalmars-d-announce
On Wednesday, 11 June 2014 at 18:03:06 UTC, Atila Neves wrote: I wish I'd taken the mic at the end, and 2 days later Adam D. Ruppe said what I was thinking of saying: unit test and debug the CTFE function at runtime and then use it at compile-time when it's ready for production. Aye. It

Re: John Chapman (Juno), calling for John Chapman (not spam)

2014-06-11 Thread Karen Bantoft via Digitalmars-d-announce
I'm looking for the John Chapman who worked as a programmer at Centre-file Ltd, in Finsbury Circus London in 1971. Any leads? Karen

Re: The GC and performance, but not what you expect

2014-06-11 Thread Rainer Schuetze via Digitalmars-d
On 10.06.2014 17:15, Sean Kelly wrote: On Thursday, 29 May 2014 at 23:39:02 UTC, Marco Leise wrote: Nice try, but destructors called by the GC are currently effectively @nogc. So don't try that at home. When did that happen? Some effort was made at one point to ensure that allocations

Re: Tail pad optimization, cache friendlyness and C++ interrop

2014-06-11 Thread deadalnix via Digitalmars-d
On Wednesday, 11 June 2014 at 03:19:55 UTC, Walter Bright wrote: On 6/10/2014 7:44 PM, deadalnix wrote: On Wednesday, 11 June 2014 at 02:10:18 UTC, Walter Bright wrote: On 6/10/2014 5:27 PM, deadalnix wrote: I'm talking about structs, not classes. Ok, but since D structs do not inherit, how

Re: Tail pad optimization, cache friendlyness and C++ interrop

2014-06-11 Thread deadalnix via Digitalmars-d
On Wednesday, 11 June 2014 at 04:11:53 UTC, Walter Bright wrote: Hmm, this could have serious problems with the following: S1 s1; S2 s2; s2.c = 3; memcpy(s2.s1, s1, sizeof(S1)); // Oops! stomped on s2.c Yes, that is why they do it only in specific condition (ie when the thing use C++

Re: Tail pad optimization, cache friendlyness and C++ interrop

2014-06-11 Thread Walter Bright via Digitalmars-d
On 6/10/2014 11:11 PM, deadalnix wrote: On Wednesday, 11 June 2014 at 04:11:53 UTC, Walter Bright wrote: Hmm, this could have serious problems with the following: S1 s1; S2 s2; s2.c = 3; memcpy(s2.s1, s1, sizeof(S1)); // Oops! stomped on s2.c Yes, that is why they do it only in specific

std.array transition question + bug question

2014-06-11 Thread safety0ff via Digitalmars-d
Hello, I was replacing some nasty slice code with std.array calls when I encountered the following situation: void main() { import std.array, std.stdio; int[2][] arr = [[0, 0], [1, 0], [2, 0], [3, 0], [4, 0], [5, 0], [6, 0]]; size_t from = 4; // from is inclusive size_t to =

Re: std.array transition question + bug question

2014-06-11 Thread safety0ff via Digitalmars-d
On Wednesday, 11 June 2014 at 06:40:24 UTC, safety0ff wrote: When 'from' and 'to' differ by one, there's no error, when two or greater, error. I believe it is a bug, but want confirmation. Actually, it seems that the trigger is 'to - from' being equal to 'stuff.length'.

Re: Compilation Time

2014-06-11 Thread Paulo Pinto via Digitalmars-d
On Tuesday, 10 June 2014 at 18:36:20 UTC, Burp wrote: I'm not sure how valid the comparison would be, even if someone did port it to D. That C++ project is very old, and was likely not organized to minimize compilation times, may not have used precompiled headers etc. It is possible to

Re: Getting an access violation before main starts

2014-06-11 Thread Jacob Carlborg via Digitalmars-d
On 11/06/14 02:00, Matt wrote: I was wondering if anyone could help with a problem I'm having. My program compiles properly, and has all up-to-date files and DLLs (SDL2, SDL2-image, SDL2-ttf, all the other DLLs that are required by these). However, when I run it, I get object.Error: Access

Re: pyd - continuous integration

2014-06-11 Thread Jacob Carlborg via Digitalmars-d
On 10/06/14 23:32, Ellery Newcomer wrote: Another thing I was envisioning is a web page that shows test results for each combination so that it is easy for a casual user to determine pyd's status. Does buildbot have this sort of thing? Travis CI does have that. But it currently doesn't

Re: Tail pad optimization, cache friendlyness and C++ interrop

2014-06-11 Thread deadalnix via Digitalmars-d
On Wednesday, 11 June 2014 at 06:30:26 UTC, Walter Bright wrote: On 6/10/2014 11:11 PM, deadalnix wrote: On Wednesday, 11 June 2014 at 04:11:53 UTC, Walter Bright wrote: Hmm, this could have serious problems with the following: S1 s1; S2 s2; s2.c = 3; memcpy(s2.s1, s1, sizeof(S1)); // Oops!

Re: [OT] Extra time spent

2014-06-11 Thread Kagamin via Digitalmars-d
On Wednesday, 11 June 2014 at 03:56:06 UTC, Nick Sabalausky wrote: Point being, all that admiration I have for both that second closing and the initial opening battle, and I *still* never noticed they were the same song! Don't I feel like the perfect fool now! ;) The battle theme starts as

Re: The GC and performance, but not what you expect

2014-06-11 Thread Nordlöw
Only a little. In scripts where I deliberately introduce contention my allocator is quicker. It's much closer when there is little contention. Very interesting... It would be nice to see single-threaded benchmarks aswell for completeness. Thx-

Re: std.array transition question + bug question

2014-06-11 Thread Jonathan M Davis via Digitalmars-d
On Wed, 11 Jun 2014 06:40:23 + safety0ff via Digitalmars-d digitalmars-d@puremagic.com wrote: When I took a peek at std.array code on github I found: https://github.com/D-Programming-Language/phobos/blob/master/std/array.d#L1921 and:

Re: [OT] Extra time spent

2014-06-11 Thread John Colvin via Digitalmars-d
On Wednesday, 11 June 2014 at 07:30:41 UTC, Kagamin wrote: And last time I did an indie game (ages ago) I was very surprised how much difference I noticed (even on ordinary speakers) when encoding the music as 128kbps MP3, as opposed to 128kbps Vorbis and 320kbps MP3. I can only hear a

Re: [OT] Extra time spent

2014-06-11 Thread Chris via Digitalmars-d
On Wednesday, 11 June 2014 at 08:15:00 UTC, John Colvin wrote: On Wednesday, 11 June 2014 at 07:30:41 UTC, Kagamin wrote: And last time I did an indie game (ages ago) I was very surprised how much difference I noticed (even on ordinary speakers) when encoding the music as 128kbps MP3, as

Re: Tail pad optimization, cache friendlyness and C++ interrop

2014-06-11 Thread Walter Bright via Digitalmars-d
On 6/11/2014 12:22 AM, deadalnix wrote: On Wednesday, 11 June 2014 at 06:30:26 UTC, Walter Bright wrote: On 6/10/2014 11:11 PM, deadalnix wrote: On Wednesday, 11 June 2014 at 04:11:53 UTC, Walter Bright wrote: Hmm, this could have serious problems with the following: S1 s1; S2 s2; s2.c = 3;

Re: Need review: explicit package protection

2014-06-11 Thread Boyd via Digitalmars-d
On Sunday, 8 June 2014 at 15:37:06 UTC, Dicebot wrote: Finally got to cleanup and submit this PR: https://github.com/D-Programming-Language/dmd/pull/3651 While proposed change is very small (and backwards-compatible) and not worth separate DIP, it is still a language change and needs community

Re: Where is obj2asm on Windows?

2014-06-11 Thread via Digitalmars-d
On Tuesday, 10 June 2014 at 15:53:35 UTC, AsmMan wrote: I have dmd and dmc installed on my system but I can't find obj2asm executable. IIRC, when I was on Linux I just installed dmd and had working obj2asm. Where's it on Windows 64-bit? You can probably use binutils' objdump, but I don't know

Re: Tail pad optimization, cache friendlyness and C++ interrop

2014-06-11 Thread Timon Gehr via Digitalmars-d
On 06/11/2014 11:35 AM, Walter Bright wrote: I'm not so sure about that, either. There are many ways of bit copying structs, and some of them are perfectly memory safe. It is not provable by the compiler, therefore it is not @safe. Not memory safe implies (is supposed to imply) not @safe

Re: How to best translate this C++ algorithm into D? - refill with range

2014-06-11 Thread Nick Treleaven via Digitalmars-d
On 07/06/2014 16:39, monarch_dodra wrote: Then, you are using the code: .partition!(forest_invalid).sort.uniq.array; The advantage of partition over filter is that partition is a greedy inplace algorithm. But then, you go on to use uniq, which is lazy, and requires array. I implemented a (very)

Re: Tail pad optimization, cache friendlyness and C++ interrop

2014-06-11 Thread Remo via Digitalmars-d
On Wednesday, 11 June 2014 at 07:22:51 UTC, deadalnix wrote: On Wednesday, 11 June 2014 at 06:30:26 UTC, Walter Bright wrote: On 6/10/2014 11:11 PM, deadalnix wrote: On Wednesday, 11 June 2014 at 04:11:53 UTC, Walter Bright wrote: Hmm, this could have serious problems with the following: S1

Re: Need review: explicit package protection

2014-06-11 Thread Jonathan M Davis via Digitalmars-d
On Sun, 08 Jun 2014 15:37:04 + Dicebot via Digitalmars-d digitalmars-d@puremagic.com wrote: Finally got to cleanup and submit this PR: https://github.com/D-Programming-Language/dmd/pull/3651 While proposed change is very small (and backwards-compatible) and not worth separate DIP, it is

Re: Where is obj2asm on Windows?

2014-06-11 Thread Qox via Digitalmars-d
Try using objconv http://www.agner.org/optimize/objconv.zip , it doesn't handle every obj file from dmd but it works most of the time.

Re: std.array transition question + bug question

2014-06-11 Thread safety0ff via Digitalmars-d
On Wednesday, 11 June 2014 at 07:56:12 UTC, Jonathan M Davis via Digitalmars-d wrote: It should have been uncommented out ages ago, but it was never done. So, we need to uncomment it out and make sure that it still works, in which case, presumably it can be added in like it was supposed to

Re: Need review: explicit package protection

2014-06-11 Thread Steven Schveighoffer via Digitalmars-d
On Wed, 11 Jun 2014 10:09:18 -0400, Jonathan M Davis via Digitalmars-d digitalmars-d@puremagic.com wrote: On Sun, 08 Jun 2014 15:37:04 + Dicebot via Digitalmars-d digitalmars-d@puremagic.com wrote: Finally got to cleanup and submit this PR:

Re: std.experimental – DConf?

2014-06-11 Thread bearophile via Digitalmars-d
David Nadlinger: There seems to have been some discussion regarding std.experimental at DConf, In the discussions of yesterday has emerged a feature of Rust I didn't know about: http://doc.rust-lang.org/rust.html#stability In Rust code you can add annotations like #[stable] that specify

Re: How to best translate this C++ algorithm into D? - refill with range

2014-06-11 Thread Nick Treleaven via Digitalmars-d
On 11/06/2014 14:45, Nick Treleaven wrote: /** Copy up to r.length elements of src to r. */ auto refill(R, Input)(ref R r, Input src) if (isRandomAccessRange!R isInputRange!Input) Note this is related to: std.algorithm.fill(Range1 range, Range2 filler) Except that fill always fills all of

Re: Tail pad optimization, cache friendlyness and C++ interrop

2014-06-11 Thread Walter Bright via Digitalmars-d
On 6/11/2014 4:34 AM, Timon Gehr wrote: Not memory safe implies (is supposed to imply) not @safe but not @safe does not imply not memory safe. @safe in D == memory safe.

Re: Concurrent GC (for Windows)

2014-06-11 Thread Dmitry Olshansky via Digitalmars-d
03-Jun-2014 11:35, Rainer Schuetze пишет: Hi, more GC talk: the last couple of days, I've been experimenting with implementing a concurrent GC on Windows inspired by Leandros CDGC. Here's a report on my experiments: http://rainers.github.io/visuald/druntime/concurrentgc.html tl;dr: there is a

Re: Need review: explicit package protection

2014-06-11 Thread Dejan Lekic via Digitalmars-d
I'd call this INVALID WONT FIX :) D module system is defined to have strong 1-to-1 matching with file system. Any attempt to circumvent that in favor of personal preferences is asking for trouble and is not worth supporting. I can only agree with this, but fact is that D allows flattened

Re: Finally full multidimensional arrays support in D

2014-06-11 Thread Stefan Frijters via Digitalmars-d
On Tuesday, 10 June 2014 at 19:04:18 UTC, Stefan Frijters wrote: I've been using the multidimensional arrays for a while now, but recently I've run into a problem w.r.t. optimization: import std.stdio; import unstd.multidimarray; void main() { MultidimArray!(double, 3) arr; arr =

Why does std.string.munch take a string ref?

2014-06-11 Thread Sean Kelly via Digitalmars-d
It's the only function in std.string that takes a string by ref instead of by value, and this screws up call chaining. What's the reason for this?

Re: Why does std.string.munch take a string ref?

2014-06-11 Thread w0rp via Digitalmars-d
On Wednesday, 11 June 2014 at 20:27:41 UTC, Sean Kelly wrote: It's the only function in std.string that takes a string by ref instead of by value, and this screws up call chaining. What's the reason for this? munch modifies the string you give it.

Re: Why does std.string.munch take a string ref?

2014-06-11 Thread Sean Kelly via Digitalmars-d
On Wednesday, 11 June 2014 at 21:07:18 UTC, w0rp wrote: On Wednesday, 11 June 2014 at 20:27:41 UTC, Sean Kelly wrote: It's the only function in std.string that takes a string by ref instead of by value, and this screws up call chaining. What's the reason for this? munch modifies the string

Re: Why does std.string.munch take a string ref?

2014-06-11 Thread monarch_dodra via Digitalmars-d
On Wednesday, 11 June 2014 at 21:10:42 UTC, Sean Kelly wrote: On Wednesday, 11 June 2014 at 21:07:18 UTC, w0rp wrote: On Wednesday, 11 June 2014 at 20:27:41 UTC, Sean Kelly wrote: It's the only function in std.string that takes a string by ref instead of by value, and this screws up call

Re: Why does std.string.munch take a string ref?

2014-06-11 Thread Sean Kelly via Digitalmars-d
On Wednesday, 11 June 2014 at 21:18:29 UTC, monarch_dodra wrote: I think it's because it returns both the munched data, and the modified string: string s = 123abc; string t = munch(s, 0123456789); assert(t == 123 s == abc); But it would indeed be more natural to simply return the updated

extern(Windows) behavior on non-Windows systems

2014-06-11 Thread Walter Bright via Digitalmars-d
I've got an enhancement request to have it behave like extern(C): https://issues.dlang.org/show_bug.cgi?id=12894 Thoughts? Anyone use extern(Windows) on non-Windows systems?

Re: extern(Windows) behavior on non-Windows systems

2014-06-11 Thread deadalnix via Digitalmars-d
On Wednesday, 11 June 2014 at 22:20:27 UTC, Walter Bright wrote: I've got an enhancement request to have it behave like extern(C): https://issues.dlang.org/show_bug.cgi?id=12894 Thoughts? Anyone use extern(Windows) on non-Windows systems? What is the extern(Windows) is supposed to do

Re: extern(Windows) behavior on non-Windows systems

2014-06-11 Thread deadalnix via Digitalmars-d
On Wednesday, 11 June 2014 at 22:25:22 UTC, Walter Bright wrote: It changes the calling convention and name mangling to match what Microsoft uses for the Windows API. OK, but I don't get why you wouldn't be able to use extern(C/C++/Whatever) and it adapt to the system. Obviously there is

Re: extern(Windows) behavior on non-Windows systems

2014-06-11 Thread Walter Bright via Digitalmars-d
On 6/11/2014 3:24 PM, deadalnix wrote: On Wednesday, 11 June 2014 at 22:20:27 UTC, Walter Bright wrote: I've got an enhancement request to have it behave like extern(C): https://issues.dlang.org/show_bug.cgi?id=12894 Thoughts? Anyone use extern(Windows) on non-Windows systems? What is

Re: extern(Windows) behavior on non-Windows systems

2014-06-11 Thread Walter Bright via Digitalmars-d
On 6/11/2014 3:27 PM, deadalnix wrote: On Wednesday, 11 June 2014 at 22:25:22 UTC, Walter Bright wrote: It changes the calling convention and name mangling to match what Microsoft uses for the Windows API. OK, but I don't get why you wouldn't be able to use extern(C/C++/Whatever) and it adapt

Re: extern(Windows) behavior on non-Windows systems

2014-06-11 Thread Iain Buclaw via Digitalmars-d
On 11 June 2014 23:20, Walter Bright via Digitalmars-d digitalmars-d@puremagic.com wrote: I've got an enhancement request to have it behave like extern(C): https://issues.dlang.org/show_bug.cgi?id=12894 Thoughts? Anyone use extern(Windows) on non-Windows systems? I'd doubt there's be

Re: extern(Windows) behavior on non-Windows systems

2014-06-11 Thread Iain Buclaw via Digitalmars-d
On 12 June 2014 00:17, Iain Buclaw ibuc...@gdcproject.org wrote: On 11 June 2014 23:20, Walter Bright via Digitalmars-d digitalmars-d@puremagic.com wrote: I've got an enhancement request to have it behave like extern(C): https://issues.dlang.org/show_bug.cgi?id=12894 Thoughts? Anyone

Re: extern(Windows) behavior on non-Windows systems

2014-06-11 Thread Walter Bright via Digitalmars-d
On 6/11/2014 4:17 PM, Iain Buclaw via Digitalmars-d wrote: I'd doubt there's be anyone that uses extern(Windows) on non-windows systems, but there may be people who wish to force stdcall for whatever reason. Currently, extern(C) on Windows could either be a stdcall, cdecl or thiscall function.

Re: extern(Windows) behavior on non-Windows systems

2014-06-11 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 11 June 2014 at 23:27:09 UTC, Walter Bright wrote: Even Microsoft gave up on stdcall for Win64 and uses the C convention. I think that's because the 64 bit C convention is a lot closer to the stdcall convention anyway, putting more args in registers etc...

Re: extern(Windows) behavior on non-Windows systems

2014-06-11 Thread Walter Bright via Digitalmars-d
On 6/11/2014 4:34 PM, Adam D. Ruppe wrote: On Wednesday, 11 June 2014 at 23:27:09 UTC, Walter Bright wrote: Even Microsoft gave up on stdcall for Win64 and uses the C convention. I think that's because the 64 bit C convention is a lot closer to the stdcall convention anyway, putting more args

Re: extern(Windows) behavior on non-Windows systems

2014-06-11 Thread Chris Williams via Digitalmars-d
On Wednesday, 11 June 2014 at 22:20:27 UTC, Walter Bright wrote: I've got an enhancement request to have it behave like extern(C): https://issues.dlang.org/show_bug.cgi?id=12894 Thoughts? Anyone use extern(Windows) on non-Windows systems? No, but if I had a 3rd party .lib that had been

Re: Why does std.string.munch take a string ref?

2014-06-11 Thread Jonathan M Davis via Digitalmars-d
On Wed, 11 Jun 2014 20:27:40 + Sean Kelly via Digitalmars-d digitalmars-d@puremagic.com wrote: It's the only function in std.string that takes a string by ref instead of by value, and this screws up call chaining. What's the reason for this? It looks like it's trying to act like

Re: extern(Windows) behavior on non-Windows systems

2014-06-11 Thread Jonathan M Davis via Digitalmars-d
On Wed, 11 Jun 2014 15:20:29 -0700 Walter Bright via Digitalmars-d digitalmars-d@puremagic.com wrote: I've got an enhancement request to have it behave like extern(C): https://issues.dlang.org/show_bug.cgi?id=12894 Thoughts? Anyone use extern(Windows) on non-Windows systems? Regardless

Re: Need review: explicit package protection

2014-06-11 Thread Jonathan M Davis via Digitalmars-d
On Wed, 11 Jun 2014 11:27:35 -0400 Steven Schveighoffer via Digitalmars-d digitalmars-d@puremagic.com wrote: On Wed, 11 Jun 2014 10:09:18 -0400, Jonathan M Davis via Digitalmars-d digitalmars-d@puremagic.com wrote: I would be inclined to argue that this should be done in a way that

Re: extern(Windows) behavior on non-Windows systems

2014-06-11 Thread Kapps via Digitalmars-d
On Wednesday, 11 June 2014 at 22:20:27 UTC, Walter Bright wrote: I've got an enhancement request to have it behave like extern(C): https://issues.dlang.org/show_bug.cgi?id=12894 Thoughts? Anyone use extern(Windows) on non-Windows systems? Isn't this the whole point of extern(System)? I

Re: Version() for unittest OR debug?

2014-06-11 Thread Kagamin via Digitalmars-d-learn
debug version = DebugOrUnittest; else version(unittest)version = DebugOrUnittest; version(DebugOrUnittest) { static assert(false,DebugOrUnittest); }

Re: Splitting Ranges using Lambda Predicates

2014-06-11 Thread monarch_dodra via Digitalmars-d-learn
On Tuesday, 10 June 2014 at 22:31:37 UTC, Nordlöw wrote: Either way, it shouldn't be too hard to implement. Base it off splitter!pred, which is actually quite trivial. AFAIK, your What do you mean by basing it off splitter!pred - should I start with some existing splitter algorithm in Phobos

Re: Basic dynamic array question. Use of new versus no new.

2014-06-11 Thread monarch_dodra via Digitalmars-d-learn
On Wednesday, 11 June 2014 at 05:46:07 UTC, Ali Çehreli wrote: On 06/10/2014 08:06 PM, Matt wrote: On Wednesday, 11 June 2014 at 02:30:01 UTC, WhatMeWorry wrote: int[] array; // initially empty array.length = 5; // now has 5 elements while in Mr. Alexandrescu's book, it says To create a

Re: Version() for unittest OR debug?

2014-06-11 Thread Juanjo Alvarez via Digitalmars-d-learn
On Tuesday, 10 June 2014 at 14:06:58 UTC, bearophile wrote: Juanjo Alvarez: Probably I pretty simple question, how could I mark some code to be compiled when in debug OR unittest mode? (or both, ||) At first I tough I could do: version(unittest, debug) {} You can define a enum boolean

Re: Source File and Position of User Defined Type

2014-06-11 Thread Matt via Digitalmars-d-learn
On Tuesday, 10 June 2014 at 20:58:41 UTC, Nordlöw wrote: Is there a way to, programatically (trait), lookup the source file and position of a user defined type either dynamically or, even better, statically? I don't know about the source file, per se, but std.traits has the

Re: crt1.o: could not read symbols: Bad value

2014-06-11 Thread FreeSlave via Digitalmars-d-learn
It seems like you're trying to compile 64-bit code when you are on 32-bit system and you have 32-bit libphobos.

Re: crt1.o: could not read symbols: Bad value

2014-06-11 Thread FreeSlave via Digitalmars-d-learn
I conclude that because I have similar errors when trying to build 64-bit library on 32-bit system. /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libphobos2.a(format_712_5b3.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC

Re: Basic dynamic array question. Use of new versus no new.

2014-06-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Wed, 11 Jun 2014 02:30:00 + WhatMeWorry via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: In Mr. Cehreli's book it says Additionally, the length of dynamic arrays can be changed by assigning a value to this property: int[] array; // initially empty array.length = 5;

passing predicates to lowerBound, or alternatively, how lazy is map?

2014-06-11 Thread Andrew Brown via Digitalmars-d-learn
Hi there, The problem this question is about is now solved, by writing my own binary search algorithm, but I'd like to ask it anyway as I think I could learn a lot from the answers. The problem was, given an array of numbers, double[] numbers, and an ordering from makeIndex size_t[] order,

Re: passing predicates to lowerBound, or alternatively, how lazy is map?

2014-06-11 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 11 June 2014 at 11:22:08 UTC, Andrew Brown wrote: Hi there, The problem this question is about is now solved, by writing my own binary search algorithm, but I'd like to ask it anyway as I think I could learn a lot from the answers. The problem was, given an array of numbers,

Re: passing predicates to lowerBound, or alternatively, how lazy is map?

2014-06-11 Thread Andrew Brown via Digitalmars-d-learn
My question about this is how lazy is map? Will it work on every value of order and then pass it to lowerBound, or could it work to evaluate only those values asked by lowerBound? I guess probably not, but could a function be composed that worked in this way? Thank you very much Andrew

Re: Splitting Ranges using Lambda Predicates

2014-06-11 Thread Artur Skawina via Digitalmars-d-learn
On 06/11/14 00:31, Nordlöw via Digitalmars-d-learn wrote: Either way, it shouldn't be too hard to implement. Base it off splitter!pred, which is actually quite trivial. AFAIK, your What do you mean by basing it off splitter!pred - should I start with some existing splitter algorithm in

Re: passing predicates to lowerBound, or alternatively, how lazy is map?

2014-06-11 Thread Andrew Brown via Digitalmars-d-learn
map is fully lazy. However, if you've already got the sorted indices in `order`, I would do this: auto numLessThanN = numbers.indexed(order).countUntil!((x) = x = N)(); That indexed command is perfect though, does the trick, thank you very much.

Re: Splitting Ranges using Lambda Predicates

2014-06-11 Thread monarch_dodra via Digitalmars-d-learn
On Wednesday, 11 June 2014 at 11:42:42 UTC, Artur Skawina via Digitalmars-d-learn wrote: On 06/11/14 00:31, Nordlöw via Digitalmars-d-learn wrote: Either way, it shouldn't be too hard to implement. Base it off splitter!pred, which is actually quite trivial. AFAIK, your What do you mean by

Re: problem with Access Violation, and I'm not sure where

2014-06-11 Thread Mike Parker via Digitalmars-d-learn
On 6/11/2014 2:14 PM, Matt wrote: window = SDL_CreateWindow (cfg[window][caption].str.ptr, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, SDL_WINDOW_SHOWN); I'm curious -- does cfg[][].str ensure that the string is null terminated? Because if it doesn't, you've got

Re: passing predicates to lowerBound, or alternatively, how lazy is map?

2014-06-11 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 11 June 2014 at 11:50:36 UTC, Andrew Brown wrote: map is fully lazy. However, if you've already got the sorted indices in `order`, I would do this: auto numLessThanN = numbers.indexed(order).countUntil!((x) = x = N)(); That indexed command is perfect though, does the trick,

Re: passing predicates to lowerBound, or alternatively, how lazy is map?

2014-06-11 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 11 June 2014 at 11:38:07 UTC, Andrew Brown wrote: My question about this is how lazy is map? Will it work on every value of order and then pass it to lowerBound, or could it work to evaluate only those values asked by lowerBound? I guess probably not, but could a function be

Re: passing predicates to lowerBound, or alternatively, how lazy is map?

2014-06-11 Thread Andrew Brown via Digitalmars-d-learn
You are correct. assumeSorted and lowerBound will provide better time complexity than countUntil I'm sorry, one final question because I think I'm close to understanding. Map produces a forward range (lazily) but not a random access range? Therefore, lowerBound will move along this range

Re: passing predicates to lowerBound, or alternatively, how lazy is map?

2014-06-11 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 11 June 2014 at 13:20:37 UTC, Andrew Brown wrote: You are correct. assumeSorted and lowerBound will provide better time complexity than countUntil I'm sorry, one final question because I think I'm close to understanding. Map produces a forward range (lazily) but not a random

Re: passing predicates to lowerBound, or alternatively, how lazy is map?

2014-06-11 Thread Andrew Brown via Digitalmars-d-learn
On Wednesday, 11 June 2014 at 13:25:03 UTC, John Colvin wrote: On Wednesday, 11 June 2014 at 13:20:37 UTC, Andrew Brown wrote: You are correct. assumeSorted and lowerBound will provide better time complexity than countUntil I'm sorry, one final question because I think I'm close to

  1   2   >