Re: Classes and Structs, Memory management questions

2016-09-02 Thread ikod via Digitalmars-d-learn
On Friday, 2 September 2016 at 08:43:45 UTC, dom wrote: Since garbage collection is a very nice feature that I wouldn't wanna miss for certain scenarios I think D should give us the opportunity to determine how an object is allocated. In the example above putting it on the stack is probably

Re: Fallback 'catch-all' template functions

2016-09-02 Thread Manu via Digitalmars-d
On 3 September 2016 at 11:38, Andrei Alexandrescu via Digitalmars-d wrote: > On 9/3/16 2:41 AM, Manu via Digitalmars-d wrote: >> >> On 3 September 2016 at 00:18, Xinok via Digitalmars-d >> wrote: >>> >>> >>> In the past, I have suggested

Re: ADL

2016-09-02 Thread Manu via Digitalmars-d
On 3 September 2016 at 11:25, Walter Bright via Digitalmars-d wrote: > On 9/2/2016 6:12 PM, Stefan Koch wrote: >> >> If this feature were supported, it would probably break our module system. >> Even if we could shoehorn it into the language it would make the compiler

Re: colour lib

2016-09-02 Thread rikki cattermole via Digitalmars-d
On 03/09/2016 12:17 PM, Manu via Digitalmars-d wrote: ...snip... I think the presence of all this colour space information as type arguments should nudge users in the right direction. They'll be all "I've never seen this parameter before..." and google it... maybe. I don't think it's the std

phobos unit tests

2016-09-02 Thread Manu via Digitalmars-d
This document: https://wiki.dlang.org/Contributing_to_Phobos States: "Avoid unittest in templates (it will generate a new unittest for each instance) - put your tests outside" Sounds reasonable, but then I realised that most of my unit tests are documenting unittests... this recommendation is in

Re: Fallback 'catch-all' template functions

2016-09-02 Thread Walter Bright via Digitalmars-d
On 9/1/2016 10:49 AM, Timon Gehr wrote: The following causes an ICE (DMD segfaults). import std.stdio; int f(T)(T t) if(!__traits(compiles,.f!T)) { return 0; } int f(T)(T t) if(!__traits(compiles,.f!T)) { return 1; } void main(){ writeln(f(2)); } Please post seg faults to

Re: Using OpenGL

2016-09-02 Thread Mike Parker via Digitalmars-d-learn
On Friday, 2 September 2016 at 20:38:15 UTC, Darren wrote: I'm trying to teach myself OpenGL but I'm not sure how to set it up exactly. I used "dub init" to create a project, I downloaded glew32.dll and glfw.dll and put them in this folder. I added "derelict-gl3": "~>1.0.19" and

Re: Fallback 'catch-all' template functions

2016-09-02 Thread Andrei Alexandrescu via Digitalmars-d
On 9/3/16 2:41 AM, Manu via Digitalmars-d wrote: On 3 September 2016 at 00:18, Xinok via Digitalmars-d wrote: In the past, I have suggested using the "default" keyword to specify a fallback function of this kind. I think it's a useful pattern for generic

Re: ADL

2016-09-02 Thread Walter Bright via Digitalmars-d
On 9/2/2016 6:12 PM, Stefan Koch wrote: If this feature were supported, it would probably break our module system. Even if we could shoehorn it into the language it would make the compiler slower. Note that C++ needs ADL in part because it cannot do options 2, 3 or 4.

[Issue 15625] Internal error: backend/elfobj.c 1014

2016-09-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15625 Walter Bright changed: What|Removed |Added CC|

Re: ADL

2016-09-02 Thread Stefan Koch via Digitalmars-d
On Saturday, 3 September 2016 at 01:09:18 UTC, Walter Bright wrote: Essentially, ADL has awkward problems when getting beyond the simple cases. It isn't right for D. I could not agree more strongly! If this feature were supported, it would probably break our module system. Even if we could

Re: ADL

2016-09-02 Thread Walter Bright via Digitalmars-d
On 9/2/2016 4:51 PM, Manu via Digitalmars-d wrote: (I should have given the example with test() outside the namespace) It's always best to provide an example of the actual problem rather than something else. module bob; struct S {} void f(S s); module joe; struct T {} void f(T t); module

Re: Fallback 'catch-all' template functions

