String created from buffer has wrong length and strip() result is incorrect

2014-10-17 Thread Lucas Burson via Digitalmars-d-learn
When creating a string from a ubyte[], I have an invalid length and string.strip() doesn't strip off all whitespace. I'm new to the language. Is this a compiler issue? import std.string : strip; import std.stdio : writefln; int main() { const string ATA_STR = ATA ; // this works

Re: String created from buffer has wrong length and strip() result is incorrect

2014-10-17 Thread thedeemon via Digitalmars-d-learn
On Friday, 17 October 2014 at 06:29:24 UTC, Lucas Burson wrote: // This is where things breaks { ubyte[] buff = new ubyte[16]; buff[0..ATA_STR.length] = cast(ubyte[])(ATA_STR); // read the string back from the buffer, stripping whitespace string stringFromBuffer

Re: String created from buffer has wrong length and strip() result is incorrect

2014-10-17 Thread thedeemon via Digitalmars-d-learn
You fill first few chars with data from ATA_STR but the rest 10 bytes of the array are still part of the string Edit: you fill first 5 chars and have 11 bytes of zeroes in the tail. My counting skill is too bad. ;)

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread spir via Digitalmars-d-learn
On 17/10/14 07:38, maarten van damme via Digitalmars-d-learn wrote: While d can be complex, there's nothing preventing you from starting out simple and not using all features at first. I don't understand why it's not suitable for a beginner if you use this approach... For some reasons, in my

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread via Digitalmars-d-learn
On Friday, 17 October 2014 at 05:38:51 UTC, maarten van damme via Digitalmars-d-learn wrote: While d can be complex, there's nothing preventing you from starting out simple and not using all features at first. I don't understand why it's not suitable for a beginner if you use this approach...

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread spir via Digitalmars-d-learn
On 17/10/14 03:05, ketmar via Digitalmars-d-learn wrote: On Fri, 17 Oct 2014 00:52:14 + MachineCode via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I don't understand. If at least it were C but java? why not D itself? C is *awful* as beginner's language. never ever let

Re: String created from buffer has wrong length and strip() result is incorrect

2014-10-17 Thread spir via Digitalmars-d-learn
On 17/10/14 09:29, thedeemon via Digitalmars-d-learn wrote: On Friday, 17 October 2014 at 06:29:24 UTC, Lucas Burson wrote: // This is where things breaks { ubyte[] buff = new ubyte[16]; buff[0..ATA_STR.length] = cast(ubyte[])(ATA_STR); // read the string back from the

Re: Any dub tips and tricks

2014-10-17 Thread Atila Neves via Digitalmars-d-learn
Are you sure your package/dub.json is valid JSON? You can check it here: http://jsonlint.com/ Atila On Thursday, 16 October 2014 at 22:22:14 UTC, Joel wrote: Any way of using dub (on Windows or OSX). I've been trying it lately, but not much success. 1. (In the command prompt or Terminal),

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread bearophile via Digitalmars-d-learn
Ola Fosheim Grøstad: The IDE support is probably a bit better with Java/C# The importance of the IDE for the first language is controversial. I think it's not so important. and using a statically typed language as your first language has advantages, While no one has determined

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread Paulo Pinto via Digitalmars-d-learn
On Friday, 17 October 2014 at 01:05:37 UTC, ketmar via Digitalmars-d-learn wrote: On Fri, 17 Oct 2014 00:52:14 + MachineCode via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I don't understand. If at least it were C but java? why not D itself? C is *awful* as beginner's

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread via Digitalmars-d-learn
On Friday, 17 October 2014 at 08:33:46 UTC, bearophile wrote: The IDE support is probably a bit better with Java/C# The importance of the IDE for the first language is controversial. I think it's not so important. Perhaps it depends on the person and the language, but I would think

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread Chris via Digitalmars-d-learn
On Thursday, 16 October 2014 at 22:26:51 UTC, RBfromME wrote: I'm a newbie to programming and have been looking into the D lang as a general purposing language to learn, yet the D overview indicates that java would be a better language to learn for your first programming language. Why? Looks

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread ketmar via Digitalmars-d-learn
On Fri, 17 Oct 2014 10:10:09 +0200 spir via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: What you say here applies, I guess, to many other points. I applaud Ali for writing a tutorial like his but... Check it (just the first pages is enough) for literally the dozens of notions

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread ketmar via Digitalmars-d-learn
On Fri, 17 Oct 2014 04:51:14 + via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I personally think Logo, Processing and Scheme would be more fun as learning tools, but they are throw-away languages. yet Scheme will teach how to write functional code. it's a valuable

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread ketmar via Digitalmars-d-learn
On Fri, 17 Oct 2014 13:13:36 + Kagamin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: In IDE you press F5 and see the program running. with REPL you typing code, pressing enter and see the code running. signature.asc Description: PGP signature

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread Jessica Rauth via Digitalmars-d-learn
On Friday, 17 October 2014 at 08:44:00 UTC, Paulo Pinto wrote: On Friday, 17 October 2014 at 01:05:37 UTC, ketmar via Digitalmars-d-learn wrote: On Fri, 17 Oct 2014 00:52:14 + MachineCode via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I don't understand. If at least it

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread Jesse Phillips via Digitalmars-d-learn
On Thursday, 16 October 2014 at 22:26:51 UTC, RBfromME wrote: I'm a newbie to programming and have been looking into the D lang as a general purposing language to learn, yet the D overview indicates that java would be a better language to learn for your first programming language. Why? Looks

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread eles via Digitalmars-d-learn
On Friday, 17 October 2014 at 13:59:03 UTC, ketmar via Digitalmars-d-learn wrote: On Fri, 17 Oct 2014 10:10:09 +0200 spir via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: computer programming is the literacy of the new age. Let's say, computer knowledge. There are also

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread ketmar via Digitalmars-d-learn
On Fri, 17 Oct 2014 14:33:57 + eles via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Friday, 17 October 2014 at 13:59:03 UTC, ketmar via Digitalmars-d-learn wrote: On Fri, 17 Oct 2014 10:10:09 +0200 spir via Digitalmars-d-learn digitalmars-d-learn@puremagic.com

