Re: D/Objective-C 64bit

2014-11-06 Thread Christian Schneider via Digitalmars-d-announce
Oh, just found out, it seems that currently the extern C declarations don't work. This comes from the original Chocolat range.d extern (C) { nothrow: NSRange NSUnionRange(NSRange range1, NSRange range2) ; NSRange NSIntersectionRange(NSRange range1, NSRange

Re: D/Objective-C 64bit

2014-11-06 Thread Jacob Carlborg via Digitalmars-d-announce
On 2014-11-06 17:06, Christian Schneider wrote: Oh, just found out, it seems that currently the extern C declarations don't work. This comes from the original Chocolat range.d extern (C) { nothrow: NSRange NSUnionRange(NSRange range1, NSRange range2) ; NSRange

dmedia library

2014-11-06 Thread luminousone via Digitalmars-d-announce
I have been working on a media library, it still has a long way to go, but I figured its about time I shared what I am doing. https://github.com/luminousone/dmedia If I could possibly convince a few people out their to give'er a once over. I use XCB/XLIB/GLX directly, so I am not just

Re: dmedia library

2014-11-06 Thread Rikki Cattermole via Digitalmars-d-announce
On 7/11/2014 6:56 p.m., luminousone wrote: I have been working on a media library, it still has a long way to go, but I figured its about time I shared what I am doing. https://github.com/luminousone/dmedia If I could possibly convince a few people out their to give'er a once over. I use

Re: dmedia library

2014-11-06 Thread luminousone via Digitalmars-d-announce
On Friday, 7 November 2014 at 06:29:14 UTC, Rikki Cattermole wrote: On 7/11/2014 6:56 p.m., luminousone wrote: I have been working on a media library, it still has a long way to go, but I figured its about time I shared what I am doing. https://github.com/luminousone/dmedia If I could

Re: dmedia library

2014-11-06 Thread Rikki Cattermole via Digitalmars-d-announce
On 7/11/2014 7:38 p.m., luminousone wrote: On Friday, 7 November 2014 at 06:29:14 UTC, Rikki Cattermole wrote: On 7/11/2014 6:56 p.m., luminousone wrote: I have been working on a media library, it still has a long way to go, but I figured its about time I shared what I am doing.

Re: dmedia library

2014-11-06 Thread luminousone via Digitalmars-d-announce
On Friday, 7 November 2014 at 06:42:24 UTC, Rikki Cattermole wrote: On 7/11/2014 7:38 p.m., luminousone wrote: On Friday, 7 November 2014 at 06:29:14 UTC, Rikki Cattermole wrote: On 7/11/2014 6:56 p.m., luminousone wrote: I have been working on a media library, it still has a long way to go,

Re: dmedia library

2014-11-06 Thread Rikki Cattermole via Digitalmars-d-announce
On 7/11/2014 7:58 p.m., luminousone wrote: On Friday, 7 November 2014 at 06:42:24 UTC, Rikki Cattermole wrote: On 7/11/2014 7:38 p.m., luminousone wrote: On Friday, 7 November 2014 at 06:29:14 UTC, Rikki Cattermole wrote: On 7/11/2014 6:56 p.m., luminousone wrote: I have been working on a

Re: dmedia library

2014-11-06 Thread luminousone via Digitalmars-d-announce
On Friday, 7 November 2014 at 07:08:02 UTC, Rikki Cattermole wrote: On 7/11/2014 7:58 p.m., luminousone wrote: On Friday, 7 November 2014 at 06:42:24 UTC, Rikki Cattermole wrote: On 7/11/2014 7:38 p.m., luminousone wrote: On Friday, 7 November 2014 at 06:29:14 UTC, Rikki Cattermole wrote: On

Re: dmedia library

2014-11-06 Thread Rikki Cattermole via Digitalmars-d-announce
On 7/11/2014 8:22 p.m., luminousone wrote: On Friday, 7 November 2014 at 07:08:02 UTC, Rikki Cattermole wrote: On 7/11/2014 7:58 p.m., luminousone wrote: On Friday, 7 November 2014 at 06:42:24 UTC, Rikki Cattermole wrote: On 7/11/2014 7:38 p.m., luminousone wrote: On Friday, 7 November 2014

Re: Multiple Inhertiance?

2014-11-06 Thread via Digitalmars-d
On Thursday, 6 November 2014 at 00:50:23 UTC, bearophile wrote: I think not giving language support means that D designers don't want it to be easy to do. And this is good. Then why are they adding multiple alias this, which appears to be worse?

Re: DerelictBgfx not shipping core libs.

2014-11-06 Thread ponce via Digitalmars-d
Hi, First, I'd like to point out this question is better asked in DerelictBgfx issues or digitalmars.D.learn, this NG is for general D discussion. On Thursday, 6 November 2014 at 06:44:49 UTC, olivier henley wrote: Hi, May I ask what is the rational to not ship the core libs with the

