Re: Needing help with basic HTTP requests..

2013-07-09 Thread AlexMcP
Thank you! It worked, finally, and I can't believe that was the only thing stopping it from working. But yeah, I'll take your advice and make the changes. I've also looked at curl and your implementation, but I wanted to give this a go manually instead of just using external libraries, I feel

Re: Assert failures in threads

2013-07-09 Thread Sean Kelly
On Jul 9, 2013, at 3:33 PM, Jonathan M Davis wrote: > On Tuesday, July 09, 2013 10:39:59 Sean Kelly wrote: >> If you join the thread, any unhanded exception will be rethrown in the >> joining thread by default. > > What about threads which were spawned by std.concurrency? IIRC, those are > neve

Re: Assert failures in threads

2013-07-09 Thread Jonathan M Davis
On Tuesday, July 09, 2013 10:39:59 Sean Kelly wrote: > If you join the thread, any unhanded exception will be rethrown in the > joining thread by default. What about threads which were spawned by std.concurrency? IIRC, those are never explicitly joined. Is catching Throwable in the spawned thread

Re: Beginner problem: casting in opCmp override

2013-07-09 Thread H. S. Teoh
On Mon, Jul 08, 2013 at 05:09:14PM -0700, Jonathan M Davis wrote: > On Monday, July 08, 2013 16:58:03 H. S. Teoh wrote: > > On Mon, Jul 08, 2013 at 04:48:05PM -0700, Jonathan M Davis wrote: > > > On Monday, July 08, 2013 16:38:16 H. S. Teoh wrote: > > [...] > > > > > > Basically, when you write x=

Re: std.algorithm.filter cannot call gc_malloc at compile time

2013-07-09 Thread John Colvin
On Tuesday, 9 July 2013 at 19:06:36 UTC, monarch_dodra wrote: On Tuesday, 9 July 2013 at 16:48:20 UTC, John Colvin wrote: On Tuesday, 9 July 2013 at 16:47:02 UTC, Meta wrote: On Tuesday, 9 July 2013 at 16:44:29 UTC, John Colvin wrote: Fixed in git master. array was not ctfe-able until a few mo

Re: std.algorithm.filter cannot call gc_malloc at compile time

2013-07-09 Thread monarch_dodra
On Tuesday, 9 July 2013 at 16:48:20 UTC, John Colvin wrote: On Tuesday, 9 July 2013 at 16:47:02 UTC, Meta wrote: On Tuesday, 9 July 2013 at 16:44:29 UTC, John Colvin wrote: Fixed in git master. array was not ctfe-able until a few months back. What compiler version/release are you using? I'm u

Re: Assert failures in threads

2013-07-09 Thread Sean Kelly
On Jul 1, 2013, at 4:04 AM, Joseph Rushton Wakeling wrote: > I've noticed that when an assert fails inside a thread, no error message is > printed and the program/thread just hangs. > > Is there any way to ensure that an assertion failure inside a thread does > output > a message? For the pur

Re: std.algorithm.filter cannot call gc_malloc at compile time

2013-07-09 Thread Meta
On Tuesday, 9 July 2013 at 16:48:20 UTC, John Colvin wrote: which dpaste is that? http://dpaste.dzfl.pl/ gives me the error even using "dmd 2.X Git" Actually, yes, it still does not work. I forgot that I had changed "enum" to "auto" to get it working. My bad.

Re: std.algorithm.filter cannot call gc_malloc at compile time

2013-07-09 Thread John Colvin
On Tuesday, 9 July 2013 at 16:47:02 UTC, Meta wrote: On Tuesday, 9 July 2013 at 16:44:29 UTC, John Colvin wrote: Fixed in git master. array was not ctfe-able until a few months back. What compiler version/release are you using? I'm using DPaste, but setting the compiler to use the latest from

Re: std.algorithm.filter cannot call gc_malloc at compile time

2013-07-09 Thread John Colvin
On Tuesday, 9 July 2013 at 16:28:21 UTC, Meta wrote: enum tokenRange = matchStr.split(",") .map!(a => a.findSplit(`=>`) .array .map!strip) .filter!"!a.empty"; This won'

Re: std.algorithm.filter cannot call gc_malloc at compile time

2013-07-09 Thread Meta
On Tuesday, 9 July 2013 at 16:44:29 UTC, John Colvin wrote: Fixed in git master. array was not ctfe-able until a few months back. What compiler version/release are you using? I'm using DPaste, but setting the compiler to use the latest from GIT fixed it. Thanks!

std.algorithm.filter cannot call gc_malloc at compile time

2013-07-09 Thread Meta
enum tokenRange = matchStr.split(",") .map!(a => a.findSplit(`=>`) .array .map!strip) .filter!"!a.empty"; This won't compile. The error message is: .../core/memory.d(33

Re: Simple test suite for std.random