Re: String created from buffer has wrong length and strip() result is incorrect

2014-10-17 Thread Lucas Burson via Digitalmars-d-learn
On Friday, 17 October 2014 at 08:31:04 UTC, spir via Digitalmars-d-learn wrote: On 17/10/14 09:29, thedeemon via Digitalmars-d-learn wrote: On Friday, 17 October 2014 at 06:29:24 UTC, Lucas Burson wrote: // This is where things breaks { ubyte[] buff = new ubyte[16];

Re: String created from buffer has wrong length and strip() result is incorrect

2014-10-17 Thread ketmar via Digitalmars-d-learn
On Fri, 17 Oct 2014 15:24:21 + Lucas Burson via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: So given the below buffer would I use fromStringz (is this in the stdlib?) to cast it from a null-terminated buffer to a good string? Shouldn't the compiler give a warning about

Re: String created from buffer has wrong length and strip() result is incorrect

2014-10-17 Thread ketmar via Digitalmars-d-learn
On Fri, 17 Oct 2014 18:30:43 +0300 ketmar via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Shouldn't the compiler give a warning about casting a buffer to a string without using fromStringz? nope. such casting is perfectly legal, as D strings can contain embedded '\0's.

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread Chris via Digitalmars-d-learn
On Friday, 17 October 2014 at 14:38:39 UTC, ketmar via Digitalmars-d-learn wrote: On Fri, 17 Oct 2014 14:33:57 + eles via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Friday, 17 October 2014 at 13:59:03 UTC, ketmar via Digitalmars-d-learn wrote: On Fri, 17 Oct 2014

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread ketmar via Digitalmars-d-learn
On Fri, 17 Oct 2014 15:40:24 + Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: But then people won't trust them bloody machines an inch anymore! :-) most people believe that technology is magic. yes, maybe it's too cruel to ruin their illusions... signature.asc

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread olivier henley via Digitalmars-d-learn
. D is pristine clean and immensely powerful. . D is arguably the actual state-of-the-art programming language. . Ali's book is a gem. Clear, concise and complete. http://ddili.org/ders/d.en/ . D is the best investment you can make for your career, right now. . D has Java beans for

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread via Digitalmars-d-learn
On Friday, 17 October 2014 at 14:00:43 UTC, ketmar via Digitalmars-d-learn wrote: yet Scheme will teach how to write functional code. it's a valuable knowledge for D programmer. I think spending a few days with Scheme is valuable for all programmers. By being a minimal language you get down

Re: String created from buffer has wrong length and strip() result is incorrect

2014-10-17 Thread Lucas Burson via Digitalmars-d-learn
On Friday, 17 October 2014 at 15:30:52 UTC, ketmar via Digitalmars-d-learn wrote: On Fri, 17 Oct 2014 15:24:21 + Lucas Burson via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: So given the below buffer would I use fromStringz (is this in the stdlib?) to cast it from a