Re: Register based error-handling?

2014-11-06 Thread via Digitalmars-d
On Thursday, 6 November 2014 at 08:30:22 UTC, Ola Fosheim Grøstad wrote: 1. On amd64 you designate one caller save SIMD register to error propagation. I meant callee save. It is saved by the called function if it does not return an error.

Register based error-handling?

2014-11-06 Thread via Digitalmars-d
It has been argued that exceptions are too slow in D to propagate regular errors and should just be used for the truly exceptional case. Then there should be a faster, but equally convenient alternative for regular errors. In Go you solve the problem by returning tuples:

Re: Multiple Inhertiance?

2014-11-06 Thread bearophile via Digitalmars-d
Ola Fosheim Grøstad: Then why are they adding multiple alias this, which appears to be worse? The multiple alias this is being designed right now. If you don't like the complexities it introduces, then it's a good moment to express your concerns in that thread (I plan to not use multiple

Re: Multiple Inhertiance?

2014-11-06 Thread via Digitalmars-d
On Thursday, 6 November 2014 at 08:38:53 UTC, bearophile wrote: Ola Fosheim Grøstad: Then why are they adding multiple alias this, which appears to be worse? The multiple alias this is being designed right now. If you don't like the complexities it introduces, then it's a good moment to

Re: Multiple Inhertiance?

2014-11-06 Thread bearophile via Digitalmars-d
Ola Fosheim Grøstad: I think D should either try to support programming in the large or stop claiming that D aims to stop programming in the large while not being willing to make the feature set suitable. Think of C++17/D2 as testbed entities that contain most features, to test what works

Re: sortOn: sorts range of aggregates by member name(s)

2014-11-06 Thread Nordlöw
On Wednesday, 5 November 2014 at 21:29:20 UTC, Marc Schütz wrote: Again untested: private alias makePredicate(alias xtr) = (a, b) = (extractorFun!xtr(a) extractorFun!xtr(b)); This errors as sort_ex.d(35,43): Error: basic type expected, not ( sort_ex.d(35,43): Error: function declaration

Re: Register based error-handling?

2014-11-06 Thread Jonathan Marler via Digitalmars-d
On Thursday, 6 November 2014 at 08:30:22 UTC, Ola Fosheim Grøstad wrote: It has been argued that exceptions are too slow in D to propagate regular errors and should just be used for the truly exceptional case. Then there should be a faster, but equally convenient alternative for regular

Re: Multiple Inhertiance?

2014-11-06 Thread via Digitalmars-d
On Thursday, 6 November 2014 at 09:03:02 UTC, bearophile wrote: Think of C++17/D2 as testbed entities that contain most features, to test what works and what doesn't work, to create successive languages that contain only the useful features :-) :-) Yes, I view D2 as an experiment. And I view

Re: Register based error-handling?

2014-11-06 Thread Nemanja Boric via Digitalmars-d
If a function named write fails to write, it should throw an exception. So what about functions that want to return error codes instead. What I do is prefix the function with try. You don't have to do that, but it helps me personally keep track of what functions require explicit error

Re: Register based error-handling?

2014-11-06 Thread via Digitalmars-d
On Thursday, 6 November 2014 at 09:17:55 UTC, Jonathan Marler wrote: First, D has the capability to generate code that uses error codes via registers or some global variable (note: I wouldn't specify that a compiler should use a certain register for error codes, the compiler is smart and will

Re: sortOn: sorts range of aggregates by member name(s)

2014-11-06 Thread via Digitalmars-d
On Thursday, 6 November 2014 at 09:13:07 UTC, Nordlöw wrote: On Wednesday, 5 November 2014 at 21:29:20 UTC, Marc Schütz wrote: Again untested: private alias makePredicate(alias xtr) = (a, b) = (extractorFun!xtr(a) extractorFun!xtr(b)); This errors as sort_ex.d(35,43): Error: basic type

Re: Compiling druntime gives error messages

2014-11-06 Thread tcak via Digitalmars-d
On Wednesday, 5 November 2014 at 03:31:47 UTC, Joakim wrote: On Tuesday, 4 November 2014 at 23:45:54 UTC, H. S. Teoh via Digitalmars-d wrote: On Tue, Nov 04, 2014 at 11:32:34PM +, tcak via Digitalmars-d wrote: Generally, to compile druntime from git HEAD requires that you use dmd from

Re: Compiling druntime gives error messages

2014-11-06 Thread tcak via Digitalmars-d
On Wednesday, 5 November 2014 at 03:31:47 UTC, Joakim wrote: On Tuesday, 4 November 2014 at 23:45:54 UTC, H. S. Teoh via Digitalmars-d wrote: On Tue, Nov 04, 2014 at 11:32:34PM +, tcak via Digitalmars-d wrote: Generally, to compile druntime from git HEAD requires that you use dmd from

Re: Register based error-handling?

2014-11-06 Thread via Digitalmars-d
On Thursday, 6 November 2014 at 09:36:38 UTC, Nemanja Boric wrote: Maybe you could consider something like returning `ResultOk, Err` (like in Rust) which will make you not forget to check for return code. Yes, but that is too syntax heavy. I want a language builtin that is non-intrusive.

Re: DerelictBgfx not shipping core libs.

2014-11-06 Thread Mike Parker via Digitalmars-d
On 11/6/2014 3:44 PM, olivier henley wrote: Hi, May I ask what is the rational to not ship the core libs with the bgfx D wrapper? From my point of view it defies the main goal of using a D wrapper. First, let's get some terminology straight. There are no wrappers in Derelict. The Derelict

Re: alias foo = __traits(...)

2014-11-06 Thread Nick Treleaven via Digitalmars-d
On 06/11/2014 01:36, Shammah Chancellor wrote: Is this fixed now? How about: alias compiles(alias expr) = __traits(compiles, expr); I guess supporting that may be problematic (it's too liberal), so I think we should have __compiles(expr) instead. It looks like a small saving, but in

Re: Template Instantiation Bug

2014-11-06 Thread Steven Schveighoffer via Digitalmars-d
On 11/4/14 4:48 PM, Walter Bright wrote: On 11/4/2014 9:51 AM, Jonathan Marler wrote: given the output of Transform, the compiler cannot deduce what the input of Transform was EVEN IF THE TEMPLATE IS AS SIMPLE AS THIS ONE. To answer a question not asked, why doesn't the compiler see the

Re: Interfacing with C++

2014-11-06 Thread Daniel Murphy via Digitalmars-d
Shriramana Sharma via Digitalmars-d wrote in message news:mailman.1515.1415110123.9932.digitalmar...@puremagic.com... So I'm using latest dmd 2.066.1 on an i386 machine. Does it have the latest functionality which you refer to? And what is the syntax to support static and non-virtual member

Re: Template Instantiation Bug

2014-11-06 Thread Daniel Murphy via Digitalmars-d
Steven Schveighoffer wrote in message news:m3bap5$khl$1...@digitalmars.com... https://issues.dlang.org/show_bug.cgi?id=1807 Hm.. interesting to note that Martin's suggestion has come to fruition, might this be revisited? Not really, templated aliases behave exactly the same as aliases in

Re: Multiple Inhertiance?

2014-11-06 Thread Patrick Jeeves via Digitalmars-d
On Thursday, 6 November 2014 at 08:04:33 UTC, Ola Fosheim Grøstad wrote: On Thursday, 6 November 2014 at 00:50:23 UTC, bearophile wrote: I think not giving language support means that D designers don't want it to be easy to do. And this is good. Then why are they adding multiple alias this,

Re: Multiple Inhertiance?

2014-11-06 Thread via Digitalmars-d
On Thursday, 6 November 2014 at 15:25:11 UTC, Patrick Jeeves wrote: I don't really see how multiple alias this is better or worse than multiple inheritance. It is worse because: 1. When you design a class hierarchy with multiple inheritance you don't reuse something made for another purpose,

Re: DerelictBgfx not shipping core libs.

2014-11-06 Thread olivier henley via Digitalmars-d
On Thursday, 6 November 2014 at 08:17:24 UTC, ponce wrote: Hi, First, I'd like to point out this question is better asked in DerelictBgfx issues or digitalmars.D.learn, this NG is for general D discussion. Not agree. DerelictBgfx is one of the most interesting project D has to show off and

Re: Programming Language for Games, part 3

2014-11-06 Thread Nick Treleaven via Digitalmars-d
On 04/11/2014 14:18, Johannes Pfau wrote: And as long as there is no other solution warnings are better than simply ignoring the problem. +1 But I think it's likely this check will be implemented in Dscanner (https://github.com/Hackerpilot/Dscanner/issues/204) and in the end it doesn't

Re: Programming Language for Games, part 3

2014-11-06 Thread Nick Treleaven via Digitalmars-d
On 04/11/2014 02:00, Walter Bright wrote: You are glossing over and dismissing the problems with explicit casts, and the problems with overloading, etc. Can't solving any overloading problem be deferred? An incomplete solution is better than nothing. As for explicit casts, they are easily

Re: DerelictBgfx not shipping core libs.

2014-11-06 Thread ponce via Digitalmars-d
On Thursday, 6 November 2014 at 16:36:41 UTC, olivier henley wrote: First, I'd like to point out this question is better asked in DerelictBgfx issues or digitalmars.D.learn, this NG is for general D discussion. Not agree. DerelictBgfx is one of the most interesting project D has to show off

Re: DerelictBgfx not shipping core libs.

2014-11-06 Thread olivier henley via Digitalmars-d
On Thursday, 6 November 2014 at 12:31:32 UTC, Mike Parker wrote: First, let's get some terminology straight. There are no wrappers in Derelict. The Derelict packages are all bindings, meaning they are one-to-one translations (as much as possible) of the original library. A wrapper is

Re: Register based error-handling?

2014-11-06 Thread Jeremy Powers via Digitalmars-d
On Thu, Nov 6, 2014 at 1:17 AM, Jonathan Marler via Digitalmars-d digitalmars-d@puremagic.com wrote: One thing I like about your suggestion is you can specify if a function's error code should be verified to be handled at compile time. It would be nice as a library writer if you could

Re: DerelictBgfx not shipping core libs.

2014-11-06 Thread olivier henley via Digitalmars-d
On Thursday, 6 November 2014 at 17:23:21 UTC, ponce wrote: There were PR since to update to latest API so these binaries would be outdated already. This would be easier if bgfx had numbered releases and its API changed less. What you _can_ do now is check the date where the API was last

Re: DerelictBgfx not shipping core libs.

2014-11-06 Thread ponce via Digitalmars-d
I think there is a misunderstanding: bgfx _examples_ are kind of cool, but they were only ported for basic testing of the bindings, and maybe should be removed now to avoid rot.

Re: DerelictBgfx not shipping core libs.

2014-11-06 Thread ponce via Digitalmars-d
I just don't see the point to not share the most common target dependencies libs. Therefore the examples can run out of the box for most people and some super cool project can be show cased for D rapidly. This leads to hooking. That's it that's all and this is the key. Common libraries

Re: DerelictBgfx not shipping core libs.

2014-11-06 Thread ponce via Digitalmars-d
On Thursday, 6 November 2014 at 19:35:27 UTC, olivier henley wrote: On Thursday, 6 November 2014 at 17:23:21 UTC, ponce wrote: There were PR since to update to latest API so these binaries would be outdated already. This would be easier if bgfx had numbered releases and its API changed

Re: Register based error-handling?

2014-11-06 Thread deadalnix via Digitalmars-d
I don't think we should have a language construct for that. It is possible to pack the returned value in a struct that enforce error checking. Exception is fine for procedure if they can't do their job. tryDo as explained before in this thread is also a common convention to indicate that you'll

Re: Programming Language for Games, part 3

2014-11-06 Thread Walter Bright via Digitalmars-d
On 11/6/2014 9:16 AM, Nick Treleaven wrote: On 04/11/2014 02:00, Walter Bright wrote: You are glossing over and dismissing the problems with explicit casts, and the problems with overloading, etc. Can't solving any overloading problem be deferred? An incomplete solution is better than

Re: Register based error-handling?

2014-11-06 Thread via Digitalmars-d
On Thursday, 6 November 2014 at 20:06:55 UTC, deadalnix wrote: I don't think we should have a language construct for that. It is possible to pack the returned value in a struct that enforce error checking. How? Please note that inconvenient is not an option since people then will end up

Re: Register based error-handling?

2014-11-06 Thread via Digitalmars-d
On Thursday, 6 November 2014 at 19:18:14 UTC, Jeremy Powers via Digitalmars-d wrote: This is why checked exceptions were invented. Yeah, I agree. Main reasons for classical exception handling: 1. Get error handling directly to a level where it can be handled to prevent propagating clutter in

Re: Register based error-handling?

2014-11-06 Thread eles via Digitalmars-d
On Thursday, 6 November 2014 at 20:58:02 UTC, Ola Fosheim Grøstad wrote: On Thursday, 6 November 2014 at 20:06:55 UTC, deadalnix wrote: I don't think we should have a language construct for that. It is possible to pack the returned value in a struct that enforce error checking. How? The

Re: Register based error-handling?

2014-11-06 Thread eles via Digitalmars-d
On Thursday, 6 November 2014 at 19:18:14 UTC, Jeremy Powers via Digitalmars-d wrote: On Thu, Nov 6, 2014 at 1:17 AM, Jonathan Marler via suggestion than checked exceptions though... I think the worst thing about exceptions is the syntax deformation introduced by all the try/catch blocks.

Re: Register based error-handling?

2014-11-06 Thread via Digitalmars-d
On Thursday, 6 November 2014 at 21:13:53 UTC, eles wrote: The most similar thing that I can think about is Boost Optional. Yes, that is kind of like Rust's std::result or Haskell's Maybe, but it does not support delaying the handling like you do in OpenGL. What is desirable is that you are

Re: DerelictBgfx not shipping core libs.

2014-11-06 Thread olivier henley via Digitalmars-d
On Thursday, 6 November 2014 at 20:08:24 UTC, ponce wrote: I can see how this is useful for Windows programmers but would strongly prefer to be completely separated from the bindings, in some kind of FTP/HTTP server. There would be a link in the README.md and you would upload builds there

Re: Multiple Inhertiance?

2014-11-06 Thread deadalnix via Digitalmars-d
On Thursday, 6 November 2014 at 15:25:11 UTC, Patrick Jeeves wrote: On Thursday, 6 November 2014 at 08:04:33 UTC, Ola Fosheim Grøstad wrote: On Thursday, 6 November 2014 at 00:50:23 UTC, bearophile wrote: I think not giving language support means that D designers don't want it to be easy to

Re: Register based error-handling?

2014-11-06 Thread ZombineDev via Digitalmars-d
Something a little better than Boost's Optional: ExpectedT http://channel9.msdn.com/Shows/Going+Deep/C-and-Beyond-2012-Andrei-Alexandrescu-Systematic-Error-Handling-in-C

Re: Multiple Inhertiance?

2014-11-06 Thread Meta via Digitalmars-d
On Thursday, 6 November 2014 at 21:56:39 UTC, deadalnix wrote: In the other hand, alias this (or prototypal inheritance model in general) do not suffer from these issues. It also have some good use case like entity framework. I'm curious as to how prototypical inheritance avoids the diamond

Re: Register based error-handling?

2014-11-06 Thread via Digitalmars-d
On Thursday, 6 November 2014 at 21:55:42 UTC, ZombineDev wrote: Something a little better than Boost's Optional: ExpectedT http://channel9.msdn.com/Shows/Going+Deep/C-and-Beyond-2012-Andrei-Alexandrescu-Systematic-Error-Handling-in-C If you have exceptions maybe, but not good enough. And none

Optimization fun

2014-11-06 Thread H. S. Teoh via Digitalmars-d
So today, I was playing around with profiling and optimizing my sliding block puzzle solver, and found some interesting things: 1) The GC could use some serious improvement: it just so happens that the solver's algorithm only ever needs to allocate memory, never release it (it keeps a hash of

Re: Optimization fun

2014-11-06 Thread H. S. Teoh via Digitalmars-d
On Thu, Nov 06, 2014 at 02:58:16PM -0800, H. S. Teoh via Digitalmars-d wrote: [...] auto ptr = current.ptr; auto c = current.length; while (c 0 *ptr != m.id) ptr++; cert.headOffset = ptr - current.ptr; This pushed gdc far

Re: Optimization fun

2014-11-06 Thread Walter Bright via Digitalmars-d
On 11/6/2014 2:58 PM, H. S. Teoh via Digitalmars-d wrote: 2) Auto-decoding is evil: the solver currently uses a naïve char[] representation for the puzzle board, and uses countUntil() extensively to locate things on the board. The original code had: auto offset =

Re: Optimization fun

2014-11-06 Thread Walter Bright via Digitalmars-d
On 11/6/2014 3:13 PM, H. S. Teoh via Digitalmars-d wrote: mouth.open(); mouth.insert(foot); Now you've done it. You must pull the Stone of Shame! https://pbs.twimg.com/media/BrENFq3CMAEqFUL.jpg

Re: Optimization fun

2014-11-06 Thread Sean Kelly via Digitalmars-d
On Thursday, 6 November 2014 at 23:00:19 UTC, H. S. Teoh via Digitalmars-d wrote: So today, I was playing around with profiling and optimizing my sliding block puzzle solver, and found some interesting things: 1) The GC could use some serious improvement: it just so happens that the solver's

Re: DerelictBgfx not shipping core libs.

2014-11-06 Thread David Nadlinger via Digitalmars-d
On Thursday, 6 November 2014 at 21:22:27 UTC, olivier henley wrote: I did not know for the Debian policy concerning dynamic libs. Also, shipping binary builds for Linux without any further qualification is quite the headache anyway. Typically, you have to use some really old distro to avoid

Re: DerelictBgfx not shipping core libs.

2014-11-06 Thread Laeeth Isharc via Digitalmars-d
It strikes me that the core question here may be one of the division of labour. The person best suited to signing up for an ongoing commitment to maintain a whole load of different libraries across platforms/settings will only by the chancest fluke be the person who is suited to and enjoys

Re: Optimization fun

2014-11-06 Thread H. S. Teoh via Digitalmars-d
On Thu, Nov 06, 2014 at 03:15:04PM -0800, Walter Bright via Digitalmars-d wrote: On 11/6/2014 2:58 PM, H. S. Teoh via Digitalmars-d wrote: 2) Auto-decoding is evil: the solver currently uses a naïve char[] representation for the puzzle board, and uses countUntil() extensively to locate things

