Re: Travis-CI support for D

2014-12-13 Thread ZombineDev via Digitalmars-d-announce
Thanks for the great work! Is it possible to also include dmd+druntimie+phobos git-head? It would be helpful to know if your project can be built with the new version of DMD (when it is officially released) ahead of time. If you are using some yet-to be deprecated code you can fix the issue

Re: Travis-CI support for D

2014-12-13 Thread ZombineDev via Digitalmars-d-announce
In the light of the DMD 2.066 regressions, I believe this would help bring the DMD release process closer to continuous delivery. https://www.youtube.com/watch?v=IBghnXBz3_w https://www.youtube.com/watch?v=igwFj8PPSnw

Re: Travis-CI support for D

2014-12-13 Thread Martin Nowak via Digitalmars-d-announce
On 12/13/2014 02:59 PM, ZombineDev wrote: Thanks for the great work! Is it possible to also include dmd+druntimie+phobos git-head? It would be helpful to know if your project can be built with the new version of DMD (when it is officially released) ahead of time. If you are using some yet-to

Re: Travis-CI support for D

2014-12-13 Thread Ellery Newcomer via Digitalmars-d-announce
On 12/10/2014 08:50 PM, Martin Nowak wrote: Glad to announce that D support on Travis-CI was launched today. I'm a noob when it comes to travis, so it isn't readily apparent to me, but given this, would travis support a build that installs a d compiler and also some version of python?

Re: Travis-CI support for D

2014-12-13 Thread ZombineDev via Digitalmars-d-announce
I agree with most of your points. I don't think that anyone should consider master (git head) as even remotely stable. It's about testing experimental features in early stages of development. That said, I still think that more testing can't do any harm. Additionally, having pre-alpha releases

Re: Travis-CI support for D

2014-12-13 Thread ZombineDev via Digitalmars-d-announce
Many successful software projects provide a way to get early, unstable versions if one desires to do so. For example Firefox has 4 channels with corresponding levels of stability: https://hacks.mozilla.org/2012/05/firefox-and-the-release-channels/

Re: Travis-CI support for D

2014-12-13 Thread Rikki Cattermole via Digitalmars-d-announce
On 14/12/2014 4:28 a.m., Martin Nowak wrote: On 12/13/2014 02:59 PM, ZombineDev wrote: Thanks for the great work! Is it possible to also include dmd+druntimie+phobos git-head? It would be helpful to know if your project can be built with the new version of DMD (when it is officially released)

Re: Travis-CI support for D

2014-12-13 Thread ZombineDev via Digitalmars-d-announce
On Saturday, 13 December 2014 at 23:16:24 UTC, ZombineDev wrote: Many successful software projects provide a way to get early, unstable versions if one desires to do so. For example Firefox has 4 channels with corresponding levels of stability:

Sargon component library now on Dub

2014-12-13 Thread Walter Bright via Digitalmars-d-announce
http://code.dlang.org/packages/sargon These two modules failed to generate much interest in incorporating them into Phobos, but I'm still rather proud of them :-) Here they are: ◦sargon.lz77 - algorithms to compress and expand with LZ77 compression algorithm ◦sargon.halffloat - IEEE 754

Re: DIP69 - Implement scope for escape proof references

2014-12-13 Thread bearophile via Digitalmars-d
Walter Bright: struct Tree { RefCount!(Tree*) left; RefCount!(Tree*) right; ... } ... I don't think I'd ever have a use for this code. You have no use for tree structures? Giving a reference counter to every pointer in a binary tree sounds a bit too much. Bye, bearophile

Re: Posix dynamic library initialization and finalization

2014-12-13 Thread Jacob Carlborg via Digitalmars-d
On 2014-12-13 01:38, Adam D. Ruppe wrote: I was just talking on IRC with someone about a dynamic library on linux in D being called from a C program. The runtime wasn't initialized and he couldn't modify the C program to add an extra call. I kidna thought rt_init would be done automatically in

Why do you write D2 compiler using C++ language?

2014-12-13 Thread ddj via Digitalmars-d
You already have better D1.

Re: Why do you write D2 compiler using C++ language?

2014-12-13 Thread Rikki Cattermole via Digitalmars-d
On 14/12/2014 12:38 a.m., ddj wrote: You already have better D1. The usage of c++ for dmd front end is the original language for it. Aka it would be rather hard to write a front end for D without a D compiler. Its currently being ported over to D. As for why it wasn't changed over when D2

