Re: string comparison

2010-12-21 Thread doubleagent
> In general though, it's preferred that you post a link to code rather than > attach it I'll try to remember that.

d programming environment tutorial.

2010-12-21 Thread CrypticMetaphor
Hello, I've known D for about two weeks right now, and I kind of like it, a lot, but, I had a lot of trouble figuring out how to set up a programming environment. I mean, there were a few choices but some were abandoned, some things were only for D1(tango??) and others were so bug ridden that

Re: Strange socket error

2010-12-21 Thread Jérôme M. Berger
Bob Cowdery wrote: > Hi all, > > This is a long shot but I'm out of ideas. I ported an app from Windows > to Linux and after many issues it is working but I'm left with a strange > problem. The app basically reads data streams from a USB device, > processes them and outputs real-time graphical dat

Strange socket error

2010-12-21 Thread Bob Cowdery
Hi all, This is a long shot but I'm out of ideas. I ported an app from Windows to Linux and after many issues it is working but I'm left with a strange problem. The app basically reads data streams from a USB device, processes them and outputs real-time graphical data to a browser. There is also s

Re: string comparison

2010-12-21 Thread Jonathan M Davis
On Tuesday, December 21, 2010 09:36:20 Stanislav Blinov wrote: > 21.12.2010 19:55, spir пишет: > > On Tue, 21 Dec 2010 11:49:42 -0500 > > > > "Steven Schveighoffer" wrote: > >> Hm... I always use a newsgroup client, so maybe. But in any case, I've > >> never known anyone to have been blocked fro

Re: is expression for template structs/classes instances?

2010-12-21 Thread Jonathan M Davis
On Tuesday, December 21, 2010 02:57:45 d coder wrote: > > I do know the template. I will try out your solution. Will let you > > know if I face issues. > > Simen > > It works perfect, And this is exactly what I was looking for. If you > see my original post, I also thought this form of "is" expre

Re: Odd to!string call

2010-12-21 Thread Andrej Mitrovic
And yes i know writeln() doesn't need std.conv, writeln could be any other function expecting a string. On 12/21/10, Andrej Mitrovic wrote: > Right. Thanks, guys. > > I do see how this could possibly cause bugs for the uninitiated. > Someone who is new to D might attempt to use to!string with mul

Re: Odd to!string call