2013-07-09 Thread Joseph Rushton Wakeling
On 07/05/2013 04:16 PM, Joseph Rushton Wakeling wrote: > To this we can add: http://d.puremagic.com/issues/show_bug.cgi?id=10550 > > At least 2 of the Xorshift generators (32 and 160) depart strongly from > uniformity in their output. > > Because the others appear OK, my guess would be that the f

Re: GitHub behind proxy servers among other questions

2013-07-09 Thread JohnnyK
On Tuesday, 9 July 2013 at 08:55:29 UTC, monarch_dodra wrote: On Monday, 8 July 2013 at 19:20:46 UTC, John Colvin wrote: I don't see how it is problematic? The firewall doesn't allow a particular type of connection, so you cache the result somewhere else and then access it via something that is

Re: C standard libraries

2013-07-09 Thread Gary Willoughby
On Tuesday, 2 July 2013 at 12:52:49 UTC, bearophile wrote: Adam D. Ruppe: The older std.c is kept around just for compatibility with the old names before the move, at least as far as I know. Maybe they haven't fully deprecated it though because there's other reasons I don't know about, since

Re: lambdas and function literals in classes

2013-07-09 Thread Timon Gehr
On 07/09/2013 02:32 PM, Artur Skawina wrote: IIRC this issue is already reported somewhere in bugzilla. http://d.puremagic.com/issues/show_bug.cgi?id=7653

Re: lambdas and function literals in classes

2013-07-09 Thread Dicebot
On Tuesday, 9 July 2013 at 12:32:55 UTC, Artur Skawina wrote: On 07/09/13 12:50, John Colvin wrote: JS asked about this in the main group, but here is more appropriate and I'm quite interested myself. Function/delegate *literals* in aggregates are not accepted by the compiler. Probably call

Re: lambdas and function literals in classes

2013-07-09 Thread Artur Skawina
On 07/09/13 12:50, John Colvin wrote: > JS asked about this in the main group, but here is more appropriate and I'm > quite interested myself. Function/delegate *literals* in aggregates are not accepted by the compiler. It's just a compiler issue; iirc the frontend recently got a bit smarter abou

Re: Needing help with basic HTTP requests..

2013-07-09 Thread Adam D. Ruppe
BTW I also wrote a more complete lower level implementation too: https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/http.d My code is kinda ugly, but might be useful to refer to too. http has some other features you'll need to think about, like chunk

Re: Needing help with basic HTTP requests..

2013-07-09 Thread Adam D. Ruppe
On Tuesday, 9 July 2013 at 09:03:32 UTC, AlexMcP wrote: writeln("Connection Error ", Socket.ERROR); First tip: Socket.ERROR is a constant, so printing it doesn't help much (as you probably noticed). More helpful is the function lastSocketError(), which returns a strin

Re: lambdas and function literals in classes

2013-07-09 Thread Dicebot
On Tuesday, 9 July 2013 at 11:16:39 UTC, bearophile wrote: So is it worth adding this diagnostic bug report in Bugzilla? ... I think yes. It should either just work or provide error message that actually explains the reasoning. Probably Don can clarify this as static initialization of a fie

Re: lambdas and function literals in classes

2013-07-09 Thread bearophile
Dicebot: So this has something to do with _initialization_ of class members with delegates/lambdas, not their very existence. So is it worth adding this diagnostic bug report in Bugzilla? class Foo { void delegate() dg1; void delegate() dg2 = delegate(){}; this() { this.

Re: lambdas and function literals in classes

2013-07-09 Thread Dicebot
On Tuesday, 9 July 2013 at 10:50:02 UTC, John Colvin wrote: JS asked about this in the main group, but here is more appropriate and I'm quite interested myself. Can someone explain the rationale behind this: class A { auto a = (){}; //Lambda not allowed auto b = function()

lambdas and function literals in classes

2013-07-09 Thread John Colvin
JS asked about this in the main group, but here is more appropriate and I'm quite interested myself. Can someone explain the rationale behind this: class A { auto a = (){}; //Lambda not allowed auto b = function(){}; //Function allowed auto c = delegate(){}; /

Needing help with basic HTTP requests..

2013-07-09 Thread AlexMcP
Hi guys, I've only been trying to learn D for a short while, and compared to the other more popular programming languages, I've been able to find very little helpful and updated documentation or tutorials on it. I basically need help getting data from a website, just the HTML of a webpage,

Re: GitHub behind proxy servers among other questions

2013-07-09 Thread monarch_dodra
On Monday, 8 July 2013 at 19:20:46 UTC, John Colvin wrote: I don't see how it is problematic? The firewall doesn't allow a particular type of connection, so you cache the result somewhere else and then access it via something that is allowed. It's the same as downloading the zip file from gith

Re: GitHub behind proxy servers among other questions

2013-07-09 Thread monarch_dodra
On Monday, 8 July 2013 at 19:57:52 UTC, JohnnyK wrote: On Monday, 8 July 2013 at 19:37:08 UTC, JohnnyK wrote: Another thing about GitHub's Download Zip button and this process as a whole. While the Download Zip button does allow you to download the master folders with recursive directories I