Re: 441 gmane.comp.lang.d.dmd.beta is unidirectional

2011-05-10 Thread KennyTM~
On May 11, 11 09:39, Brad Roberts wrote: I run a_mail_ gateway, not a news gateway. So, no, posting via nntp isn't going to work. As to why I require registration, it's spam prevention. I'm not willing to open up posts to non-registered users as it's a very strong line of defense. I'm also n

Re: 441 gmane.comp.lang.d.dmd.beta is unidirectional

2011-05-10 Thread Vladimir Panteleev
On Wed, 11 May 2011 05:17:41 +0300, Brad Roberts wrote: It would have been a misconfiguration. Hmm, thanks for the clarification. The message I posted that got through was on December 15, in the d.runtime group. the one I described above, spam prevention. It's necessary. There are m

Re: 441 gmane.comp.lang.d.dmd.beta is unidirectional

2011-05-10 Thread Brad Roberts
On Wed, 11 May 2011, Vladimir Panteleev wrote: > On Wed, 11 May 2011 04:39:44 +0300, Brad Roberts > wrote: > > > I run a _mail_ gateway, not a news gateway. So, no, posting via nntp > > isn't going to work. As to why I require registration, it's spam > > prevention. I'm not willing to open up

Re: 441 gmane.comp.lang.d.dmd.beta is unidirectional

2011-05-10 Thread Jonathan M Davis
On 2011-05-10 19:01, Vladimir Panteleev wrote: > On Wed, 11 May 2011 04:39:44 +0300, Brad Roberts > > wrote: > > I run a _mail_ gateway, not a news gateway. So, no, posting via nntp > > isn't going to work. As to why I require registration, it's spam > > prevention. I'm not willing to open up

Re: 441 gmane.comp.lang.d.dmd.beta is unidirectional

2011-05-10 Thread Vladimir Panteleev
On Wed, 11 May 2011 04:39:44 +0300, Brad Roberts wrote: I run a _mail_ gateway, not a news gateway. So, no, posting via nntp isn't going to work. As to why I require registration, it's spam prevention. I'm not willing to open up posts to non-registered users as it's a very strong line of d

AA Troubles

2011-05-10 Thread Jonathan Crapuchettes
Hey all, I have been working with a lot of associative arrays of late and been running into some problems with the built-in implementation. It appears that very heavy use in an application can cause the garbage collector to have issues. Most of the time I have found ways around the problems, b

Re: 441 gmane.comp.lang.d.dmd.beta is unidirectional

2011-05-10 Thread Brad Roberts
On Wed, 11 May 2011, Vladimir Panteleev wrote: > On Wed, 11 May 2011 03:25:02 +0300, Brad Roberts > wrote: > > > Sorry, but all the gmane d groups come through my mail gateway of the > > digitalmars news server. I don't allow posts from non-subscribers. > > Why? > > Attempting to post to a Gm

Re: How would you do this in D?

2011-05-10 Thread Jonathan M Davis
On 2011-05-10 18:06, Jose Armando Garcia wrote: > Thanks. I should have read > http://www.digitalmars.com/d/2.0/template.html more carefully. > > "Multiple instantiations of a TemplateDeclaration with the same > TemplateArgumentList, before implicit conversions, all will refer to > the same instan

Re: How would you do this in D?