2010-12-21 Thread Andrej Mitrovic
Right. Thanks, guys. I do see how this could possibly cause bugs for the uninitiated. Someone who is new to D might attempt to use to!string with multiple arguments, and end up with buggy code like this: import std.stdio; import std.conv; void main() { int x = 2; int y = 4; // more

Re: Odd to!string call

2010-12-21 Thread Simen kjaeraas
Andrej Mitrovic wrote: I found this by accident: import std.stdio; import std.conv; void main() { writeln(to!string(2, 2)); // writes 10 writeln(to!string(1, 0)); // std.conv.ConvException: Radix error } I'm not sure why "std.conv.to" would even take multiple arguments. Bugzilla?

Re: Odd to!string call

2010-12-21 Thread Steven Schveighoffer
On Tue, 21 Dec 2010 13:38:06 -0500, Andrej Mitrovic wrote: I found this by accident: import std.stdio; import std.conv; void main() { writeln(to!string(2, 2)); // writes 10 writeln(to!string(1, 0)); // std.conv.ConvException: Radix error } I'm not sure why "std.conv.to" would even

Odd to!string call

2010-12-21 Thread Andrej Mitrovic
I found this by accident: import std.stdio; import std.conv; void main() { writeln(to!string(2, 2)); // writes 10 writeln(to!string(1, 0)); // std.conv.ConvException: Radix error } I'm not sure why "std.conv.to" would even take multiple arguments. Bugzilla?

Re: string comparison

2010-12-21 Thread Stanislav Blinov
21.12.2010 19:55, spir пишет: On Tue, 21 Dec 2010 11:49:42 -0500 "Steven Schveighoffer" wrote: Hm... I always use a newsgroup client, so maybe. But in any case, I've never known anyone to have been blocked from posting, and the newsgroup interface does not have any moderation on it. I'd be s

Re: How to generate non-empty html documentation / invoke ddoc?

2010-12-21 Thread Joost 't Hart
On 12/21/2010 05:28 PM, Stanislav Blinov wrote: 21.12.2010 19:16, Joost 't Hart пишет: Hi, Whatever I have tried so far, no documentation is generated from my .d stuff. Guess my (doxygen biassed) expectation is wrong and (probably that is why) http://www.digitalmars.com/d/2.0/ddoc.html does not

Re: string comparison

2010-12-21 Thread spir
On Tue, 21 Dec 2010 11:49:42 -0500 "Steven Schveighoffer" wrote: > Hm... I always use a newsgroup client, so maybe. But in any case, I've > never known anyone to have been blocked from posting, and the newsgroup > interface does not have any moderation on it. I'd be surprised if anyone >

Re: string comparison

2010-12-21 Thread Steven Schveighoffer
On Tue, 21 Dec 2010 11:12:00 -0500, Stanislav Blinov wrote: 20.12.2010 22:06, Steven Schveighoffer пишет: On Mon, 20 Dec 2010 14:05:56 -0500, Steven Schveighoffer wrote: On Mon, 20 Dec 2010 11:13:34 -0500, Stanislav Blinov wrote: And lastly, hasn't this by chance been your first pos

Re: How to generate non-empty html documentation / invoke ddoc?

2010-12-21 Thread Stanislav Blinov
21.12.2010 19:16, Joost 't Hart пишет: Hi, Whatever I have tried so far, no documentation is generated from my .d stuff. Guess my (doxygen biassed) expectation is wrong and (probably that is why) http://www.digitalmars.com/d/2.0/ddoc.html does not ring the bell here. What do I miss? $ cat h

How to generate non-empty html documentation / invoke ddoc?

2010-12-21 Thread Joost 't Hart
Hi, Whatever I have tried so far, no documentation is generated from my .d stuff. Guess my (doxygen biassed) expectation is wrong and (probably that is why) http://www.digitalmars.com/d/2.0/ddoc.html does not ring the bell here. What do I miss? $ cat hello.d /// This program cries hello /*

Re: string comparison

2010-12-21 Thread Stanislav Blinov
20.12.2010 22:06, Steven Schveighoffer пишет: On Mon, 20 Dec 2010 14:05:56 -0500, Steven Schveighoffer wrote: On Mon, 20 Dec 2010 11:13:34 -0500, Stanislav Blinov wrote: And lastly, hasn't this by chance been your first post? AFAIR, the first message is being moderated so it doesn't get t

Re: is expression for template structs/classes instances?

2010-12-21 Thread Simen kjaeraas
d coder wrote: I do know the template. I will try out your solution. Will let you know if I face issues. Simen It works perfect, And this is exactly what I was looking for. If you see my original post, I also thought this form of "is" expression should work. Just could not get around to the

Re: is expression for template structs/classes instances?

2010-12-21 Thread d coder
> I do know the template. I will try out your solution. Will let you > know if I face issues. > Simen It works perfect, And this is exactly what I was looking for. If you see my original post, I also thought this form of "is" expression should work. Just could not get around to the right syntax.

Re: enum ubyte[] vs enum ubyte[3]

2010-12-21 Thread Johannes Pfau
On Tuesday, December 21, 2010, Nick Voronin wrote: On Mon, 20 Dec 2010 17:17:05 +0100 "Johannes Pfau" wrote: > But if you are going to patch it, please make it add extra {} around > action code! The thing is that when there is a label before {} block > (and in ragel generated code I saw it's

Re: is expression for template structs/classes instances?

2010-12-21 Thread d coder
> S!int foo; > static if ( is( typeof(foo) f == S!T, T ) ) { >    // Here, T == int, f == typeof(foo) > } > > Note that the syntax "is ( Type Identifier : TypeSpecialization , > TemplateParameterList )" is only usable inside static if. > Thanks Simen I do know the template. I will try out your so

Re: is expression for template structs/classes instances?

2010-12-21 Thread Simen kjaeraas
d coder wrote: Greetings I want to find if a given struct type is instantiated from a particular template struct type. For example: struct S (T) { alias T Type; T t; } And later I want to find out if a given type is of type S(*) (basically any type instantiated from template struct S).

Re: is expression for template structs/classes instances?

2010-12-21 Thread bearophile
> The need expressed in this post is very common, so some standard way to do it > is necessary in Phobos or in __traits/meta. I have added this: http://d.puremagic.com/issues/show_bug.cgi?id=5361 Bye, bearophile

Re: is expression for template structs/classes instances?

2010-12-21 Thread bearophile
d coder: > I want to find if a given struct type is instantiated from a > particular template struct type. For example: > > struct S (T) { > alias T Type; > T t; > } > > And later I want to find out if a given type is of type S(*) > (basically any type instantiated from template struct S).

Re: is expression for template structs/classes instances?

2010-12-21 Thread spir
On Tue, 21 Dec 2010 09:53:49 +0530 d coder wrote: > Greetings > > I want to find if a given struct type is instantiated from a > particular template struct type. For example: > > struct S (T) { > alias T Type; > T t; > } > > And later I want to find out if a given type is of type S(*) > (

Re: Classes or stucts :: Newbie

2010-12-21 Thread bearophile
It seems I disagree with most things you say in this thread :-) Jonathan M Davis: >Talking about SafeD meaning memory safety makes the meaning of safety clear. >If you try and make the term safety encompass more than that, it takes very >little for "safety" to become subjective. Regardless of w