2016-09-02 Thread Manu via Digitalmars-d
On 3 September 2016 at 00:18, Xinok via Digitalmars-d wrote: > > In the past, I have suggested using the "default" keyword to specify a > fallback function of this kind. I think it's a useful pattern for generic > algorithms that have optimized variants on specific

Re: colour lib

2016-09-02 Thread Manu via Digitalmars-d
On 3 September 2016 at 03:25, Marco Leise via Digitalmars-d wrote: > Am Fri, 2 Sep 2016 15:58:05 +1000 > schrieb Manu via Digitalmars-d : > >> I wonder, should NormalizedInt be a module beneath the color package, >> or should it be a

Re: colour lib

2016-09-02 Thread Manu via Digitalmars-d
On 2 September 2016 at 22:36, Steven Schveighoffer via Digitalmars-d wrote: > On 8/31/16 1:58 AM, Manu via Digitalmars-d wrote: >> >> I have this implementation issue, which I'm having trouble applying >> good judgement, I'd like to survey opinions... >> >> So, RGB

Re: ADL

2016-09-02 Thread Manu via Digitalmars-d
On 3 September 2016 at 08:38, Walter Bright via Digitalmars-d wrote: > On 9/2/2016 5:15 AM, Manu via Digitalmars-d wrote: >> >> In C++, there is this ADL thing (argument dependent lookup). > > > Yeah, I know about Koening lookup. It was a hack added to C++ to make >

Re: Quality of errors in DMD

2016-09-02 Thread David Nadlinger via Digitalmars-d
On Friday, 2 September 2016 at 22:12:20 UTC, Walter Bright wrote: Compiling with -v will usually show how far the compiler got. It's curious that this topic should come up now – just a couple of days ago, I thought about adding better user reporting for LDC ICEs. What I was planning to do

Re: ADL

2016-09-02 Thread Walter Bright via Digitalmars-d
On 9/2/2016 5:15 AM, Manu via Digitalmars-d wrote: In C++, there is this ADL thing (argument dependent lookup). Yeah, I know about Koening lookup. It was a hack added to C++ to make operator overloading work. D doesn't seem to have this, That's right, and it's on purpose :-) and that

Re: Quality of errors in DMD

2016-09-02 Thread H. S. Teoh via Digitalmars-d
On Fri, Sep 02, 2016 at 02:52:57PM -0700, Walter Bright via Digitalmars-d wrote: [...] > I understand your concern, and that's why we put a priority on fixing > asserts that are submitted to bugzilla. But without a bug report, we > are completely dead in the water in fixing it. It is supposed to

Re: Quality of errors in DMD

2016-09-02 Thread Walter Bright via Digitalmars-d
On 9/2/2016 2:54 PM, Chris Wright wrote: The second and third would be greatly benefitted by the compiler attempting to tell us where the problem was encountered. For instance, if the assert was triggered while trying to generate code for function dmud.eventqueue.EventQueue!(Fiber).scheduleNear,

Re: Quality of errors in DMD

2016-09-02 Thread Chris Wright via Digitalmars-d
On Friday, 2 September 2016 at 21:16:02 UTC, Walter Bright wrote: assert()s are there to check that impossible situations in the compiler don't actually happen. They are not for diagnosing errors in user code. There are three things that will ideally happen when someone sees an assert: *

Re: Quality of errors in DMD

2016-09-02 Thread Walter Bright via Digitalmars-d
On 9/2/2016 2:25 PM, Ethan Watson wrote: On Friday, 2 September 2016 at 21:16:02 UTC, Walter Bright wrote: assert()s are there to check that impossible situations in the compiler don't actually happen. They are not for diagnosing errors in user code. If a user sees an assert, it is a compiler

Re: Quality of errors in DMD

2016-09-02 Thread Ethan Watson via Digitalmars-d
On Friday, 2 September 2016 at 21:16:02 UTC, Walter Bright wrote: assert()s are there to check that impossible situations in the compiler don't actually happen. They are not for diagnosing errors in user code. If a user sees an assert, it is a compiler bug and hopefully he'll submit a bug

Re: RFC: Fixing std.typecons.Typedef