Re: Why do you write D2 compiler using C++ language?

2014-12-13 Thread ketmar via Digitalmars-d
On Sat, 13 Dec 2014 11:38:47 + ddj via Digitalmars-d digitalmars-d@puremagic.com wrote: You already have better D1. as D2 wasn't created from the scratch, it was easier to reuse already written c++ code. there is no big difference in having D2 compiler written in c++ or in D1, both of them

Re: Why do you write D2 compiler using C++ language?

2014-12-13 Thread ddj via Digitalmars-d
Replacing unsupported D1 with unfinished D2 does not seem to me like good idea for language. I like D, and I wish to learn it and use it. But so many issues and bug fixes scares me from using it. High activity in the project to me does not look like sign of good support, more like unstable

Re: Why do you write D2 compiler using C++ language?

2014-12-13 Thread ddj via Digitalmars-d
But then you miss all great features of D, all protection from bugs that D offers, like contracts and tests! Initial saving time cost more in long term On Saturday, 13 December 2014 at 12:19:19 UTC, Rikki Cattermole wrote: On 14/12/2014 12:38 a.m., ddj wrote: You already have better D1.

Re: DIP69 - Implement scope for escape proof references

2014-12-13 Thread Max Samukha via Digitalmars-d
On Saturday, 13 December 2014 at 02:55:50 UTC, Manu via Digitalmars-d wrote: Templates and functions are different things. I think it's a massive mistake to have created a way to write a template that looks nothing like a template. That is a misconception spread by C++. Templates are pure

Re: Why do you write D2 compiler using C++ language?

2014-12-13 Thread ketmar via Digitalmars-d
On Sat, 13 Dec 2014 13:55:27 + ddj via Digitalmars-d digitalmars-d@puremagic.com wrote: Replacing unsupported D1 with unfinished D2 does not seem to me like good idea for language. that's right. we need D3, 'cause D2 is cluttered with legacy crap. ;-) But so many issues and bug fixes

Re: Why do you write D2 compiler using C++ language?

2014-12-13 Thread ddj via Digitalmars-d
nobody forces you to use current developement versions. stick with the version of your choice (2.066 for example), that's all. Unfortunately it is unclear to me how many current bugs/issues are related to stable version. On another side, I do not like to use stable but crippled version

Re: Why do you write D2 compiler using C++ language?

2014-12-13 Thread ketmar via Digitalmars-d
On Sat, 13 Dec 2014 14:48:03 + ddj via Digitalmars-d digitalmars-d@puremagic.com wrote: nobody forces you to use current developement versions. stick with the version of your choice (2.066 for example), that's all. Unfortunately it is unclear to me how many current bugs/issues are

Re: ICU D Wrapper

2014-12-13 Thread Sean Kelly via Digitalmars-d
On Friday, 12 December 2014 at 17:57:41 UTC, Trent Forkert wrote: I've looked into writing a binding for ICU recently, but ultimately decided to abandon that idea in favor of writing a replacement for it in D. Wow... really? You're actually going to write transcoders for all available

Re: unnecessary OS redundancy in druntime

2014-12-13 Thread Joakim via Digitalmars-d
On Friday, 12 December 2014 at 17:14:01 UTC, Martin Nowak wrote: On 12/12/2014 04:47 PM, Joakim wrote: I asked about this on github but didn't get a good answer, so I'm asking here. What's with all the repeated OS blocks in druntime? No, you don't want to accept the answer. That's slightly

Re: DIP69 - Implement scope for escape proof references

2014-12-13 Thread Jacob Carlborg via Digitalmars-d
On 2014-12-13 01:09, Walter Bright wrote: The proposal provides escape proof passing of arguments. This is necessary in order to make rc safe, for example. What are you looking for? Passing references to stack allocated data to functions safely is one idea that comes to mind. -- /Jacob

Re: DIP69 - Implement scope for escape proof references

2014-12-13 Thread Jacob Carlborg via Digitalmars-d
On 2014-12-13 06:11, Walter Bright wrote: Don't make it extern, then. He's said a couple of time he's interfacing with C and/or C++ code. Why are function pointers and ints going to the same argument of a function? I thought you weren't using templates? I think he meant taking the address