Re: Optimization fun

2014-11-06 Thread Meta via Digitalmars-d
On Thursday, 6 November 2014 at 23:30:56 UTC, Walter Bright wrote: On 11/6/2014 3:13 PM, H. S. Teoh via Digitalmars-d wrote: mouth.open(); mouth.insert(foot); Now you've done it. You must pull the Stone of Shame! https://pbs.twimg.com/media/BrENFq3CMAEqFUL.jpg The Shame Cube is far

Re: Optimization fun

2014-11-06 Thread H. S. Teoh via Digitalmars-d
On Thu, Nov 06, 2014 at 02:58:16PM -0800, H. S. Teoh via Digitalmars-d wrote: So today, I was playing around with profiling and optimizing my sliding block puzzle solver, and found some interesting things: [...] Oh, I forgot to mention something else that might be of interest to people: in the

Re: Multiple Inhertiance?

2014-11-06 Thread deadalnix via Digitalmars-d
On Thursday, 6 November 2014 at 22:15:25 UTC, Meta wrote: On Thursday, 6 November 2014 at 21:56:39 UTC, deadalnix wrote: In the other hand, alias this (or prototypal inheritance model in general) do not suffer from these issues. It also have some good use case like entity framework. I'm

Re: Register based error-handling?

2014-11-06 Thread deadalnix via Digitalmars-d
On Thursday, 6 November 2014 at 20:58:02 UTC, Ola Fosheim Grøstad wrote: On Thursday, 6 November 2014 at 20:06:55 UTC, deadalnix wrote: I don't think we should have a language construct for that. It is possible to pack the returned value in a struct that enforce error checking. How?