2016-09-02 Thread Meta via Digitalmars-d
On Friday, 2 September 2016 at 19:40:52 UTC, Meta wrote: I was thinking about how to fix Typedef the other day and came up with a way of generating a guaranteed unique ID for each instantiation, even if they are on the same line: alias FixedTypedef(T, T init = T.init, string cookie = new

Re: Quality of errors in DMD

2016-09-02 Thread Walter Bright via Digitalmars-d
On 9/2/2016 7:26 AM, Ethan Watson wrote: That's 830 possible places where the compiler will give the user virtually no help to track down what (if anything) they did wrong. assert()s are there to check that impossible situations in the compiler don't actually happen. They are not for

Using OpenGL

2016-09-02 Thread Darren via Digitalmars-d-learn
I'm trying to teach myself OpenGL but I'm not sure how to set it up exactly. I used "dub init" to create a project, I downloaded glew32.dll and glfw.dll and put them in this folder. I added "derelict-gl3": "~>1.0.19" and "derelict-glfw3": "~>3.1.0" to dependencies, and imported them in the

Re: Statistics functions

2016-09-02 Thread jmh530 via Digitalmars-d
On Friday, 2 September 2016 at 17:52:12 UTC, John Colvin wrote: Short story: it doesn't have any explicit support. Ndslice is much newer than dstats. The ndslice range interface should mean quite a lot of stuff will work anyway. What I figured, thanks.

Re: Low level unit test library in druntime

2016-09-02 Thread Dicebot via Digitalmars-d
On Friday, 2 September 2016 at 19:26:41 UTC, Jacob Carlborg wrote: On 2016-09-01 14:02, Dicebot wrote: What would be different? List of unit test blocks available in the program? How the unit tests are written and collected. unittest { assert(true); } class FooTest : Test { void

Re: Hash table element existence check

2016-09-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/2/16 3:38 PM, Illuminati wrote: I am trying to create a hash table and would like an efficient way to be able to know if an element exists to test for collisions. You mean you are writing your own hash table, or you want to use a D hash table (associative array)? I could keep a

RFC: Fixing std.typecons.Typedef

2016-09-02 Thread Meta via Digitalmars-d
I was thinking about how to fix Typedef the other day and came up with a way of generating a guaranteed unique ID for each instantiation, even if they are on the same line: alias FixedTypedef(T, T init = T.init, string cookie = new class {}.stringof) = Typedef(T, init, cookie); alias Test1

Hash table element existence check

2016-09-02 Thread Illuminati via Digitalmars-d-learn
I am trying to create a hash table and would like an efficient way to be able to know if an element exists to test for collisions. I could keep a bitarray, but wasting around 12% space. I could use pointers(null check) to elements but this creates fragmentation. It is not terrible, just

Re: Low level unit test library in druntime

2016-09-02 Thread Jacob Carlborg via Digitalmars-d
On 2016-09-01 14:02, Dicebot wrote: What would be different? List of unit test blocks available in the program? How the unit tests are written and collected. unittest { assert(true); } class FooTest : Test { void testFoo() { assert(true); } } describe("foo", { it("does something",

OT: Anyone looking for compiler job?

2016-09-02 Thread Dmitry Olshansky via Digitalmars-d
I've come to appreciate the D NG as a source of wisdom on many topics including those outside of the D lang realm. As such I could have easily recommended many folks around here. My current employer is in active search of good candidates so I thought I'd spread the word. Anyone interested in

Re: Beta D 2.071.2-b3

2016-09-02 Thread Basile B. via Digitalmars-d-announce
On Friday, 2 September 2016 at 10:29:41 UTC, David Nadlinger wrote: On Friday, 2 September 2016 at 08:57:14 UTC, Basile B. wrote: On Friday, 2 September 2016 at 08:15:53 UTC, ketmar wrote: std.traits wrappers should use __traits to build *safe* things (declaring that @trusted in the end).

Re: Quality of errors in DMD

2016-09-02 Thread H. S. Teoh via Digitalmars-d
On Fri, Sep 02, 2016 at 08:43:30PM +0300, Dicebot via Digitalmars-d wrote: > On 09/02/2016 06:45 PM, Wyatt wrote: > > On the other, though, considering he's been using DMD for years and > > didn't know that, I think there's a cogent argument for improving > > even ICE messages. At the least, have

[Issue 12929] Empty union followed by field causes ICE due to offset of 0.

2016-09-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12929 hst...@quickfur.ath.cx changed: What|Removed |Added CC||hst...@quickfur.ath.cx --- Comment

Re: Quality of errors in DMD

2016-09-02 Thread John Colvin via Digitalmars-d
On Friday, 2 September 2016 at 14:26:37 UTC, Ethan Watson wrote: Can we have a serious discussion in here about the quality of DMD errors? I've been alternately a dog chasing its own tail, and a dog barking at a fire hydrant, chasing down errors deep in templated and mixin code over the last

[Issue 14537] Declaring an extern(C++) function in a variadic function template results in an ICE.

2016-09-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14537 hst...@quickfur.ath.cx changed: What|Removed |Added CC||hst...@quickfur.ath.cx --- Comment

Re: Statistics functions

2016-09-02 Thread John Colvin via Digitalmars-d
On Friday, 2 September 2016 at 14:40:36 UTC, jmh530 wrote: On Friday, 2 September 2016 at 14:37:55 UTC, jmh530 wrote: On Thursday, 1 September 2016 at 23:44:15 UTC, John Colvin wrote: Now with actually working API docs: https://dlangscience.github.io/dstats/api/ That makes me happy! It

Re: opAssign return type

2016-09-02 Thread Q. Schroll via Digitalmars-d-learn
On Friday, 2 September 2016 at 17:33:22 UTC, Steven Schveighoffer wrote: On 9/2/16 1:18 PM, Q. Schroll wrote: When overloading assignment, I've been taught in my C++ course to return a reference to the lvalue being assigned to. This is easily possible in D, but in Phobos it is used rarely and

[Issue 16461] Using the fully qualified type of an object within its own scope causes an error

2016-09-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16461 ag0ae...@gmail.com changed: What|Removed |Added CC||ag0ae...@gmail.com --- Comment #1 from

Re: Quality of errors in DMD

2016-09-02 Thread Dicebot via Digitalmars-d
On 09/02/2016 06:45 PM, Wyatt wrote: > On the other, though, considering he's been using DMD for years and > didn't know that, I think there's a cogent argument for improving even > ICE messages. At the least, have them print "Internal Compiler Error". Great idea, I hacked a quick implementation

Re: colour lib

2016-09-02 Thread Marco Leise via Digitalmars-d
Am Fri, 2 Sep 2016 15:58:05 +1000 schrieb Manu via Digitalmars-d : > On 2 September 2016 at 06:09, Marco Leise via Digitalmars-d > wrote: > > I'd suspect #1 to be the best option, too. However, I don't > > know when users will deal with

Re: opAssign return type

2016-09-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/2/16 1:18 PM, Q. Schroll wrote: When overloading assignment, I've been taught in my C++ course to return a reference to the lvalue being assigned to. This is easily possible in D, but in Phobos it is used rarely and in Ali Çehreli's Book it is neither taught to do so. Sure, you can do

[Issue 15875] "d o(int[a]a)(){}" causes DMD segfault

2016-09-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15875 hst...@quickfur.ath.cx changed: What|Removed |Added CC||hst...@quickfur.ath.cx --- Comment

opAssign return type

2016-09-02 Thread Q. Schroll via Digitalmars-d-learn
When overloading assignment, I've been taught in my C++ course to return a reference to the lvalue being assigned to. This is easily possible in D, but in Phobos it is used rarely and in Ali Çehreli's Book it is neither taught to do so. Is there any reason to it? To me it seems very obvious

[Issue 16107] [ICE] - Internal error: backend/cgcod.c 2297

2016-09-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16107 --- Comment #6 from hst...@quickfur.ath.cx --- P.S. The faulty call to freenode() comes from codelem() in cgcod.c. --

[Issue 16107] [ICE] - Internal error: backend/cgcod.c 2297

2016-09-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16107 hst...@quickfur.ath.cx changed: What|Removed |Added CC||bugzi...@digitalmars.com --

Re: Is it a bug in unittest ?

2016-09-02 Thread ZombineDev via Digitalmars-d
On Thursday, 1 September 2016 at 18:11:55 UTC, angel wrote: If one creates a unittest block in a templated class (or struct), the unittest block will be multiplied per class specialization, which might turn out to be quite large number. E.g. struct A(T) { ... unittest {

[Issue 16107] [ICE] - Internal error: backend/cgcod.c 2297

2016-09-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16107 --- Comment #5 from hst...@quickfur.ath.cx --- I managed to trace the error to freenode() in backend/cgcod.c, for some reason it gets called with an elem with e->Ecomsub==0, so when it tries to decrement it, e->Ecomsub rolls over to 255, which

Re: colour lib

2016-09-02 Thread Marco Leise via Digitalmars-d
> Is it s or z ? :) It's an alias to forego any language bike shedding.

Re: ADL

2016-09-02 Thread Cauterite via Digitalmars-d
On Friday, 2 September 2016 at 12:15:25 UTC, Manu wrote: The only problem I have with this feature is that it would lead to implicit-importation, which is a totally foreign concept in D, and I would assume a design choice to not support it. import bob : S; S s; // implicit `import bob :

[Issue 16107] [ICE] - Internal error: backend/cgcod.c 2297

2016-09-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16107 hst...@quickfur.ath.cx changed: What|Removed |Added CC||hst...@quickfur.ath.cx --

[Issue 16237] Some DMD Assertion Failures

2016-09-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16237 hst...@quickfur.ath.cx changed: What|Removed |Added CC||hst...@quickfur.ath.cx --- Comment

Re: Quality of errors in DMD

2016-09-02 Thread Wyatt via Digitalmars-d
On Friday, 2 September 2016 at 15:12:48 UTC, Steven Schveighoffer wrote: This is an internal compiler error. It's not a standard way of reporting errors in D code. It means the internal state of the compiler is messed. Not much the compiler can do except crash. On one hand, it's encouraging

Re: Quality of errors in DMD

2016-09-02 Thread kink via Digitalmars-d
On Friday, 2 September 2016 at 14:26:37 UTC, Ethan Watson wrote: But compared to MSVC, I've found the error reporting of DMD to be severely lacking. In most cases with MSVC, I have an error code that I can google for which is (sometimes) thoroughly documented. You're not really comparing DMD

Re: Quality of errors in DMD

2016-09-02 Thread Steven Schveighoffer via Digitalmars-d
On 9/2/16 10:26 AM, Ethan Watson wrote: Can we have a serious discussion in here about the quality of DMD errors? I've been alternately a dog chasing its own tail, and a dog barking at a fire hydrant, chasing down errors deep in templated and mixin code over the last day. This has resulted in

Re: [GSoC] Precise GC

2016-09-02 Thread jmh530 via Digitalmars-d-announce
On Friday, 2 September 2016 at 08:14:33 UTC, Rory McGuire wrote: Can we rather just make a special tagged union that is scanned... rather avoid trying to make something that should be minimal more and more complex? The compiler already treats some parts of phobos as "special" as far as I

Re: Statistics functions

2016-09-02 Thread jmh530 via Digitalmars-d
On Friday, 2 September 2016 at 14:37:55 UTC, jmh530 wrote: On Thursday, 1 September 2016 at 23:44:15 UTC, John Colvin wrote: Now with actually working API docs: https://dlangscience.github.io/dstats/api/ That makes me happy! It occurs to me that I don't know how much dstats works with

Re: Statistics functions

2016-09-02 Thread jmh530 via Digitalmars-d
On Thursday, 1 September 2016 at 23:44:15 UTC, John Colvin wrote: Now with actually working API docs: https://dlangscience.github.io/dstats/api/ That makes me happy!

Quality of errors in DMD

2016-09-02 Thread Ethan Watson via Digitalmars-d
Can we have a serious discussion in here about the quality of DMD errors? I've been alternately a dog chasing its own tail, and a dog barking at a fire hydrant, chasing down errors deep in templated and mixin code over the last day. This has resulted in manually reducing templates and mixins

Re: Fallback 'catch-all' template functions

2016-09-02 Thread Xinok via Digitalmars-d
On Thursday, 1 September 2016 at 05:37:50 UTC, Manu wrote: So, consider a set of overloads: void f(T)(T t) if(isSomething!T) {} void f(T)(T t) if(isSomethingElse!T) {} void f(T)(T t) {} I have a recurring problem where I need a fallback function like the bottom one, which should be used

[Issue 16464] opCast doco is insufficient

2016-09-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16464 Steven Schveighoffer changed: What|Removed |Added Keywords||pull, spec --

[Issue 16464] opCast doco is insufficient

2016-09-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16464 --- Comment #4 from Steven Schveighoffer --- PR: https://github.com/dlang/dlang.org/pull/1467 --

[Issue 16464] opCast doco is insufficient

2016-09-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16464 --- Comment #3 from Steven Schveighoffer --- (In reply to Manu from comment #2) > Compare that table to the table of binary operators immediately below. Compare that to the table of slice operators above :) I think actually,

Re: Beta D 2.071.2-b3

2016-09-02 Thread Chris Wright via Digitalmars-d-announce
On Fri, 02 Sep 2016 09:40:56 +, ketmar wrote: > On Friday, 2 September 2016 at 08:57:14 UTC, Basile B. wrote: >> On Friday, 2 September 2016 at 08:15:53 UTC, ketmar wrote: >>> std.traits wrappers should use __traits to build *safe* things >>> (declaring that @trusted in the end). >> >> This

Re: [GSoC] Precise GC

2016-09-02 Thread Guillaume Piolat via Digitalmars-d-announce
On Friday, 2 September 2016 at 03:25:33 UTC, Jeremy DeHaan wrote: Through the work I did and the research of a couple of GC topics, I discovered that I really enjoyed working on the garbage collector and I plan on continuing that. I was recently accepted to the University of Washington's

[Issue 16464] opCast doco is insufficient

2016-09-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16464 --- Comment #2 from Manu --- Wow, you're right. I didn't make any sense of that table at all. Compare that table to the table of binary operators immediately below. That inconsistency possibly lead me to overlook that table as

[Issue 16464] opCast doco is insufficient

2016-09-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16464 Steven Schveighoffer changed: What|Removed |Added CC|

Re: ADL

2016-09-02 Thread Steven Schveighoffer via Digitalmars-d
On 9/2/16 8:15 AM, Manu via Digitalmars-d wrote: In C++, there is this ADL thing (argument dependent lookup). What it does is, when searching for overloads, in addition to looking in the local namespace, it also looks in the namespace of the function arguments. D doesn't seem to have this, and

Re: ADL

2016-09-02 Thread Dicebot via Digitalmars-d
On 09/02/2016 03:15 PM, Manu via Digitalmars-d wrote: > In C++, there is this ADL thing (argument dependent lookup). > What it does is, when searching for overloads, in addition to looking > in the local namespace, it also looks in the namespace of the function > arguments. AFAIR it is

Re: colour lib

2016-09-02 Thread Steven Schveighoffer via Digitalmars-d
On 8/31/16 1:58 AM, Manu via Digitalmars-d wrote: I have this implementation issue, which I'm having trouble applying good judgement, I'd like to survey opinions... So, RGB colours depend on this 'normalised integer' concept, that is: unsigned: luminance = val / IntType.max signed:

Re: ADL

2016-09-02 Thread David Nadlinger via Digitalmars-d
On Friday, 2 September 2016 at 12:15:25 UTC, Manu wrote: D doesn't seem to have this, and that is proving to be quite problematic. What's the work around? Somehow pass in the required information along with the symbol, for example as a member function/alias or an UDA. It's hard to get more

ADL

2016-09-02 Thread Manu via Digitalmars-d
In C++, there is this ADL thing (argument dependent lookup). What it does is, when searching for overloads, in addition to looking in the local namespace, it also looks in the namespace of the function arguments. D doesn't seem to have this, and that is proving to be quite problematic. What's the

Re: @safe RCSlice with DIP1000 + runtime checks

2016-09-02 Thread rikki cattermole via Digitalmars-d
On 02/09/2016 11:18 PM, Nick Treleaven wrote: Hi, I've been working on a proof of concept Reference Counted Slice container, based on the one in DIP1000. That one now has opAssign marked @system, see: https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md#owning-containers So I decided to

Re: vibed.org is down

2016-09-02 Thread Daniel Kozak via Digitalmars-d
Dne 2.9.2016 v 13:26 Nemanja Boric via Digitalmars-d napsal(a): On Friday, 2 September 2016 at 11:24:53 UTC, Nemanja Boric wrote: On Friday, 2 September 2016 at 10:32:07 UTC, Daniel Kozak wrote: web@WebCN:~ $ ping ipult.cz PING ipult.cz.eurocloud.cn (14.215.133.119) 56(84) bytes of data. 64

Re: vibed.org is down

2016-09-02 Thread Daniel Kozak via Digitalmars-d
Wow :D, you are right Dne 2.9.2016 v 13:24 Nemanja Boric via Digitalmars-d napsal(a): On Friday, 2 September 2016 at 10:32:07 UTC, Daniel Kozak wrote: web@WebCN:~ $ ping ipult.cz PING ipult.cz.eurocloud.cn (14.215.133.119) 56(84) bytes of data. 64 bytes from mail.eurocloud.cn

Re: vibed.org is down

2016-09-02 Thread Nemanja Boric via Digitalmars-d
On Friday, 2 September 2016 at 11:24:53 UTC, Nemanja Boric wrote: On Friday, 2 September 2016 at 10:32:07 UTC, Daniel Kozak wrote: web@WebCN:~ $ ping ipult.cz PING ipult.cz.eurocloud.cn (14.215.133.119) 56(84) bytes of data. 64 bytes from mail.eurocloud.cn (14.215.133.119): icmp_seq=1 ttl=64

Re: vibed.org is down

2016-09-02 Thread Nemanja Boric via Digitalmars-d
On Friday, 2 September 2016 at 10:32:07 UTC, Daniel Kozak wrote: web@WebCN:~ $ ping ipult.cz PING ipult.cz.eurocloud.cn (14.215.133.119) 56(84) bytes of data. 64 bytes from mail.eurocloud.cn (14.215.133.119): icmp_seq=1 ttl=64 time=0.031 ms 64 bytes from mail.eurocloud.cn (14.215.133.119):

@safe RCSlice with DIP1000 + runtime checks

2016-09-02 Thread Nick Treleaven via Digitalmars-d
Hi, I've been working on a proof of concept Reference Counted Slice container, based on the one in DIP1000. That one now has opAssign marked @system, see: https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md#owning-containers So I decided to make an RCSlice with a @safe opAssign (and

[Issue 16464] New: opCast doco is insufficient

2016-09-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16464 Issue ID: 16464 Summary: opCast doco is insufficient Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1

[Issue 16462] mixin template ddoc doesn't appear in docs

2016-09-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16462 Manu changed: What|Removed |Added Hardware|x86_64 |All OS|Windows

[Issue 16462] New: mixin template ddoc doesn't appear in docs

2016-09-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16462 Issue ID: 16462 Summary: mixin template ddoc doesn't appear in docs Product: D Version: D2 Hardware: x86_64 OS: Windows Status: NEW Severity: enhancement

Re: vibed.org is down

2016-09-02 Thread Daniel Kozak via Digitalmars-d
Dne 2.9.2016 v 12:20 Sönke Ludwig via Digitalmars-d napsal(a): Am 02.09.2016 um 09:48 schrieb Daniel Kozak via Digitalmars-d: Dne 2.9.2016 v 09:39 wobbles via Digitalmars-d napsal(a): On Friday, 2 September 2016 at 07:23:51 UTC, Mike Parker wrote: On Friday, 2 September 2016 at 07:02:20

Re: Beta D 2.071.2-b3

2016-09-02 Thread David Nadlinger via Digitalmars-d-announce
On Friday, 2 September 2016 at 08:57:14 UTC, Basile B. wrote: On Friday, 2 September 2016 at 08:15:53 UTC, ketmar wrote: std.traits wrappers should use __traits to build *safe* things (declaring that @trusted in the end). This has nothing to do with memory safety. Actually it does, albeit

Re: Classes and Structs, Memory management questions

2016-09-02 Thread Andrea Fontana via Digitalmars-d-learn
On Friday, 2 September 2016 at 08:43:45 UTC, dom wrote: from what i got Classes are always reference types and structs are value types in D. i am wondering why that is. for me the main difference between classes and structs is not how they are allocated, but that one has inhertiance, and the

Re: vibed.org is down

2016-09-02 Thread Sönke Ludwig via Digitalmars-d
Am 02.09.2016 um 09:48 schrieb Daniel Kozak via Digitalmars-d: Dne 2.9.2016 v 09:39 wobbles via Digitalmars-d napsal(a): On Friday, 2 September 2016 at 07:23:51 UTC, Mike Parker wrote: On Friday, 2 September 2016 at 07:02:20 UTC, finalpatch wrote: Probably not good for publicity. meh.

Re: Equivalent of FirstOrDefault with ranges

2016-09-02 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 2 September 2016 at 06:56:07 UTC, Lutger wrote: I was looking for something like FirstOrDefault* from .NET in phobos. For example, I have this piece of code: string findBobOrReturnNull(string[] names) { auto r = names.find("bob"); if(r.empty) return null; return r.front;

Re: Beta D 2.071.2-b3

2016-09-02 Thread Rory McGuire via Digitalmars-d-announce
On Fri, Sep 2, 2016 at 10:15 AM, ketmar via Digitalmars-d-announce < digitalmars-d-announce@puremagic.com> wrote: > On Friday, 2 September 2016 at 07:46:30 UTC, Rory McGuire wrote: > actually, from my PoV solution is supereasy: just remove ALL visibility > restrictions for traits. and i mean all.

Re: Classes and Structs, Memory management questions

2016-09-02 Thread Mike Parker via Digitalmars-d-learn
On Friday, 2 September 2016 at 08:43:45 UTC, dom wrote: from what i got Classes are always reference types and structs are value types in D. i am wondering why that is. for me the main difference between classes and structs is not how they are allocated, but that one has inhertiance, and the

Re: Beta D 2.071.2-b3

2016-09-02 Thread ketmar via Digitalmars-d-announce
On Friday, 2 September 2016 at 08:57:14 UTC, Basile B. wrote: On Friday, 2 September 2016 at 08:15:53 UTC, ketmar wrote: std.traits wrappers should use __traits to build *safe* things (declaring that @trusted in the end). This has nothing to do with memory safety. i wonder who told you that

Re: Classes and Structs, Memory management questions

2016-09-02 Thread dom via Digitalmars-d-learn
On Friday, 2 September 2016 at 08:59:38 UTC, Andrea Fontana wrote: On Friday, 2 September 2016 at 08:54:33 UTC, dom wrote: i haven't read it fully yet, but i think this DIP contains some or all of my concerns https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md Check this:

Re: Beta D 2.071.2-b3

2016-09-02 Thread Basile B. via Digitalmars-d-announce
On Friday, 2 September 2016 at 08:15:53 UTC, ketmar wrote: std.traits wrappers should use __traits to build *safe* things (declaring that @trusted in the end). This has nothing to do with memory safety. It's just that protection attributes were invented for OOP and when applied to template

Re: Classes and Structs, Memory management questions

2016-09-02 Thread Andrea Fontana via Digitalmars-d-learn
On Friday, 2 September 2016 at 08:54:33 UTC, dom wrote: i haven't read it fully yet, but i think this DIP contains some or all of my concerns https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md Check this: https://dlang.org/phobos/std_experimental_allocator.html

Re: Classes and Structs, Memory management questions

2016-09-02 Thread dom via Digitalmars-d-learn
i haven't read it fully yet, but i think this DIP contains some or all of my concerns https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md

Re: Equivalent of FirstOrDefault with ranges

2016-09-02 Thread Cauterite via Digitalmars-d-learn
On Friday, 2 September 2016 at 06:56:07 UTC, Lutger wrote: You could do: names.find("bob").chain(only(``)).front; It's not very expressive though.

Classes and Structs, Memory management questions

2016-09-02 Thread dom via Digitalmars-d-learn
from what i got Classes are always reference types and structs are value types in D. i am wondering why that is. for me the main difference between classes and structs is not how they are allocated, but that one has inhertiance, and the other hasn't. Supporting inheritance has some overhead,

Re: DUB, link automatically right object for platform and archi

2016-09-02 Thread Basile B. via Digitalmars-d-learn
On Friday, 2 September 2016 at 03:24:58 UTC, rikki cattermole wrote: On 02/09/2016 6:01 AM, Basile B. wrote: [...] What's wrong in my description ? For starters Ouch... buildSettings is just a name given to a group of properties. It doesn't actually go INTO the dub file. Thx much, this

[Issue 16461] New: Using the fully qualified type of an object within its own scope causes an error

2016-09-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16461 Issue ID: 16461 Summary: Using the fully qualified type of an object within its own scope causes an error Product: D Version: D2 Hardware: x86_64 OS: Windows

Re: Beta D 2.071.2-b3

2016-09-02 Thread ketmar via Digitalmars-d-announce
On Friday, 2 September 2016 at 07:46:30 UTC, Rory McGuire wrote: actually, from my PoV solution is supereasy: just remove ALL visibility restrictions for traits. and i mean all. allMembers should return all members, getMember should allow to access *any* existing member without annoying

  1   2   >