Re: ICU D Wrapper

2014-12-13 Thread Trent Forkert via Digitalmars-d
On Saturday, 13 December 2014 at 15:44:59 UTC, Sean Kelly wrote: On Friday, 12 December 2014 at 17:57:41 UTC, Trent Forkert wrote: I've looked into writing a binding for ICU recently, but ultimately decided to abandon that idea in favor of writing a replacement for it in D. Wow... really?

Re: std.stdint seems to be an outcast?

2014-12-13 Thread Dan Olson via Digitalmars-d
Gary Willoughby d...@nomad.so writes: There is a module called std.stdint located here: http://dlang.org/phobos/std_stdint.html but it doesn't appear in the documentation index here: http://dlang.org/phobos/index.html Not only that but when looking at the source it's just publicly

Re: DIP69 - Implement scope for escape proof references

2014-12-13 Thread Walter Bright via Digitalmars-d
On 12/13/2014 8:01 AM, Jacob Carlborg wrote: On 2014-12-13 01:09, Walter Bright wrote: The proposal provides escape proof passing of arguments. This is necessary in order to make rc safe, for example. What are you looking for? Passing references to stack allocated data to functions safely

Re: D3

2014-12-13 Thread ddj via Digitalmars-d
On Monday, 8 December 2014 at 20:21:51 UTC, Andrej Mitrovic via Digitalmars-d wrote: On 12/8/14, Russel Winder via Digitalmars-d digitalmars-d@puremagic.com wrote: It seems that D3 is already available: https://github.com/mbostock/d3 Guess we'll just have to skip a number and call the next D

Re: DIP69 - Implement scope for escape proof references

2014-12-13 Thread Walter Bright via Digitalmars-d
On 12/13/2014 2:10 AM, bearophile wrote: Walter Bright: struct Tree { RefCount!(Tree*) left; RefCount!(Tree*) right; ... } ... I don't think I'd ever have a use for this code. You have no use for tree structures? Giving a reference counter to every pointer in a binary tree

Re: Why do you write D2 compiler using C++ language?

2014-12-13 Thread ddj via Digitalmars-d
Unfortunately it is unclear to me how many current bugs/issues are related to stable version. On another side, I do not like to use stable but crippled version there are some fixes that are going to 2.066, and there is the plan to eventually release 2.066.1 (already here), 2.066.2, etc. with

Re: DIP69 - Implement scope for escape proof references

2014-12-13 Thread Walter Bright via Digitalmars-d
On 12/13/2014 8:19 AM, Jacob Carlborg wrote: On 2014-12-13 06:11, Walter Bright wrote: Don't make it extern, then. He's said a couple of time he's interfacing with C and/or C++ code. Yes, and C++ code is either ref or not ref, and it is not a problem to insert 'ref' or not, manually.

Re: DIP69 - Implement scope for escape proof references

2014-12-13 Thread Walter Bright via Digitalmars-d
On 12/13/2014 6:10 AM, Max Samukha wrote: On Saturday, 13 December 2014 at 02:55:50 UTC, Manu via Digitalmars-d wrote: Templates and functions are different things. I think it's a massive mistake to have created a way to write a template that looks nothing like a template. That is a

Re: D3

2014-12-13 Thread JN via Digitalmars-d
I suggest to call it The D.

Re: D game development: a call to action

2014-12-13 Thread Joel via Digitalmars-d
On Tuesday, 6 August 2013 at 06:23:09 UTC, qznc wrote: On Monday, 5 August 2013 at 18:18:30 UTC, Jonathan A Dunlap wrote: I am one of the few who have taken a keen interest in D for game development. The concise language and modern conveniences may be able to reduce many hours worth of

Re: Why do you write D2 compiler using C++ language?

2014-12-13 Thread Mike Parker via Digitalmars-d
On 12/13/2014 10:55 PM, ddj wrote: But so many issues and bug fixes scares me from using it. That's just the wrong way to look at it. Take a look at the bug list for gcc, any of the Java compilers, or clang. Are you afraid to use them as well?

Re: D game development: a call to action