Re: How to check i

2014-10-17 Thread Uranuz via Digitalmars-d-learn
This is

Recommended GUI library?

2014-10-17 Thread K.K. via Digitalmars-d-learn
I'm looking for suggestions for a GUI library, to create a somewhat light GUI that can also be created without too much fuss, and support for Windows Linux. The GUI I'm looking to make would be one that is just one window, with support for tabs (just like the ones in the properties page for

Re: How to match string by word

2014-10-17 Thread Uranuz via Digitalmars-d-learn
I haven't touched any key on a keyboard and haven't pressed *Send* but message was posted somehow. Thanks. Checking for UTF-8 continuation bytes is good idea. Also I agree that UTF-16 is more difficult. I will keep it for future release when implementation will start to work properly on UTF-8

Initializing D in C to use?

2014-10-17 Thread Jeremy DeHaan via Digitalmars-d-learn
I'm starting a new project, and I plan on creating a C interface in case other languages want to use it. I remember reading something(but my googlefu is weak today) about having to initialize the runtime if you are using D inside another language. Can anyone confirm this is the case? I just

Re: Recommended GUI library?

2014-10-17 Thread Jeremy DeHaan via Digitalmars-d-learn
I highly recommend gtkD. It works on Windows, OSX, and Linux and provides a very nice OO interface to Gtk+. http://gtkd.org/

Re: Recommended GUI library?

2014-10-17 Thread K.K. via Digitalmars-d-learn
On Friday, 17 October 2014 at 16:41:21 UTC, Jeremy DeHaan wrote: I highly recommend gtkD. It works on Windows, OSX, and Linux and provides a very nice OO interface to Gtk+. http://gtkd.org/ ooo looks pretty good. I'll go try it out; Thanks, Jeremy!

Why was scope for allocating classes on the stack marked for deprecation?

2014-10-17 Thread Jeremy DeHaan via Digitalmars-d-learn
I'm curious as to why using scope to allocate classes on the stack was marked for future deprecation. I mean, sure it could be potentially unsafe, but the new library solution (using std.typecons.scoped) does the exact same thing and is just as unsafe for the same reasons, is it not? I would

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread Paulo Pinto via Digitalmars-d-learn
Am 17.10.2014 um 16:14 schrieb Jessica Rauth: On Friday, 17 October 2014 at 08:44:00 UTC, Paulo Pinto wrote: On Friday, 17 October 2014 at 01:05:37 UTC, ketmar via Digitalmars-d-learn wrote: On Fri, 17 Oct 2014 00:52:14 + MachineCode via Digitalmars-d-learn

Re: Initializing D in C to use?

2014-10-17 Thread K.K. via Digitalmars-d-learn
On Friday, 17 October 2014 at 16:35:46 UTC, Jeremy DeHaan wrote: I'm starting a new project, and I plan on creating a C interface in case other languages want to use it. I remember reading something(but my googlefu is weak today) about having to initialize the runtime if you are using D inside

Re: Recommended GUI library?

2014-10-17 Thread Gary Willoughby via Digitalmars-d-learn
On Friday, 17 October 2014 at 16:34:04 UTC, K.K. wrote: I'm looking for suggestions for a GUI library, to create a somewhat light GUI that can also be created without too much fuss, and support for Windows Linux. The GUI I'm looking to make would be one that is just one window, with support

Re: Why was scope for allocating classes on the stack marked for deprecation?

2014-10-17 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 17 October 2014 at 16:56:50 UTC, Jeremy DeHaan wrote: I'm curious as to why using scope to allocate classes on the stack was marked for future deprecation. It was never implemented correctly (it is supposed prove it never leaves the scope, and is thus safe to be on the stack), so

Re: Initializing D in C to use?

2014-10-17 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 17 October 2014 at 16:35:46 UTC, Jeremy DeHaan wrote: I remember reading something(but my googlefu is weak today) about having to initialize the runtime if you are using D inside another language. Can anyone confirm this is the case? Yeah, unless the main() is in D, you need to run

Re: Initializing D in C to use?

2014-10-17 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 17 October 2014 at 17:14:30 UTC, K.K. wrote: Sorry if this isn't the most helpful answer but.. Do you have Adam Ruppe's book? buy my book too, and write amazon reviews :P A lot of the topics in there were chosen because there are questions that come up somewhat often on this forum

Re: Initializing D in C to use?

2014-10-17 Thread bachmeier via Digitalmars-d-learn
On Friday, 17 October 2014 at 17:18:34 UTC, Adam D. Ruppe wrote: On Friday, 17 October 2014 at 16:35:46 UTC, Jeremy DeHaan wrote: I remember reading something(but my googlefu is weak today) about having to initialize the runtime if you are using D inside another language. Can anyone confirm

Re: Using __traits to find functions in sub-modules

2014-10-17 Thread nrgyzer via Digitalmars-d-learn
On Thursday, 16 October 2014 at 19:19:21 UTC, John Colvin wrote: On Thursday, 16 October 2014 at 18:39:50 UTC, nrgyzer wrote: Hi, I'm using structs to describe my functions: struct example { string name; uint someValue; } module mod.example1; @example(example1, 1) void myFunction() { //

Re: String created from buffer has wrong length and strip() result is incorrect

2014-10-17 Thread ketmar via Digitalmars-d-learn
On Fri, 17 Oct 2014 16:08:04 + Lucas Burson via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: The buffer is populated from a scsi ioctl so it should be only ascii and null-terminated but it's a good idea to harden the code a bit. Thank you for your help! i developed a

Function parameters from TypeTuple

2014-10-17 Thread Tofu Ninja via Digitalmars-d-learn
Basicly what I am trying to do is have a function template that will generate its parameters to be arrays of the types of a type tuple. So for instance the parameters of f!(int, char) would be (int[], char[])... No matter what I try, the compiler vomits all over me...

Re: Function parameters from TypeTuple

2014-10-17 Thread ketmar via Digitalmars-d-learn
On Fri, 17 Oct 2014 17:44:47 + Tofu Ninja via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Basicly what I am trying to do is have a function template that will generate its parameters to be arrays of the types of a type tuple. So for instance the parameters of f!(int,

Re: Function parameters from TypeTuple

2014-10-17 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 17 October 2014 at 17:44:48 UTC, Tofu Ninja wrote: Not sure if what I wrote made sense, instead I will just post the code that is vomiting on me... template arrayType(T) { alias arrayType = T[]; } template multiAccess(Args ...) { auto multiAccess(int i,

Re: Function parameters from TypeTuple

2014-10-17 Thread Ali Çehreli via Digitalmars-d-learn
On 10/17/2014 10:44 AM, Tofu Ninja wrote: Basicly what I am trying to do is have a function template that will generate its parameters to be arrays of the types of a type tuple. So for instance the parameters of f!(int, char) would be (int[], char[])... No matter what I try, the compiler

Re: Function parameters from TypeTuple

2014-10-17 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 17 October 2014 at 17:55:14 UTC, Ali Çehreli wrote: Yeah.. I dont think I was clear the first time...

Re: Function parameters from TypeTuple

2014-10-17 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 17 October 2014 at 17:57:58 UTC, Tofu Ninja wrote: Also my inability to get this working is probably rooted in my lack of understanding of the differences between tuple vs Tuple vs TypeTuple vs expression tuples ...

Re: Function parameters from TypeTuple

2014-10-17 Thread ketmar via Digitalmars-d-learn
On Fri, 17 Oct 2014 17:57:57 + Tofu Ninja via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Friday, 17 October 2014 at 17:44:48 UTC, Tofu Ninja wrote: Not sure if what I wrote made sense, instead I will just post the code that is vomiting on me... still can't grasp

Re: Function parameters from TypeTuple

2014-10-17 Thread Justin Whear via Digitalmars-d-learn
On Fri, 17 Oct 2014 17:44:47 +, Tofu Ninja wrote: Basicly what I am trying to do is have a function template that will generate its parameters to be arrays of the types of a type tuple. So for instance the parameters of f!(int, char) would be (int[], char[])... No matter what I try,

Re: Function parameters from TypeTuple

2014-10-17 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 17 October 2014 at 18:22:12 UTC, ketmar via Digitalmars-d-learn wrote: On Fri, 17 Oct 2014 17:57:57 + Tofu Ninja via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Friday, 17 October 2014 at 17:44:48 UTC, Tofu Ninja wrote: Not sure if what I wrote made sense,

Re: Function parameters from TypeTuple

2014-10-17 Thread Ali Çehreli via Digitalmars-d-learn
On 10/17/2014 11:35 AM, Tofu Ninja wrote: I am not even sure any more, I am starting to get lost in the tuple madness... You want to write a function that takes an index and a number of arrays; and returns an N-ary Tuple where N matches the number arrays passed to the function: :p

Re: Function parameters from TypeTuple

2014-10-17 Thread anonymous via Digitalmars-d-learn
On Friday, 17 October 2014 at 17:57:58 UTC, Tofu Ninja wrote: On Friday, 17 October 2014 at 17:44:48 UTC, Tofu Ninja wrote: Not sure if what I wrote made sense, instead I will just post the code that is vomiting on me... You forgot the imports. template arrayType(T) { alias

Re: How to match string by word

2014-10-17 Thread eles via Digitalmars-d-learn
On Friday, 17 October 2014 at 16:39:38 UTC, Uranuz wrote: I haven't touched any key on a keyboard and haven't pressed *Send* but message was posted somehow. Scan for rootkits...

Re: Function parameters from TypeTuple

2014-10-17 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 17 October 2014 at 19:03:42 UTC, anonymous wrote: On Friday, 17 October 2014 at 17:57:58 UTC, Tofu Ninja wrote: On Friday, 17 October 2014 at 17:44:48 UTC, Tofu Ninja wrote: Not sure if what I wrote made sense, instead I will just post the code that is vomiting on me... You

Re: How to match string by word

2014-10-17 Thread ketmar via Digitalmars-d-learn
On Fri, 17 Oct 2014 19:13:51 + eles via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Friday, 17 October 2014 at 16:39:38 UTC, Uranuz wrote: I haven't touched any key on a keyboard and haven't pressed *Send* but message was posted somehow. Scan for rootkits... or

Re: Function parameters from TypeTuple

2014-10-17 Thread anonymous via Digitalmars-d-learn
On Friday, 17 October 2014 at 19:18:29 UTC, Tofu Ninja wrote: I had the imports, I just didn't post them. My problem is most likely that I used Tuple! instead of tuple... which is probably because the differences between the like 20(exaggeration) different types of tuples in D are confusing as

Re: Function parameters from TypeTuple

2014-10-17 Thread Justin Whear via Digitalmars-d-learn
On Fri, 17 Oct 2014 11:56:31 -0700, Ali Çehreli wrote: You want to write a function that takes an index and a number of arrays; and returns an N-ary Tuple where N matches the number arrays passed to the function: :p http://dlang.org/phobos/std_range.html#transversal

Re: Function parameters from TypeTuple

2014-10-17 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 17 October 2014 at 19:32:40 UTC, anonymous wrote: On Friday, 17 October 2014 at 19:18:29 UTC, Tofu Ninja wrote: I had the imports, I just didn't post them. My problem is most likely that I used Tuple! instead of tuple... which is probably because the differences between the like

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread Joakim via Digitalmars-d-learn
On Friday, 17 October 2014 at 13:59:03 UTC, ketmar via Digitalmars-d-learn wrote: that's why i'm sure that basic programming must be teached in school. hey, the whole our civilization will collapse without computers! computer programming is the literacy of the new age. This is nonsense and I

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread ketmar via Digitalmars-d-learn
On Fri, 17 Oct 2014 20:40:37 + Joakim via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Friday, 17 October 2014 at 13:59:03 UTC, ketmar via Digitalmars-d-learn wrote: that's why i'm sure that basic programming must be teached in school. hey, the whole our

Re: Any dub tips and tricks

2014-10-17 Thread Joel via Digitalmars-d-learn
On Friday, 17 October 2014 at 08:32:13 UTC, Atila Neves wrote: Are you sure your package/dub.json is valid JSON? You can check it here: http://jsonlint.com/ Atila On Thursday, 16 October 2014 at 22:22:14 UTC, Joel wrote: Any way of using dub (on Windows or OSX). I've been trying it lately,

Re: Any dub tips and tricks

2014-10-17 Thread John Colvin via Digitalmars-d-learn
On Friday, 17 October 2014 at 22:01:22 UTC, Joel wrote: On Friday, 17 October 2014 at 08:32:13 UTC, Atila Neves wrote: Are you sure your package/dub.json is valid JSON? You can check it here: http://jsonlint.com/ Atila On Thursday, 16 October 2014 at 22:22:14 UTC, Joel wrote: Any way of

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread Joakim via Digitalmars-d-learn
On Friday, 17 October 2014 at 21:20:29 UTC, ketmar via Digitalmars-d-learn wrote: On Fri, 17 Oct 2014 20:40:37 + Joakim via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: This is nonsense and I see it repeated all the time, with code.org and other efforts. Do you know how

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread ketmar via Digitalmars-d-learn
On Fri, 17 Oct 2014 23:31:45 + Joakim via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: You do realize that most people are clueless about how to fix those also, right? most people are stupid. Would you require that how to fix all that mechanical stuff be taught in

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread ketmar via Digitalmars-d-learn
On Sat, 18 Oct 2014 03:05:58 +0300 ketmar via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: p.p.s. just in case: i'm not talking about personalities here, sorry if i was offencive. signature.asc Description: PGP signature

Re: String created from buffer has wrong length and strip() result is incorrect

2014-10-17 Thread Lucas Burson via Digitalmars-d-learn
On Friday, 17 October 2014 at 17:40:09 UTC, ketmar via Digitalmars-d-learn wrote: i developed a habit of making such buffers one byte bigger than necessary and just setting the last byte to 0 before converting. this way it's guaranteed to be 0-terminated. Perfect, great idea. Below is my

Re: String created from buffer has wrong length and strip() result is incorrect

2014-10-17 Thread ketmar via Digitalmars-d-learn
On Sat, 18 Oct 2014 00:32:09 + Lucas Burson via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Friday, 17 October 2014 at 17:40:09 UTC, ketmar via Digitalmars-d-learn wrote: i developed a habit of making such buffers one byte bigger than necessary and just setting

Re: String created from buffer has wrong length and strip() result is incorrect

2014-10-17 Thread ketmar via Digitalmars-d-learn
On Sat, 18 Oct 2014 00:32:09 + Lucas Burson via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: p.s. it's ok to take '.length' from 'null' array. compiler is smart enough. signature.asc Description: PGP signature

Does the grammar allow an alias statement without a semicolon?

2014-10-17 Thread Solomon E via Digitalmars-d-learn
Hi, everyone, first post here. I'm trying to learn to parse D code. The line alias StorageClassesopt BasicType Declarator in http://dlang.org/grammar#AliasDeclaration is apparently missing a semicolon after Declarator. If that line is not missing a semicolon, could someone please explain

Re: Does the grammar allow an alias statement without a semicolon?

2014-10-17 Thread ketmar via Digitalmars-d-learn
On Sat, 18 Oct 2014 00:52:22 + Solomon E via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: The line alias StorageClassesopt BasicType Declarator in http://dlang.org/grammar#AliasDeclaration is apparently missing a semicolon after Declarator. this line should be removed

Re: Initializing D in C to use?

2014-10-17 Thread Jeremy DeHaan via Digitalmars-d-learn
On Friday, 17 October 2014 at 17:21:11 UTC, Adam D. Ruppe wrote: On Friday, 17 October 2014 at 17:14:30 UTC, K.K. wrote: Sorry if this isn't the most helpful answer but.. Do you have Adam Ruppe's book? buy my book too, and write amazon reviews :P A lot of the topics in there were chosen

Re: Does the grammar allow an alias statement without a semicolon?

2014-10-17 Thread thedeemon via Digitalmars-d-learn
On Saturday, 18 October 2014 at 00:52:23 UTC, Solomon E wrote: Hi, everyone, first post here. I'm trying to learn to parse D code. Just in case, I'll remind these two projects that might be helpful: https://github.com/Hackerpilot/libdparse https://github.com/Hackerpilot/DGrammar

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread RBfromME via Digitalmars-d-learn
On Thursday, 16 October 2014 at 22:26:51 UTC, RBfromME wrote: I'm a newbie to programming and have been looking into the D lang as a general purposing language to learn, yet the D overview indicates that java would be a better language to learn for your first programming language. Why? Looks

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread Rikki Cattermole via Digitalmars-d-learn
On 18/10/2014 3:00 p.m., RBfromME wrote: On Thursday, 16 October 2014 at 22:26:51 UTC, RBfromME wrote: I'm a newbie to programming and have been looking into the D lang as a general purposing language to learn, yet the D overview indicates that java would be a better language to learn for your

Re: Does the grammar allow an alias statement without a semicolon?

2014-10-17 Thread Solomon E via Digitalmars-d-learn
Thank you both. That DGrammar project has some different names for the nonterminals in its grammar, and a different arrangement, but it confirms there should be a semicolon with any alias statement. I'm just trying to parse D when I read it myself so far, and figure out how the grammar works a

Re: Does the grammar allow an alias statement without a semicolon?

2014-10-17 Thread ketmar via Digitalmars-d-learn
On Sat, 18 Oct 2014 02:54:21 + Solomon E via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Thank you both. That DGrammar project has some different names for the nonterminals in its grammar, and a different arrangement, but it confirms there should be a semicolon with any