2011-05-10 Thread Daniel Gibson
Am 11.05.2011 02:56, schrieb Daniel Gibson: > > There may be a more clever template-trick, however. What about: void EVERY(int threshold, alias action, string file = __FILE__, int line = __LINE__)() { static int cnt; ++cnt; if(cnt==threshold) { action(); cnt=0; } } void main() {

Re: How would you do this in D?

2011-05-10 Thread Jonathan M Davis
On 2011-05-10 17:55, Jose Armando Garcia wrote: > Good suggestion but I dislike the syntax for mixin template for this > use case. It looks like: > > bool every(string file = __FILE__, int line = __LINE__)(int time) > { >static int counter; >if(++counter > time) counter -= time; > >re

Re: How would you do this in D?

2011-05-10 Thread Jose Armando Garcia
Thanks. I should have read http://www.digitalmars.com/d/2.0/template.html more carefully. "Multiple instantiations of a TemplateDeclaration with the same TemplateArgumentList, before implicit conversions, all will refer to the same instantiation." The default values which are evaluated at the cal

Re: How would you do this in D?

2011-05-10 Thread Daniel Gibson
Am 11.05.2011 02:32, schrieb Jose Armando Garcia: > Hey guys, > > I am trying to create a function that return true or executes > "something" the n-th time it is called from a specific call site. How > would you do that in D? In C we can do that with the help of > pre-processor macros. E.g.: > >

Re: How would you do this in D?

2011-05-10 Thread Jose Armando Garcia
Good suggestion but I dislike the syntax for mixin template for this use case. It looks like: bool every(string file = __FILE__, int line = __LINE__)(int time) { static int counter; if(++counter > time) counter -= time; return counter == 1; } works just fine. Hmmm! On Tue, May 10, 2011

Re: How would you do this in D?

2011-05-10 Thread Andrei Alexandrescu
On 5/10/11 7:32 PM, Jose Armando Garcia wrote: Hey guys, I am trying to create a function that return true or executes "something" the n-th time it is called from a specific call site. How would you do that in D? In C we can do that with the help of pre-processor macros. E.g.: --- #include #de

Re: How would you do this in D?

2011-05-10 Thread Jonathan M Davis
On 2011-05-10 17:32, Jose Armando Garcia wrote: > Hey guys, > > I am trying to create a function that return true or executes > "something" the n-th time it is called from a specific call site. How > would you do that in D? In C we can do that with the help of > pre-processor macros. E.g.: > > --

Re: Implementing std.log

2011-05-10 Thread Andrei Alexandrescu
On 5/9/11 3:12 PM, Jens Mueller wrote: I think every() behaves strangely. Because the counter is per function. But it should be per logging statement. std.log differs here from glog and this seems incorrect to me. everyMs() has a similar problem. Actually, they behave correctly. The counters fo

Re: Implementing std.log

2011-05-10 Thread Jose Armando Garcia
Thanks! Will do. On Mon, May 9, 2011 at 4:11 PM, Walter Bright wrote: > On 5/7/2011 1:43 PM, Jose Armando Garcia wrote: >> >> My intent, and hopefully we will get there with your help, is to >> include this in Phobos for D2. > > Thanks for doing the hard work of designing and laying out an > impl

Re: How would you do this in D?

2011-05-10 Thread Jose Armando Garcia
Also, the D implementation breaks if you do: if(every(x)) { ... } if(every(y)) { ...} All on the same line. On Tue, May 10, 2011 at 9:32 PM, Jose Armando Garcia wrote: > Hey guys, > > I am trying to create a function that return true or executes > "something" the n-th time it is called from a s

How would you do this in D?

2011-05-10 Thread Jose Armando Garcia
Hey guys, I am trying to create a function that return true or executes "something" the n-th time it is called from a specific call site. How would you do that in D? In C we can do that with the help of pre-processor macros. E.g.: --- #include #define EVERY(N, ACTION) { static int counter = 0;

Re: 441 gmane.comp.lang.d.dmd.beta is unidirectional

2011-05-10 Thread Vladimir Panteleev
On Wed, 11 May 2011 03:25:02 +0300, Brad Roberts wrote: Sorry, but all the gmane d groups come through my mail gateway of the digitalmars news server. I don't allow posts from non-subscribers. Why? Attempting to post to a Gmane newsgroup for the first time requires e-mail validation. Gm

Re: 441 gmane.comp.lang.d.dmd.beta is unidirectional

2011-05-10 Thread Brad Roberts
On Wed, 11 May 2011, Vladimir Panteleev wrote: > It seems it's not possible to post to the dmd.beta/dmd.devel/etc. lists via > Gmane NNTP. How come? This used to work before, IIRC. > I wanted to report a regression in the latest DMD2 beta ( > http://d.puremagic.com/issues/show_bug.cgi?id=5976 ). >

Re: 441 gmane.comp.lang.d.dmd.beta is unidirectional

2011-05-10 Thread Vladimir Panteleev
On Wed, 11 May 2011 02:28:46 +0300, Nick Sabalausky wrote: "Vladimir Panteleev" wrote in message news:op.vvaemvw5tuz...@cybershadow.mshome.net... It seems it's not possible to post to the dmd.beta/dmd.devel/etc. lists via Gmane NNTP. How come? This used to work before, IIRC. I wanted to repor

Re: Generators in D

2011-05-10 Thread Piotr Szturmaj
I forgot to ask. Any comments or suggestions?

Generators in D

2011-05-10 Thread Piotr Szturmaj
Hi, I've written some proof of concept code of generator pattern, example: void genSquares(out int result, int from, int to) { foreach (x; from .. to + 1) { yield!result(x * x); } } void main(string[] argv) { foreach (sqr; generator(&genSquares, 10, 20)) writeln(

Re: 441 gmane.comp.lang.d.dmd.beta is unidirectional

2011-05-10 Thread Nick Sabalausky
"Vladimir Panteleev" wrote in message news:op.vvaemvw5tuz...@cybershadow.mshome.net... > It seems it's not possible to post to the dmd.beta/dmd.devel/etc. lists > via Gmane NNTP. How come? This used to work before, IIRC. > I wanted to report a regression in the latest DMD2 beta ( > http://d.pur

441 gmane.comp.lang.d.dmd.beta is unidirectional

2011-05-10 Thread Vladimir Panteleev
It seems it's not possible to post to the dmd.beta/dmd.devel/etc. lists via Gmane NNTP. How come? This used to work before, IIRC. I wanted to report a regression in the latest DMD2 beta ( http://d.puremagic.com/issues/show_bug.cgi?id=5976 ). -- Best regards, Vladimir

Re: Implementing std.log

2011-05-10 Thread Jacob Carlborg
On 2011-05-10 16:41, Andrei Alexandrescu wrote: On 5/10/11 3:22 AM, Jacob Carlborg wrote: On 2011-05-09 21:18, Andrei Alexandrescu wrote: On 5/9/11 1:48 PM, Jacob Carlborg wrote: On 2011-05-09 19:58, Andrei Alexandrescu wrote: On 5/9/11 12:24 PM, Jacob Carlborg wrote: I have a function that

Re: Performance of exception handling

2011-05-10 Thread Alexander
On 10.05.2011 16:53, Robert Jacques wrote: > Well, you are supposed to use validate first on any untrusted input. Now the > fact that validate returns void and throws an exception and there is no > corresponding 'isValid' routine probably is bad design. Not to mention that validating first and

Re: Performance of exception handling

2011-05-10 Thread Robert Jacques
On Tue, 10 May 2011 01:15:04 -0400, Walter Bright wrote: On 5/9/2011 9:48 PM, Andrej Mitrovic wrote: Well I can understand throwing exceptions when using readln() or validate(), but decode() is used for one code point at a time. Throwing is overkill imo. Perhaps decode() is badly designed.

Re: Implementing std.log

2011-05-10 Thread Andrei Alexandrescu
On 5/10/11 3:22 AM, Jacob Carlborg wrote: On 2011-05-09 21:18, Andrei Alexandrescu wrote: On 5/9/11 1:48 PM, Jacob Carlborg wrote: On 2011-05-09 19:58, Andrei Alexandrescu wrote: On 5/9/11 12:24 PM, Jacob Carlborg wrote: I have a function that gets the path of the current process: http://dso

Re: Implementing multiple inheritance in D

2011-05-10 Thread Jacob Carlborg
On 2011-05-10 10:14, kenji hara wrote: Why not emulate it with interfaces and template mixins? Interfaces? I don't understand what you mean. So please give me a example code. Kenji Hara interface Super { void foo (); } template SuperImpl { void foo () { /* do something */ } } class

Re: Why ddmd don't continue? (Was: TDPL error(s))

2011-05-10 Thread dolive
Nick Sabalausky Wrote: > "dolive" wrote in message > news:iq6cad$1far$1...@digitalmars.com... > > > > Why ddmd don't continue ? Give up ? > > > > I asked korDen about this a little while ago (the main guy behind ddmd). He > hasn't abandoned it. He said the lack of updates have been a combinati

Re: bikeshedding: sizediff_t -> size_s ?

2011-05-10 Thread Francisco Almeida
I think adopting ssize_t, thus improving parity with C would be more reasonable than a size_s that can be easily mistaken for size_t when reviewing long code. Either way, sizediff_t isn't used that often anyway, so I don't know if this minor issue should take too much priority. On 10-05-2011

Re: Collateral exceptions seem to be broken

2011-05-10 Thread Stephan
On 09.05.2011 20:05, Rainer Schuetze wrote: I suggest to even add debug symbols to the release build of phobos, as you also don't have debug info for non-template classes and structs declared inside phobos, even if your application is built with -g. Rainer That is a excellent idea. Can you pos

Re: Implementing std.log

2011-05-10 Thread Jacob Carlborg
On 2011-05-09 21:18, Andrei Alexandrescu wrote: On 5/9/11 1:48 PM, Jacob Carlborg wrote: On 2011-05-09 19:58, Andrei Alexandrescu wrote: On 5/9/11 12:24 PM, Jacob Carlborg wrote: I have a function that gets the path of the current process: http://dsource.org/projects/tango/attachment/ticket/1

Re: Implementing multiple inheritance in D

2011-05-10 Thread kenji hara
> Why not emulate it with interfaces and template mixins? Interfaces? I don't understand what you mean. So please give me a example code. Kenji Hara

Re: Implementing multiple inheritance in D

2011-05-10 Thread kenji hara
Thanks for your comment. > Could you please provide more detail on what you fixed and what the > resulting context is? I posted 'Issue 5973 - alias this is not considered with superclass lookup' for dmd issue. http://d.puremagic.com/issues/show_bug.cgi?id=5973 The issue is that dmd does not consi

Re: Collateral exceptions seem to be broken

2011-05-10 Thread Rainer Schuetze
Rainer Schuetze wrote: Andrej Mitrovic wrote: You mean my build of DMD/Phobos? Well the debug symbols are definitely shown after I run cv2pdb on the executable (it makes a .pdb file with all the symbols which get loaded at runtime by the exe). Perhaps displaying names is just unimplemented ye