2014-12-13 Thread uri via Digitalmars-d
On Saturday, 13 December 2014 at 22:49:10 UTC, Joel wrote: On Tuesday, 6 August 2013 at 06:23:09 UTC, qznc wrote: On Monday, 5 August 2013 at 18:18:30 UTC, Jonathan A Dunlap wrote: I am one of the few who have taken a keen interest in D for game development. The concise language and modern

Re: D game development: a call to action

2014-12-13 Thread Joel via Digitalmars-d
[snip] I am using DAllegro 5 for 2D stuff. So far, it went very smooth. I just use the original documentation. https://github.com/SiegeLord/DAllegro5 Who else uses DAllegro 5? I like it, just can't get it to work on OS X. I'm also using the Allegro bindings for a project and have run

Re: D game development: a call to action

2014-12-13 Thread Joel via Digitalmars-d
I'm using Windows. I get this error trying to compile the demo on DGame. C:\jpro\dpro2\OtherPeoples\Dgame-0.3.2\builddmd build.d Using the Digital Mars DMD compiler. C:\jpro\dpro2\OtherPeoples\Dgame-0.3.2\buildbuild.exe Assume 'C:\jpro\dpro2\OtherPeoples\derelict' as derelict path. Verify...

Re: DIP69 - Implement scope for escape proof references

2014-12-13 Thread Manu via Digitalmars-d
On 13 December 2014 at 15:11, Walter Bright via Digitalmars-d digitalmars-d@puremagic.com wrote: On 12/12/2014 6:55 PM, Manu via Digitalmars-d wrote: I did just give some examples, I'll repeat; auto ref fails when the function is extern. Don't make it extern, then. Do you think I just

Re: D game development: a call to action

2014-12-13 Thread Rikki Cattermole via Digitalmars-d
On 14/12/2014 1:25 p.m., Joel wrote: [snip] I am using DAllegro 5 for 2D stuff. So far, it went very smooth. I just use the original documentation. https://github.com/SiegeLord/DAllegro5 Who else uses DAllegro 5? I like it, just can't get it to work on OS X. I'm also using the Allegro

Re: D game development: a call to action

2014-12-13 Thread Manu via Digitalmars-d
On 6 August 2013 at 04:18, Jonathan A Dunlap jdun...@outlook.com wrote: I am one of the few who have taken a keen interest in D for game development. The concise language and modern conveniences may be able to reduce many hours worth of development time off a game project, while making the

Re: D game development: a call to action

2014-12-13 Thread Manu via Digitalmars-d
On 14 December 2014 at 11:00, Manu turkey...@gmail.com wrote: On 6 August 2013 at 04:18, Jonathan A Dunlap jdun...@outlook.com wrote: I am one of the few who have taken a keen interest in D for game development. The concise language and modern conveniences may be able to reduce many hours

Re: D game development: a call to action

2014-12-13 Thread Joel via Digitalmars-d
On Sunday, 14 December 2014 at 00:51:24 UTC, Rikki Cattermole wrote: On 14/12/2014 1:25 p.m., Joel wrote: [snip] I am using DAllegro 5 for 2D stuff. So far, it went very smooth. I just use the original documentation. https://github.com/SiegeLord/DAllegro5 Who else uses DAllegro 5? I like

Re: D game development: a call to action

2014-12-13 Thread Israel via Digitalmars-d
What my problem is, why hasnt the D standard library implemented a multimedia library from the ones already available? instead of having to go and look for one. Im sure this would cause alot of controversy because NO MY LIBRARY IS BETTER AND HAS MORE FEATURES THAN HIS. Its not about features.

Re: D game development: a call to action

2014-12-13 Thread ketmar via Digitalmars-d
On Sun, 14 Dec 2014 11:04:45 +1000 Manu via Digitalmars-d digitalmars-d@puremagic.com wrote: I'm also very interested in experiments writing game code on commercial-style engines. Hobby engines are nice, but we will get a much better feel for using D in the AAA games industry if a

Re: D game development: a call to action

2014-12-13 Thread ketmar via Digitalmars-d
On Sun, 14 Dec 2014 01:28:45 + Israel via Digitalmars-d digitalmars-d@puremagic.com wrote: What my problem is, why hasnt the D standard library implemented a multimedia library from the ones already available? instead of having to go and look for one. exactly why any other language except

Re: D game development: a call to action