Re: Dub integrated into the compiler?

2014-11-06 Thread Jason den Dulk via Digitalmars-d
On Monday, 27 October 2014 at 02:33:18 UTC, Tofu Ninja wrote: I don't think this is a new idea but it would be pretty awesome. So the idea is that the compiler could check dub for libraries that it can't find and automatically download and integrate them. It would essentially make all of dub

Re: DerelictBgfx not shipping core libs.

2014-11-06 Thread Mike Parker via Digitalmars-d
On Thursday, 6 November 2014 at 19:12:37 UTC, olivier henley wrote: 1. Windows is a good start. 2. Nobody said you had to provide all of them. 3. We can help. Just myself, I could provide Linux and Windows. It makes for about 80% of all computers in the world. If you would like to compile

Re: Optimization fun

2014-11-06 Thread H. S. Teoh via Digitalmars-d
On Thu, Nov 06, 2014 at 02:58:16PM -0800, H. S. Teoh via Digitalmars-d wrote: [...] 1) The GC could use some serious improvement: it just so happens that the solver's algorithm only ever needs to allocate memory, never release it (it keeps a hash of visited states that only grows, never

Re: Multiple Inhertiance?

2014-11-06 Thread via Digitalmars-d
On Friday, 7 November 2014 at 03:28:45 UTC, deadalnix wrote: Because the base object and delegated object are different one, not the same being polymorphic. That does not resolve conflicts with having the same base prototype or name conflicts in method names. Ignoring the issues does not

