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

2014-10-18 Thread via Digitalmars-d-learn
On Saturday, 18 October 2014 at 02:00:42 UTC, RBfromME wrote: but i don't find the basics any easier to learn than D's. The biggest issue i personal find in getting deeper into a language is the docs and examples. The python examples, beyond the basics usually get write into OO so you find

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

2014-10-18 Thread Mike James 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

gdc: Compile error with normalize from std.uni

2014-10-18 Thread slycelote via Digitalmars-d-learn
I'm using gdc on Ubuntu 14.04. Is this ubuntu packaging issue? bash:~/tmp$ cat test2.d import std.uni, std.stdio; void main() { writeln(normalize(Hello)); } bash:~/tmp$ gdc test2.d /usr/include/d/4.8/std/uni.d:6301: error: undefined identifier tuple /usr/include/d/4.8/std/uni.d:6262:

Re: Returning multiple arrays from function - struct or byref the only option?

2014-10-18 Thread Laeeth Isharc via Digitalmars-d-learn
Thanks for the thoughts Meta and Ali. Laeeth. On Wednesday, 15 October 2014 at 17:56:06 UTC, Ali Çehreli wrote: On 10/15/2014 09:48 AM, Laeeth Isharc wrote: struct RetStruct { double[] a; double[] b; } RetStruct myfunction(double x) That's my preference. Tuples would work

Re: gdc: Compile error with normalize from std.uni

2014-10-18 Thread ketmar via Digitalmars-d-learn
On Sat, 18 Oct 2014 10:01:51 + slycelote via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I'm using gdc on Ubuntu 14.04. Is this ubuntu packaging issue? yes. current gdc works fine. signature.asc Description: PGP signature

Re: Returning multiple arrays from function - struct or byref the only option?

2014-10-18 Thread Meta via Digitalmars-d-learn
On Wednesday, 15 October 2014 at 17:56:06 UTC, Ali Çehreli wrote: - Unlike a struct, the members are anonymous. (Yes, tuples members can have names as well but not when returning or creating conveniently by 'return tuple(a, b)'.) This works, but I agree it is a bit obscure (you may want to

Re: Recommended GUI library?

2014-10-18 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-10-17 18:34, 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. Have a look at DWT [1]. It's basically the only D GUI framework that doesn't have any dependencies

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

2014-10-18 Thread Lucas Burson via Digitalmars-d-learn
On Saturday, 18 October 2014 at 00:53:57 UTC, ketmar via Digitalmars-d-learn wrote: On Sat, 18 Oct 2014 00:32:09 + Lucas Burson via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Wow, your changes made it much simpler. Thank you for the suggestions and expertise ketmar :)

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

2014-10-18 Thread ketmar via Digitalmars-d-learn
On Sat, 18 Oct 2014 16:56:09 + Lucas Burson via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Wow, your changes made it much simpler. Thank you for the suggestions and expertise ketmar :) you're welcome. signature.asc Description: PGP signature

Re: Recommended GUI library?

2014-10-18 Thread K.K. via Digitalmars-d-learn
Thanks for the extra suggestions! I'll check them out.

[OT] the uses of computing

2014-10-18 Thread Joakim via Digitalmars-d-learn
On Saturday, 18 October 2014 at 00:06:10 UTC, ketmar via Digitalmars-d-learn wrote: 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

Re: Any dub tips and tricks

2014-10-18 Thread Joel via Digitalmars-d-learn
There is a mistake in the dil package.json excludedSourceFiles should be an array of strings, not just a string. But I don't get those errors on my OSX.

Re: [OT] the uses of computing

2014-10-18 Thread ketmar via Digitalmars-d-learn
On Sat, 18 Oct 2014 19:42:50 + Joakim via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: most people are stupid. No disagreement there, but even the smart ones can only learn so much. that's why we should teach kids alot of things while their minds are clear and ready to

Re: [OT] the uses of computing

2014-10-18 Thread Joakim via Digitalmars-d-learn
On Saturday, 18 October 2014 at 20:50:42 UTC, ketmar via Digitalmars-d-learn wrote: On Sat, 18 Oct 2014 19:42:50 + Joakim via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: most people are stupid. No disagreement there, but even the smart ones can only learn so much.

Assignment to enumerated string, is content copied or array information?

2014-10-18 Thread tcak via Digitalmars-d-learn
enum Values: string{ NONE = , Value1 = Apple, Value2 = Peach, Value3 = Lemon } Values lastHeldValue = Value3; Is the lastHeldValue just pointer + length information, and it points to Lemon; or is Lemon copied to another place in memory? I am doing comparison as if( lastHeldValue ==

DDoc module description?

2014-10-18 Thread Jeremy DeHaan via Digitalmars-d-learn
Although perhaps unnecessary, I added DDoc documentation to my module for a short description of the body. This showed up in the place I wanted it to be in when I built the html documentation, so I was pretty happy. (below the module name and before any module members) I then went to

Re: Assignment to enumerated string, is content copied or array information?

2014-10-18 Thread Meta via Digitalmars-d-learn
On Saturday, 18 October 2014 at 23:51:53 UTC, tcak wrote: enum Values: string{ NONE = , Value1 = Apple, Value2 = Peach, Value3 = Lemon } Values lastHeldValue = Value3; Is the lastHeldValue just pointer + length information, and it points to Lemon; or is Lemon copied to another place

How to convert from ubyte[] to and from float?

2014-10-18 Thread Charles Hixson via Digitalmars-d-learn
What is the best way to convert from a part of a ubyte[] to a float? I've tried converting the ubyte[] into a uint, but neither casting the uint to a float nor to!float work. I suppose I could use a trick record union, but that seems inelegant. If I use pointers, the alignment may

Re: [OT] the uses of computing

2014-10-18 Thread ketmar via Digitalmars-d-learn
On Sat, 18 Oct 2014 23:38:35 + Joakim via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: don't you think that we are going in circles now? not that i'm tired of this conversation, but i see that we get each other's POVs, and have no more arguments to convince each other. ;-) i

Re: How to convert from ubyte[] to and from float?

2014-10-18 Thread Ali Çehreli via Digitalmars-d-learn
On 10/18/2014 06:06 PM, Charles Hixson via Digitalmars-d-learn wrote: What is the best way to convert from a part of a ubyte[] to a float? I've tried converting the ubyte[] into a uint, but neither casting the uint to a float nor to!float work. I suppose I could use a trick record union, but