2014-12-13 Thread Manu via Digitalmars-d
On 14 December 2014 at 16:57, ketmar via Digitalmars-d digitalmars-d@puremagic.com wrote: On Sun, 14 Dec 2014 11:04:45 +1000 Manu via Digitalmars-d digitalmars-d@puremagic.com wrote: I'm also very interested in experiments writing game code on commercial-style engines. Hobby engines are

Re: D game development: a call to action

2014-12-13 Thread Walter Bright via Digitalmars-d
On 12/13/2014 5:00 PM, Manu via Digitalmars-d wrote: my engine: https://github.com/TurkeyMan/fuji Please set fuji up at http://code.dlang.org !

Re: D game development: a call to action

2014-12-13 Thread ketmar via Digitalmars-d
On Sun, 14 Dec 2014 17:20:48 +1000 Manu via Digitalmars-d digitalmars-d@puremagic.com wrote: On 14 December 2014 at 16:57, ketmar via Digitalmars-d digitalmars-d@puremagic.com wrote: On Sun, 14 Dec 2014 11:04:45 +1000 Manu via Digitalmars-d digitalmars-d@puremagic.com wrote: I'm also

Re: D game development: a call to action

2014-12-13 Thread Manu via Digitalmars-d
On 14 December 2014 at 17:25, Walter Bright via Digitalmars-d digitalmars-d@puremagic.com wrote: On 12/13/2014 5:00 PM, Manu via Digitalmars-d wrote: my engine: https://github.com/TurkeyMan/fuji Please set fuji up at http://code.dlang.org ! It's totally incompatible with dub. How does

Re: D game development: a call to action

2014-12-13 Thread Manu via Digitalmars-d
On 14 December 2014 at 17:38, ketmar via Digitalmars-d digitalmars-d@puremagic.com wrote: On Sun, 14 Dec 2014 17:20:48 +1000 Manu via Digitalmars-d digitalmars-d@puremagic.com wrote: On 14 December 2014 at 16:57, ketmar via Digitalmars-d digitalmars-d@puremagic.com wrote: On Sun, 14 Dec

Segmentation fault after having a certain number of elements in an array?

2014-12-13 Thread Jeremy DeHaan via Digitalmars-d-learn
I'll be trying to narrow it down even more tomorrow, but I was hoping somone here might have some insight into this weird issue I am having. I have a dynamic array of shorts that I had been trying to append to (capturing sound data). I kept getting a segfault when doing the append, and have

Re: Segmentation fault after having a certain number of elements in an array?

2014-12-13 Thread Jeremy DeHaan via Digitalmars-d-learn
I should also mention that this is on Linux. I haven't tried on OSX or Windows yet.

Re: Segmentation fault after having a certain number of elements in an array?

2014-12-13 Thread Paul via Digitalmars-d-learn
On Saturday, 13 December 2014 at 08:59:19 UTC, Jeremy DeHaan wrote: for(int i = 0; isamples.length; ++i) m_samples.length +=1; You are testing i against an ever-increasing limit aren't you, so it's an infinite loop.

Re: Segmentation fault after having a certain number of elements in an array?

2014-12-13 Thread Jeremy DeHaan via Digitalmars-d-learn
On Saturday, 13 December 2014 at 09:24:51 UTC, Paul wrote: On Saturday, 13 December 2014 at 08:59:19 UTC, Jeremy DeHaan wrote: for(int i = 0; isamples.length; ++i) m_samples.length +=1; You are testing i against an ever-increasing limit aren't you, so it's an infinite

Re: Segmentation fault after having a certain number of elements in an array?

2014-12-13 Thread Artem Tarasov via Digitalmars-d-learn
On Saturday, 13 December 2014 at 09:24:51 UTC, Paul wrote: You are testing i against an ever-increasing limit aren't you, so it's an infinite loop. Read more carefully. samples is unmodified, it's m_samples whose length is changed.

Re: Segmentation fault after having a certain number of elements in an array?

2014-12-13 Thread Artem Tarasov via Digitalmars-d-learn
On Saturday, 13 December 2014 at 08:59:19 UTC, Jeremy DeHaan wrote: I'll be trying to narrow it down even more tomorrow, but I was hoping somone here might have some insight into this weird issue I am having. Could you upload the code to somewhere? With only a small snippet, it's hard to get

Re: The package feature is ignored when the file name is package.di