Re: Multiple Inhertiance?

2014-11-06 Thread deadalnix via Digitalmars-d
On Friday, 7 November 2014 at 07:12:58 UTC, Ola Fosheim Grøstad wrote: On Friday, 7 November 2014 at 03:28:45 UTC, deadalnix wrote: Because the base object and delegated object are different one, not the same being polymorphic. That does not resolve conflicts with having the same base

Re: cannot sort an array of char

2014-11-06 Thread Ivan Kazmenko via Digitalmars-d-learn
On Wednesday, 5 November 2014 at 13:34:05 UTC, Marc Schütz wrote: On Wednesday, 5 November 2014 at 12:54:03 UTC, Ivan Kazmenko wrote: Hi! This gives an error (cannot deduce template function from argument types): - import std.algorithm; void main () { char [] c; sort

Re: How to turn this C++ into D?

2014-11-06 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 5 November 2014 at 17:45:00 UTC, luminousone wrote: abstract class foo { static DList!foo foo_list; ~this(){ foo_list.remove(this); } One note: when your program exits the runtime does a final GC cycle and collects those things calling destructors/finalizers, however

Re: Share array element between threads

2014-11-06 Thread bearophile via Digitalmars-d-learn
Misu: void main(string[] args) { class Account { public this(int id) { this.id = id; } int id; } ... This is not an answer to your question, but note: void main() { class Foo {} static class Bar {} pragma(msg,

Re: Pragma mangle and D shared objects

2014-11-06 Thread Etienne Cimon via Digitalmars-d-learn
On 2014-10-26 14:25, Etienne Cimon wrote: On 2014-10-25 23:31, H. S. Teoh via Digitalmars-d-learn wrote: Hmm. You can probably use __traits(getAllMembers...) to introspect a library module at compile-time and build a hash based on that, so that it's completely automated. If you have this

Re: Share array element between threads

2014-11-06 Thread via Digitalmars-d-learn
On Thursday, 6 November 2014 at 10:53:32 UTC, Misu wrote: Hi, when I execute this code I have 7 7 7 as result, I think I understand why. How can I execute a special task for one element ? import std.stdio; import std.parallelism; void main(string[] args) { class Account {

Network scanner

2014-11-06 Thread RuZzz via Digitalmars-d-learn
Hi ppl! I want to scan the local network to find nodes with open 80 port. code: import core.thread, core.atomic; import std.stdio, std.system, std.file, std.conv, std.datetime, std.socket, std.socketstream, std.stream; import vibe.core.log; import vibe.d; void main() { ushort port =

Re: Network scanner

2014-11-06 Thread RuZzz via Digitalmars-d-learn
Or the program doesn't find the address after IP 192.168.110.34...

Re: cannot sort an array of char

2014-11-06 Thread via Digitalmars-d-learn
On Thursday, 6 November 2014 at 10:52:32 UTC, Ivan Kazmenko wrote: On Wednesday, 5 November 2014 at 13:34:05 UTC, Marc Schütz wrote: On Wednesday, 5 November 2014 at 12:54:03 UTC, Ivan Kazmenko wrote: Hi! This gives an error (cannot deduce template function from argument types): -

Re: Complexity guaranties of array append operator

2014-11-06 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/5/14 10:48 PM, Dmitriy wrote: Hello, I'm in the middle of learning D. I can't find any definitive information about what is the complexity of operator ~= when used for adding an element to an array. Is it amortized O(1) or is it implementation defined? (I hope it at worst O(n) though I

Re: How to turn this C++ into D?

2014-11-06 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/5/14 2:05 PM, Patrick Jeeves wrote: On Wednesday, 5 November 2014 at 18:56:08 UTC, luminousone wrote: unless delete is explicitly called, I don't believe the destructor would ever be called, it would still have a reference in the static foo_list object that would stop it from being

Re: cannot sort an array of char

2014-11-06 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/5/14 7:54 AM, Ivan Kazmenko wrote: Hi! This gives an error (cannot deduce template function from argument types): - import std.algorithm; void main () { char [] c; sort (c); } - Why is char [] so special that it can't be sorted? Because sort works on ranges, and

Re: scope exception do not rise

2014-11-06 Thread Ali Çehreli via Digitalmars-d-learn
On 11/05/2014 11:02 PM, Suliman wrote: Replace that with something like writeln(caught) and you will see that it is indeed caught. :) Printing the exception mimicks the default behavior and you (and I) think that the exception is not caught. :) that's work, but I can not understand where I can

transversal sum

2014-11-06 Thread Jack Applegame via Digitalmars-d-learn
I have rectangular forward range of forward ranges (not arrays): [ [a11, a12, ... a1N], [a21, a22, ... a2N], ... [aM1, aM2, ... aMN] ] I need lazy forward range: [ a11 + a21 + ... aM1, a12 + a22 + ... aM2, ... a1N + a2N + ... aMN ] Range of sum elements of every columns; M, N -

Re: scope exception do not rise

2014-11-06 Thread Suliman via Digitalmars-d-learn
We have to look at the documentation of the function. In this case the possibilities are FileException and UTFException. http://dlang.org/phobos/std_file.html#.readText However, judging by their names, they are both descendants of Exception, so what you are doing will catch either of them.

Re: transversal sum

2014-11-06 Thread via Digitalmars-d-learn
On Thursday, 6 November 2014 at 15:53:27 UTC, Jack Applegame wrote: I have rectangular forward range of forward ranges (not arrays): [ [a11, a12, ... a1N], [a21, a22, ... a2N], ... [aM1, aM2, ... aMN] ] I need lazy forward range: [ a11 + a21 + ... aM1, a12 + a22 + ... aM2, ... a1N +

Re: transversal sum

2014-11-06 Thread Justin Whear via Digitalmars-d-learn
On Thu, 06 Nov 2014 16:57:48 +, Marc Schütz wrote: On Thursday, 6 November 2014 at 15:53:27 UTC, Jack Applegame wrote: I have rectangular forward range of forward ranges (not arrays): [ [a11, a12, ... a1N], [a21, a22, ... a2N], ... [aM1, aM2, ... aMN] ] I need lazy forward

Re: transversal sum

2014-11-06 Thread Justin Whear via Digitalmars-d-learn
On Thu, 06 Nov 2014 17:08:23 +, Justin Whear wrote: I think the correct solution will make use of std.range.frontTraversal, but it will be a bit more complex due to needing to sum every column. std.range.traversal would make it easy, but it requires random access. That should be

Re: transversal sum

2014-11-06 Thread via Digitalmars-d-learn
On Thursday, 6 November 2014 at 16:57:50 UTC, Marc Schütz wrote: On Thursday, 6 November 2014 at 15:53:27 UTC, Jack Applegame wrote: I have rectangular forward range of forward ranges (not arrays): [ [a11, a12, ... a1N], [a21, a22, ... a2N], ... [aM1, aM2, ... aMN] ] I need lazy forward

Re: transversal sum

2014-11-06 Thread via Digitalmars-d-learn
On Thursday, 6 November 2014 at 17:08:23 UTC, Justin Whear wrote: This would sum along the wrong dimension. I think the correct solution will make use of std.range.frontTraversal, but it will be a bit more complex due to needing to sum every column. std.range.traversal would make it easy,

Re: Access Violation Tracking

2014-11-06 Thread Andrej Mitrovic via Digitalmars-d-learn
On Nov 5, 2014 12:10 PM, Bauss via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Is there any way to track down access violations, instead of me having to look through my source code manually. Whenever you don't get a stack trace on Windows, it's 99% guaranteed you're calling a

Re: transversal sum

2014-11-06 Thread Artur Skawina via Digitalmars-d-learn
On 11/06/14 18:32, bearophile via Digitalmars-d-learn wrote: Marc Schütz: We'd need something taking and returning a RoR that mirrors them diagonally. Then we could simply apply `map!(r = r.sum)` on the result. A simple solution is to create a row of values, and then sum them correctly

Why does this declaration exist inside std.range.put?

2014-11-06 Thread Meta via Digitalmars-d-learn
This is the code for std.range.put: void put(R, E)(ref R r, E e) { //Why? @property ref E[] EArrayInit(); //@@@9186@@@: Can't use (E[]).init //First level: simply straight up put. static if (is(typeof(doPut(r, e { doPut(r, e); } //Optional optimization

Re: transversal sum

2014-11-06 Thread Jack Applegame via Digitalmars-d-learn
void popFront() { foreach (ref r; rr) r.popFront(); } I think it should be void popFront() { foreach (ref r; rr.save) r.popFront(); } but I think OP wanted a ready-made phobos solution, w/o all the range boilerplate... exactly.

Re: Why does this declaration exist inside std.range.put?

2014-11-06 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/6/14 4:19 PM, Meta wrote: This is the code for std.range.put: void put(R, E)(ref R r, E e) { //Why? @property ref E[] EArrayInit(); //@@@9186@@@: Can't use (E[]).init //First level: simply straight up put. static if (is(typeof(doPut(r, e { doPut(r,

Re: transversal sum

2014-11-06 Thread John Colvin via Digitalmars-d-learn
On Thursday, 6 November 2014 at 15:53:27 UTC, Jack Applegame wrote: I have rectangular forward range of forward ranges (not arrays): [ [a11, a12, ... a1N], [a21, a22, ... a2N], ... [aM1, aM2, ... aMN] ] I need lazy forward range: [ a11 + a21 + ... aM1, a12 + a22 + ... aM2, ... a1N +

Re: Why does this declaration exist inside std.range.put?

2014-11-06 Thread Meta via Digitalmars-d-learn
On Thursday, 6 November 2014 at 21:57:36 UTC, Steven Schveighoffer wrote: github blame is quite useful: https://github.com/D-Programming-Language/phobos/blame/master/std/range.d#L668 The commit: https://github.com/D-Programming-Language/phobos/commit/c717b503e7305a92410c23ca2bc2ea14b40f8aa2

Re: transversal sum

2014-11-06 Thread John Colvin via Digitalmars-d-learn
On Thursday, 6 November 2014 at 15:53:27 UTC, Jack Applegame wrote: I have rectangular forward range of forward ranges (not arrays): [ [a11, a12, ... a1N], [a21, a22, ... a2N], ... [aM1, aM2, ... aMN] ] I need lazy forward range: [ a11 + a21 + ... aM1, a12 + a22 + ... aM2, ... a1N +

Re: transversal sum

2014-11-06 Thread John Colvin via Digitalmars-d-learn
On Thursday, 6 November 2014 at 22:02:09 UTC, John Colvin wrote: On Thursday, 6 November 2014 at 15:53:27 UTC, Jack Applegame wrote: I have rectangular forward range of forward ranges (not arrays): [ [a11, a12, ... a1N], [a21, a22, ... a2N], ... [aM1, aM2, ... aMN] ] I need lazy forward

  1   2   >