2014-12-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, December 13, 2014 02:34:21 Jeremy DeHaan via Digitalmars-d-learn wrote: Is this on purpose? Granted, I almost never use interface files, but I had a whim to use them for what I was working on today. Everything worked fine when I renamed the file to package.d, but apparently

Re: std.array oddness

2014-12-13 Thread bearophile via Digitalmars-d-learn
ketmar: no, you are using `.byLine` incorrectly. ;-) `.byLine` reuses it's internal buffer for each line, so you have to copy that buffer. A simple solution is to use byLineCopy (that unfortunately should have been the default behavior since the beginning). Bye, bearophile

repack ubyte[] to use only 7 bits

2014-12-13 Thread Charles Hixson via Digitalmars-d-learn
Is there a standard way to do this? The code below is untested, as I haven't yet written the x7to8 routine, and came up with a better way to do what this was to accomplish, but it feels as if this should be somewhere in the standard library, if I could only find it. /** Repack the data from

Re: std.array oddness

2014-12-13 Thread ketmar via Digitalmars-d-learn
On Sat, 13 Dec 2014 10:01:49 + bearophile via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: no, you are using `.byLine` incorrectly. ;-) `.byLine` reuses it's internal buffer for each line, so you have to copy that buffer. A simple solution is to use byLineCopy (that

Re: std.bitmanip - bitshift?

2014-12-13 Thread via Digitalmars-d-learn
On Friday, 12 December 2014 at 19:35:26 UTC, Steven Schveighoffer wrote: On 12/12/14 2:17 PM, H. S. Teoh via Digitalmars-d-learn wrote: On Fri, Dec 12, 2014 at 11:13:38AM -0500, Steven Schveighoffer via Digitalmars-d-learn wrote: On 12/12/14 8:39 AM, Trollgeir wrote:

Re: repack ubyte[] to use only 7 bits

2014-12-13 Thread Manolo via Digitalmars-d-learn
On Saturday, 13 December 2014 at 10:09:27 UTC, Charles Hixson via Digitalmars-d-learn wrote: Is there a standard way to do this? The code below is untested, as I haven't yet written the x7to8 routine, and came up with a better way to do what this was to accomplish, but it feels as if this

Re: repack ubyte[] to use only 7 bits

2014-12-13 Thread Manolo via Digitalmars-d-learn
On Saturday, 13 December 2014 at 11:20:21 UTC, Manolo wrote: On Saturday, 13 December 2014 at 10:09:27 UTC, Charles Hixson via Digitalmars-d-learn wrote: Is there a standard way to do this? The code below is untested, as I haven't yet written the x7to8 routine, and came up with a better way

fibers and ranges: what's wrong here?

2014-12-13 Thread zeljkog via Digitalmars-d-learn
import std.stdio, core.thread; struct Tree{ int val; Tree[] tree; } struct TreeRange{ Tree curtree; bool empty; Fiber worker; this(Tree t){ worker = new Fiber(fiberFunc); curtree = t; popFront(); } void fiberFunc(){ Tree t = curtree; Fiber.yield();

Re: std.array oddness

2014-12-13 Thread thedeemon via Digitalmars-d-learn
On Saturday, 13 December 2014 at 06:40:41 UTC, ketmar via Digitalmars-d-learn wrote: .map!a.idup That can be just .map!idup.

Re: std.array oddness

2014-12-13 Thread ketmar via Digitalmars-d-learn
On Sat, 13 Dec 2014 12:07:27 + thedeemon via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Saturday, 13 December 2014 at 06:40:41 UTC, ketmar via Digitalmars-d-learn wrote: .map!a.idup That can be just .map!idup. it depends of compiler version, as `idup` was a

Re: fibers and ranges: what's wrong here?

2014-12-13 Thread Tobias Pankrath via Digitalmars-d-learn
When you assigning the worker in TreeRange, you create a delegate that captures the current TreeRange or 'this'. --- worker = new Fiber(fiberFunc); --- foreach is defined as (http://dlang.org/statement.html#ForeachStatement): --- for (auto __r = range; !__r.empty; __r.popFront()) {

Re: fibers and ranges: what's wrong here?

2014-12-13 Thread zeljkog via Digitalmars-d-learn
On 13.12.14 13:01, zeljkog wrote: void main() { auto tt = Tree(5, [Tree(7,[Tree(11), Tree(4)]), Tree(10)]); auto tr1 = TreeRange(tt); foreach(v; tr1){ writef(%2d, , v); } writeln(); for(auto r = TreeRange(tt); !r.empty; r.popFront()) writef(%2d, , r.front);

Re: fibers and ranges: what's wrong here?

2014-12-13 Thread Tobias Pankrath via Digitalmars-d-learn
On Saturday, 13 December 2014 at 12:26:49 UTC, zeljkog wrote: On 13.12.14 13:01, zeljkog wrote: void main() { auto tt = Tree(5, [Tree(7,[Tree(11), Tree(4)]), Tree(10)]); auto tr1 = TreeRange(tt); foreach(v; tr1){ writef(%2d, , v); } writeln(); for(auto r = TreeRange(tt);

Re: Segmentation fault after having a certain number of elements in an array?

2014-12-13 Thread Jeremy DeHaan via Digitalmars-d-learn
On Saturday, 13 December 2014 at 09:47:40 UTC, Artem Tarasov wrote: On Saturday, 13 December 2014 at 08:59:19 UTC, Jeremy DeHaan wrote: I'll be trying to narrow it down even more tomorrow, but I was hoping somone here might have some insight into this weird issue I am having. Could you

Wrapping multiple extern (C) declarations in a template

2014-12-13 Thread aldanor via Digitalmars-d-learn
I'm writing bindings to a rather big C library where the return values of almost all functions indicate the possibility of an error (exception). Assuming there's a C header, foo.h with functions f1, f2, etc, I want to have a corresponding D module, foo.d which would provide the f1, f2 that

Re: Wrapping multiple extern (C) declarations in a template

2014-12-13 Thread Gary Willoughby via Digitalmars-d-learn
On Saturday, 13 December 2014 at 16:34:42 UTC, aldanor wrote: I'm writing bindings to a rather big C library where the return values of almost all functions indicate the possibility of an error (exception). Assuming there's a C header, foo.h with functions f1, f2, etc, I want to have a

Re: scope block do not handle failure, but try-catch does

2014-12-13 Thread Suliman via Digitalmars-d-learn
If I right understand scope is not good for checking if one of function is fail. For example: string dbpass = config.getKey(dbpass); string dbpass = config.getKey(dbpass); string dbhost = config.getKey(dbhost); string dbport = config.getKey(dbport); if I will try to add scope(failure)

Re: Wrapping multiple extern (C) declarations in a template

2014-12-13 Thread aldanor via Digitalmars-d-learn
Personally i wouldn't go this route. I would create foo.d as a C to D translation only so it can be imported and used like in C. Then i would create another module which imports this to create your new OOP API adding features and excepions, etc. This allows the best of both worlds, keep the C

Re: scope block do not handle failure, but try-catch does

2014-12-13 Thread Suliman via Digitalmars-d-learn
I reread docs and understood that scope not for such case. Next code is do what I need: try { string dbname = config.getKey(dbname); string dbpass = config.getKey(dbpass); string dbhost = config.getKey(dbhost); string dbport = config.getKey(dbport); } catch

SQLLite driver

2014-12-13 Thread Suliman via Digitalmars-d-learn
On the code.dlang.org I found SQLLite driver https://github.com/biozic/d2sqlite3 Look like it's not ready for Windows: pragma(msg, \nWARNING !!!\nDevelopped for POSIX systems only.\nNot tested on Windows.\n); I tried to add import to my project and I got next errors:

Re: Wrapping multiple extern (C) declarations in a template

2014-12-13 Thread Gary Willoughby via Digitalmars-d-learn
On Saturday, 13 December 2014 at 19:03:42 UTC, aldanor wrote: Let's say there's a foo.d that contains raw bindings to foo.h (enums, structs, extern variables, function declarations, a whole load of stuff) -- everything but the functions is already fine but all functions need to be wrapped.

Re: repack ubyte[] to use only 7 bits

2014-12-13 Thread Manolo via Digitalmars-d-learn
On Saturday, 13 December 2014 at 19:52:33 UTC, Charles Hixson via Digitalmars-d-learn wrote: On 12/13/2014 03:20 AM, Manolo via Digitalmars-d-learn wrote: On Saturday, 13 December 2014 at 10:09:27 UTC, Charles Hixson via Digitalmars-d-learn wrote: Is there a standard way to do this? The code

Re: Are there any methods like isDestroyed or isDisposed to detect whether some object is destroyed or not?

2014-12-13 Thread Andrey Derzhavin via Digitalmars-d-learn
import std.stdio; class ObjectAType { bool ok; this() {ok = true;} } void main() { auto a = new ObjectAType; assert(a.ok); destroy(a); assert(!a.ok); // a has been destroyed. } This method of detection of collected objects is what I needed. Thanks to everybody for

All Unordered Pairs of Elements in a Range

2014-12-13 Thread Nordlöw
Is there a Phobos method/range for selecting all pairs out of a range without caring about the ordering within each pair? Example: [1,2,3] = [(1,2), (2,3), (3,1)]

Re: Wrapping multiple extern (C) declarations in a template

2014-12-13 Thread Mike Parker via Digitalmars-d-learn
On 12/14/2014 4:03 AM, aldanor wrote: However, it wouldn't be possible to retain the same function names since they've been imported to the namespace (it's then also not possible to extern them as private initially since then you won't be able to import/wrap them in a different module). Hence

Re: All Unordered Pairs of Elements in a Range

2014-12-13 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Dec 13, 2014 at 10:24:50PM +, Nordlöw via Digitalmars-d-learn wrote: Is there a Phobos method/range for selecting all pairs out of a range without caring about the ordering within each pair? Example: [1,2,3] = [(1,2), (2,3), (3,1)] Sounds like:

Re: All Unordered Pairs of Elements in a Range

2014-12-13 Thread Nordlöw
On Saturday, 13 December 2014 at 23:08:13 UTC, H. S. Teoh via Digitalmars-d-learn wrote: [1,2,3] = [(1,2), (2,3), (3,1)] Sounds like: https://issues.dlang.org/show_bug.cgi?id=6788 Thx.

Re: SQLLite driver

2014-12-13 Thread Rikki Cattermole via Digitalmars-d-learn
On 14/12/2014 9:21 a.m., Suliman wrote: On the code.dlang.org I found SQLLite driver https://github.com/biozic/d2sqlite3 Look like it's not ready for Windows: pragma(msg, \nWARNING !!!\nDevelopped for POSIX systems only.\nNot tested on Windows.\n); I tried to add import to my project and I

Re: std.array oddness

2014-12-13 Thread earthfront via Digitalmars-d-learn
On Saturday, 13 December 2014 at 06:40:41 UTC, ketmar via Digitalmars-d-learn wrote: auto names = File(names.txt) .byLine!(char,char)(KeepTerminator.no, ',') .map!a.idup .array; Awesome. map!idup does the trick. I had looked at the byLine doc before posting, in

Re: SQLLite driver

2014-12-13 Thread Suliman via Digitalmars-d-learn
Yes I used 2.0.65, but after updating compiler the situation did not resolved... http://www.everfall.com/paste/id.php?apd0bfs5z4eg

Re: SQLLite driver

2014-12-13 Thread Rikki Cattermole via Digitalmars-d-learn
On 14/12/2014 7:35 p.m., Suliman wrote: Yes I used 2.0.65, but after updating compiler the situation did not resolved... http://www.everfall.com/paste/id.php?apd0bfs5z4eg Ah oh, I remember this issue from 2.064 - 2.065. Definitely hasn't been upgraded.

[Issue 12941] Everything should be @unsafe by default, and explicitly vetted (and documented) as @safe

2014-12-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12941 --- Comment #11 from Jonathan M Davis issues.dl...@jmdavisprog.com --- (In reply to Sobirari Muhomori from comment #10) (In reply to hsteoh from comment #3) All declarations without initializers are @safe, regardless of the type of the declared

[Issue 13730] Scoped import of std.conv ruins functionality

2014-12-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13730 yebblies yebbl...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 6185] Include non-global functions when resolving UFCS

2014-12-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6185 yebblies yebbl...@gmail.com changed: What|Removed |Added CC||czda...@gmail.com --- Comment

[Issue 12114] buildNormalizedPath shouldn't normalize current path to empty string

2014-12-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12114 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 12114] buildNormalizedPath shouldn't normalize current path to empty string

2014-12-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12114 --- Comment #3 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/5462585245e3896b926dc8d39e72b17f55ffb003 Fix Issue 12114