Re: Performance issue in struct initialization

2016-05-28 Thread Era Scarecrow via Digitalmars-d
On Friday, 27 May 2016 at 09:02:17 UTC, Johan Engelen wrote: That language guarantee prevents optimization of the initialization (in this case, the optimized result would be no initialization at all). So a breaking language spec change would be needed. Is this pursued by anyone? Perhaps only

Re: is my code to get CTFE instantiated object valid D ?

2016-05-28 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 28 May 2016 at 08:34:17 UTC, Mike Parker wrote: const(F) cf = f; immutable(f) if = f; And, of course, those should be const(Foo) and immutable(Foo).

Re: Our Sister

2016-05-28 Thread ZombineDev via Digitalmars-d
On Thursday, 26 May 2016 at 16:11:22 UTC, Andrei Alexandrescu wrote: I've been working on RCStr (endearingly pronounced "Our Sister"), D's up-and-coming reference counted string type. The goals are: RCStr may be an easier first step, but I think generic dynamic arrays are more interesting,

[Issue 16086] New: Imported function name shadows alias this member

2016-05-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16086 Issue ID: 16086 Summary: Imported function name shadows alias this member Product: D Version: D2 Hardware: x86 OS: Mac OS X Status: NEW Severity: regression

Re: The D language online tour - tour.dlang.org

2016-05-28 Thread Andrew Edwards via Digitalmars-d-announce
On 5/28/16 4:23 AM, Seb wrote: On Friday, 27 May 2016 at 19:18:11 UTC, Andrew Edwards wrote: On Monday, 16 May 2016 at 17:32:06 UTC, André wrote: [...] Hello André, Congratulations. Job well done on a much need resource for the community. I sent you an email almost two weeks ago via your

Re: is my code to get CTFE instantiated object valid D ?

2016-05-28 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 28 May 2016 at 05:30:26 UTC, chmike wrote: What is the difference between a const and immutable object ? would a const object be allowed to modify itself by using a hash table or caching results inside ? The difference lies in the guarantees of const and immutable. Foo f = new

Re: asm woes...

2016-05-28 Thread ZombineDev via Digitalmars-d-learn
On Saturday, 28 May 2016 at 08:10:50 UTC, Era Scarecrow wrote: On Friday, 27 May 2016 at 09:22:49 UTC, Guillaume Piolat wrote: You have to write your code three times, one for version(D_InlineAsm_X86) version (D_InlineAsm_X86_64) and a version without assembly. Rather than make a new thread

Re: Benchmark Dlang vs Node vs Ruby

2016-05-28 Thread yawniek via Digitalmars-d-learn
On Friday, 27 May 2016 at 16:47:19 UTC, Daniel Kozak wrote: Why not to use distribute oprion? Dne 27. 5. 2016 17:35 napsal uživatel "yawniek via Digitalmars-d-learn" < digitalmars-d-learn@puremagic.com>: it its a flawed strategy. what you should do is let the kernel handle it and use SO_

Re: asm woes...

2016-05-28 Thread Era Scarecrow via Digitalmars-d-learn
On Friday, 27 May 2016 at 09:22:49 UTC, Guillaume Piolat wrote: You have to write your code three times, one for version(D_InlineAsm_X86) version (D_InlineAsm_X86_64) and a version without assembly. Rather than make a new thread I wonder if struct inheritance wouldn't solve this, as trying

Re: is my code to get CTFE instantiated object valid D ?

2016-05-28 Thread Kagamin via Digitalmars-d-learn
On Saturday, 28 May 2016 at 05:30:26 UTC, chmike wrote: Would it be different if the object was declared const instead of immutable ? Sometimes compiler is able to figure out that const data is immutable. This is a bit frustrating because it is trivial to implement in C and C++. For a

Re: Transient ranges

2016-05-28 Thread cym13 via Digitalmars-d
On Saturday, 28 May 2016 at 01:48:08 UTC, Jonathan M Davis wrote: On Friday, May 27, 2016 23:42:24 Seb via Digitalmars-d wrote: So what about the convention to explicitely declare a `.transient` enum member on a range, if the front element value can change? Honestly, I don't think that

Re: Alias this member shadowed by imported function identifier?

2016-05-28 Thread Johan Engelen via Digitalmars-d-learn
On Friday, 27 May 2016 at 17:00:04 UTC, Steven Schveighoffer wrote: Now, the question here is, when does alias this kick in? I would say it should follow alias this before looking outside the module, so I say it's a bug. https://issues.dlang.org/show_bug.cgi?id=16086

Re: The Case Against Autodecode

2016-05-28 Thread Dmitry Olshansky via Digitalmars-d
On 28-May-2016 01:04, tsbockman wrote: On Friday, 27 May 2016 at 20:42:13 UTC, Andrei Alexandrescu wrote: On 05/27/2016 03:39 PM, Dmitry Olshansky wrote: No, this is not the point of normalization. What is? -- Andrei 1) A grapheme may include several combining characters (such as

Re: asm woes...

2016-05-28 Thread Era Scarecrow via Digitalmars-d-learn
On Saturday, 28 May 2016 at 10:10:19 UTC, ZombineDev wrote: The great thing about D's UFCS is that it allows exactly that: Also, you can implement inc() in terms of ulong[2] - void inc(ref ulong[2] w), which makes it applicable for other types, with the same memory representation. E.g. cent

Re: faster splitter

2016-05-28 Thread Chris via Digitalmars-d
On Friday, 27 May 2016 at 20:39:03 UTC, qznc wrote: Now added Chris' algo to the benchmark: std find:155 ±33 manual find: 112 ±19 qznc find: 122 ±18 <--- improved find Chris find: 133 ±20 <--- findStringS_ Did you fix the bugs in my algorithm? S

Re: The Case Against Autodecode

2016-05-28 Thread Marc Schütz via Digitalmars-d
On Friday, 27 May 2016 at 13:34:33 UTC, Andrei Alexandrescu wrote: On 5/27/16 6:56 AM, Marc Schütz wrote: It is not, which has been shown by various posts in this thread. Couldn't quite find strong arguments. Could you please be more explicit on which you found most convincing? -- Andrei

Re: is my code to get CTFE instantiated object valid D ?

2016-05-28 Thread chmike via Digitalmars-d-learn
On Saturday, 28 May 2016 at 08:47:48 UTC, Kagamin wrote: For a trick of static mutable allocation see https://github.com/dlang/druntime/pull/1325 Thank you that looks promising. I'll study an experiment with the code. If I would like that the instances are not in TLS, can I use the following

Re: Our Sister

2016-05-28 Thread Marc Schütz via Digitalmars-d
On Friday, 27 May 2016 at 13:32:30 UTC, Andrei Alexandrescu wrote: On 5/27/16 7:07 AM, Marc Schütz wrote: On Thursday, 26 May 2016 at 16:11:22 UTC, Andrei Alexandrescu wrote: RFC: what primitives should RCStr have? It should _safely_ convert to `const(char)[]`. That is not possible, sorry.

Re: C++ to D converter based on clang

2016-05-28 Thread Seb via Digitalmars-d-announce
On Saturday, 28 May 2016 at 11:02:37 UTC, Loïc HAMOT wrote: Hello, I am working on a C++ to D converter. The project is opensource, on github : https://github.com/lhamot/CPP2D Clang is used to parse the C++ code and get the abstract syntax tree. Then I can visit the AST to print it to D

Re: Our Sister

2016-05-28 Thread Marc Schütz via Digitalmars-d
On Saturday, 28 May 2016 at 04:28:16 UTC, Manu wrote: On 27 May 2016 at 23:32, Andrei Alexandrescu via Digitalmars-d wrote: On 5/27/16 7:07 AM, Marc Schütz wrote: It should _safely_ convert to `const(char)[]`. That is not possible, sorry. -- Andrei It should

@trusting generic functions

2016-05-28 Thread Lodovico Giaretta via Digitalmars-d-learn
Let's say I have a generic function that uses pointers. It will be inferred @system by the compiler, but I know that the pointer usage can be @trusted. The problem is that if I declare the function @trusted, I'm also implicitly trusting any call to @system methods of the template parameter.

Re: @trusting generic functions

2016-05-28 Thread Era Scarecrow via Digitalmars-d-learn
On Saturday, 28 May 2016 at 11:50:33 UTC, Lodovico Giaretta wrote: Is there any way around this? Any way to declare a function @trusted as long as the methods of the template argument are at least @trusted? Thank you in advance. Use traits.. https://dlang.org/phobos/std_traits.html#isSafe

Re: @trusting generic functions

2016-05-28 Thread Lodovico Giaretta via Digitalmars-d-learn
On Saturday, 28 May 2016 at 11:57:09 UTC, Era Scarecrow wrote: Use traits.. https://dlang.org/phobos/std_traits.html#isSafe so your function becomes (i believe) auto doSomethingDumb(T)(ref T t) if(isSafe!(T)) The problem is that T is a type, and I should check for safety of every

Re: Battle-plan for CTFE

2016-05-28 Thread Stefan Koch via Digitalmars-d-announce
On Friday, 27 May 2016 at 23:31:24 UTC, Stefan Koch wrote: On Monday, 9 May 2016 at 16:57:39 UTC, Stefan Koch wrote: Hi Guys, I have been looking into the DMD now to see what I can do about CTFE. I will post more details as soon as I dive deeper into the code. Update : int bug6498(int x)

Re: @trusting generic functions

2016-05-28 Thread Era Scarecrow via Digitalmars-d-learn
On Saturday, 28 May 2016 at 12:25:14 UTC, Lodovico Giaretta wrote: On Saturday, 28 May 2016 at 11:57:09 UTC, Era Scarecrow wrote: auto doSomethingDumb(T)(ref T t) if(isSafe!(T)) The problem is that T is a type, and I should check for safety of every method of T that I'm using in my

Re: C++ to D converter based on clang

2016-05-28 Thread Stefan Koch via Digitalmars-d-announce
On Saturday, 28 May 2016 at 11:02:37 UTC, Loïc HAMOT wrote: Hello, I am working on a C++ to D converter. The project is opensource, on github : https://github.com/lhamot/CPP2D [...] Interesting!

Re: Our Sister

2016-05-28 Thread ZombineDev via Digitalmars-d
On Saturday, 28 May 2016 at 09:43:41 UTC, ZombineDev wrote: On Thursday, 26 May 2016 at 16:11:22 UTC, Andrei Alexandrescu wrote: I've been working on RCStr (endearingly pronounced "Our Sister"), D's up-and-coming reference counted string type. The goals are: RCStr may be an easier first

Re: A ready to use Vulkan triangle example for D

2016-05-28 Thread maik klein via Digitalmars-d-announce
On Saturday, 28 May 2016 at 03:02:23 UTC, WhatMeWorry wrote: On Friday, 27 May 2016 at 18:40:24 UTC, maik klein wrote: https://github.com/MaikKlein/VulkanTriangleD Another dependency is ErupteD which I have forked myself because there is currently an issue with xlib-d and xcb-d with

C++ to D converter based on clang

2016-05-28 Thread Loïc HAMOT via Digitalmars-d-announce
Hello, I am working on a C++ to D converter. The project is opensource, on github : https://github.com/lhamot/CPP2D Clang is used to parse the C++ code and get the abstract syntax tree. Then I can visit the AST to print it to D language. Some tricks are used to convert the simplest macros

Re: faster splitter

2016-05-28 Thread qznc via Digitalmars-d
On Saturday, 28 May 2016 at 01:30:11 UTC, Andrei Alexandrescu wrote: On 05/27/2016 06:19 PM, qznc wrote: manual find: 118 ±24 qznc find: 109 ±13 <--- using the sentinel trick Chris find: 142 ±27 It is normal that the numbers of the other tests change, since those are relative to the

Re: C++ to D converter based on clang

2016-05-28 Thread Steven Schveighoffer via Digitalmars-d-announce
On Saturday, 28 May 2016 at 11:02:37 UTC, Loïc HAMOT wrote: Hello, I am working on a C++ to D converter. The project is opensource, on github : https://github.com/lhamot/CPP2D [...] Very nice! Looking at your examples, you should know that the default protection in D classes is public.

Re: The Case Against Autodecode

2016-05-28 Thread Andrei Alexandrescu via Digitalmars-d
On 5/28/16 6:59 AM, Marc Schütz wrote: The fundamental problem is choosing one of those possibilities over the others without knowing what the user actually wants, which is what both BEFORE and AFTER do. OK, that's a fair argument, thanks. So it seems there should be no "default" way to

Re: @trusting generic functions

2016-05-28 Thread Era Scarecrow via Digitalmars-d-learn
On Saturday, 28 May 2016 at 11:57:09 UTC, Era Scarecrow wrote: auto doSomethingDumb(T)(ref T t) if(isSafe!(T)) Should also probably test for a function or delegate. So...? auto doSomethingDumb(T)(ref T t) if(isSafe!T && (isFunctionPointer!T || isDelegate!T)) { T* pt =

Re: standard alias for a class name inside the class code?

2016-05-28 Thread dan via Digitalmars-d-learn
On Sunday, 29 May 2016 at 00:28:13 UTC, Mithun Hunsur wrote: On Sunday, 29 May 2016 at 00:14:17 UTC, dan wrote: Is there a standard alias for a class name inside class code? Something like 'this' referring to a class instance, but referring instead to the class itself? [...] typeof(this)

Re: Transient ranges

2016-05-28 Thread Brad Roberts via Digitalmars-d
On 5/28/2016 10:27 AM, Joseph Rushton Wakeling via Digitalmars-d wrote: On Saturday, 28 May 2016 at 01:48:08 UTC, Jonathan M Davis wrote: On Friday, May 27, 2016 23:42:24 Seb via Digitalmars-d wrote: So what about the convention to explicitely declare a `.transient` enum member on a range, if

Re: IDE - Coedit 2, update 6 released

2016-05-28 Thread Basile B. via Digitalmars-d-announce
On Saturday, 28 May 2016 at 20:39:18 UTC, Bauss wrote: So there's no way to do it through the editor? Like I don't use a dark theme in my OS, but I do like my editors to be dark. I confirm. Dark theme only available if the OS widget set has one.

[Issue 15925] [REG 2.071] Import declaration from mixin templates are ignored

2016-05-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15925 github-bugzi...@puremagic.com changed: What|Removed |Added Resolution|INVALID |FIXED --

Re: standard alias for a class name inside the class code?

2016-05-28 Thread Mithun Hunsur via Digitalmars-d-learn
On Sunday, 29 May 2016 at 00:14:17 UTC, dan wrote: Is there a standard alias for a class name inside class code? Something like 'this' referring to a class instance, but referring instead to the class itself? [...] typeof(this) gets you the type of the current class. :)

Re: @trusting generic functions

2016-05-28 Thread Era Scarecrow via Digitalmars-d-learn
On Saturday, 28 May 2016 at 14:54:13 UTC, Era Scarecrow wrote: Well here's what i got. Maybe someone else will tell me how i did this wrong... Using the pragma to output how the lines were being generated i finally figured out why it kept complaining about the stack pointer and 'this'. So

Re: IDE - Coedit 2, update 6 released

2016-05-28 Thread Bauss via Digitalmars-d-announce
On Saturday, 28 May 2016 at 21:55:58 UTC, Basile B. wrote: On Saturday, 28 May 2016 at 20:39:18 UTC, Bauss wrote: So there's no way to do it through the editor? Like I don't use a dark theme in my OS, but I do like my editors to be dark. I confirm. Dark theme only available if the OS widget

[Issue 16035] Compiler crashes with inout, templates, and recursion

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

[Issue 16089] New: Outdated "D on GitHub" link.

2016-05-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16089 Issue ID: 16089 Summary: Outdated "D on GitHub" link. Product: D Version: D2 Hardware: x86 OS: Mac OS X Status: NEW Severity: trivial Priority: P1

Re: Transient ranges

2016-05-28 Thread Joseph Rushton Wakeling via Digitalmars-d
On Saturday, 28 May 2016 at 21:32:15 UTC, Brad Roberts wrote: On 5/28/2016 10:27 AM, Joseph Rushton Wakeling via Digitalmars-d wrote: On Saturday, 28 May 2016 at 01:48:08 UTC, Jonathan M Davis wrote: On Friday, May 27, 2016 23:42:24 Seb via Digitalmars-d wrote: So what about the convention to

Re: is my code to get CTFE instantiated object valid D ?

2016-05-28 Thread ag0aep6g via Digitalmars-d-learn
On 05/28/2016 09:54 PM, chmike wrote: The only inconvenience left is that we can't have mutable references to immutable objects. There is std.typecons.Rebindable for that.

Re: The Case Against Autodecode

2016-05-28 Thread Andrew Godfrey via Digitalmars-d
On Saturday, 28 May 2016 at 19:04:14 UTC, Walter Bright wrote: On 5/28/2016 5:04 AM, Andrei Alexandrescu wrote: So it harkens back to the original mistake: strings should NOT be arrays with the respective primitives. An array of code units provides consistency, predictability, flexibility,

Re: The Case Against Autodecode

2016-05-28 Thread Jack Stouffer via Digitalmars-d
On Saturday, 28 May 2016 at 12:04:20 UTC, Andrei Alexandrescu wrote: OK, that's a fair argument, thanks. So it seems there should be no "default" way to iterate a string Yes! So it harkens back to the original mistake: strings should NOT be arrays with the respective primitives. If you're

standard alias for a class name inside the class code?

2016-05-28 Thread dan via Digitalmars-d-learn
Is there a standard alias for a class name inside class code? Something like 'this' referring to a class instance, but referring instead to the class itself? What i would like to do is have something like class Clas { // alias Clas THIS; <- don't want this boilerplate static THIS

Re: A ready to use Vulkan triangle example for D

2016-05-28 Thread maik klein via Digitalmars-d-announce
On Sunday, 29 May 2016 at 00:37:54 UTC, Alex Parrill wrote: On Saturday, 28 May 2016 at 19:32:58 UTC, maik klein wrote: Btw does this even work? I think the struct initializers have to be Foo foo = { someVar: 1 }; `:` instead of a `=` I didn't do this because I actually got autocompletion

[Issue 15925] [REG 2.071] Import declaration from mixin templates are ignored

2016-05-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15925 --- Comment #10 from github-bugzi...@puremagic.com --- Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/b86f3b3b357f6d0edc0c8a60552657b922443017 fix Issue 15925 - Import declaration from mixin templates

We need to talk about error messages of functions that are passed into other functions at compile time

2016-05-28 Thread maik klein via Digitalmars-d
I really like D's syntax for lambdas and I usually write code like this auto v = validationLayers[].all!((layerName){ return layerProps[].count!((layer){ return strcmp(cast(const(char*))layer.layerName, layerName) == 0; }) > 0; }); But this gives you basically 0 helpful

Re: C++ to D converter based on clang

2016-05-28 Thread Loïc HAMOT via Digitalmars-d-announce
On Saturday, 28 May 2016 at 11:26:23 UTC, Seb wrote: On Saturday, 28 May 2016 at 11:02:37 UTC, Loïc HAMOT wrote: Hello, I am working on a C++ to D converter. The project is opensource, on github : https://github.com/lhamot/CPP2D [...] If somebody is interested to use this software, or to

Re: is my code to get CTFE instantiated object valid D ?

2016-05-28 Thread chmike via Digitalmars-d-learn
On Saturday, 28 May 2016 at 08:47:48 UTC, Kagamin wrote: For a trick of static mutable allocation see https://github.com/dlang/druntime/pull/1325 In the following instruction of the above commit, what effect has the [] after init ? _store[0 .. __traits(classInstanceSize, T)] =

Re: Is it possible to forbid synchronization on an object ?

2016-05-28 Thread Meta via Digitalmars-d-learn
On Saturday, 28 May 2016 at 16:24:21 UTC, chmike wrote: In my long quest to implement a flyweight pattern with objects instantiated at compile time, I was indirectly notified of the possible problem of synchronization. In a flyweight pattern the user has the impression there are distinct

Re: I wrote a function that accepts input ranges, and I get compile errors when passing an array

2016-05-28 Thread pineapple via Digitalmars-d-learn
On Saturday, 28 May 2016 at 16:25:02 UTC, Seb wrote: If you are interested how it works under the hood - it's pretty simple & elegant: I checked up on the phobos implementation and found that arrays are mutated when iterated over as ranges, which didn't rest well with me. Nor did the idea of

Re: is my code to get CTFE instantiated object valid D ?

2016-05-28 Thread ag0aep6g via Digitalmars-d-learn
On 05/28/2016 10:34 AM, Mike Parker wrote: On Saturday, 28 May 2016 at 05:30:26 UTC, chmike wrote: [...] Is a static const Category c variable a TLS variable ? Yes. All variables are TLS unless explicitly marked with __gshared or shared. I don't think that's true. import core.thread;

Copyright for Phobos to D Foundation

2016-05-28 Thread Seb via Digitalmars-d
One thing that confused me a lot in the beginning, is that every Phobos module has it's own copyright - I am not a lawyer, but it sounded for me pretty weird that in theory I could get sued by a lot of Oracle-like patent trolls. I imagine the same effect also for companies when they read a

Re: A ready to use Vulkan triangle example for D

2016-05-28 Thread Alex Parrill via Digitalmars-d-announce
On Saturday, 28 May 2016 at 10:58:05 UTC, maik klein wrote: derelict-vulcan only works on windows, dvulkan doesn't have the platform dependend surface extensions for xlib, xcb, w32 and wayland. Without them Vulkan is unusable for me. I really don't care what I use, I just wanted something

[Issue 16087] Alignment (.alignof) and stack space incorrect for SIMD types.

2016-05-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16087 ZombineDev changed: What|Removed |Added CC|

Re: faster splitter

2016-05-28 Thread Chris via Digitalmars-d
On Friday, 27 May 2016 at 21:31:48 UTC, David Nadlinger wrote: Just about the only reason I could think of for this to happen is if the compiler fails to inline the range primitives from std.array. Otherwise, the loops should be pretty much equivalent to LLVM's optimiser. This is so

Re: I wrote a function that accepts input ranges, and I get compile errors when passing an array

2016-05-28 Thread Seb via Digitalmars-d-learn
On Friday, 27 May 2016 at 14:59:25 UTC, Adam D. Ruppe wrote: On Friday, 27 May 2016 at 14:54:30 UTC, pineapple wrote: I've encountered one remarkable difference: The phobos function accepts arrays and mine does not. add `import std.array;` i think to your module and it should make arrays

Re: Does this C callback call look correct?

2016-05-28 Thread WhatMeWorry via Digitalmars-d-learn
Never mind. D was fine. Needed an alureUpdate() to trigger the call back.

Re: @trusting generic functions

2016-05-28 Thread Era Scarecrow via Digitalmars-d-learn
On Saturday, 28 May 2016 at 14:11:56 UTC, Lodovico Giaretta wrote: On Saturday, 28 May 2016 at 14:01:35 UTC, Era Scarecrow wrote: Do you still want the template i'm building? Thank you very much for your effort. Please if you don't need it, don't make it, because I don't know if I'll use

Re: @trusting generic functions

2016-05-28 Thread Era Scarecrow via Digitalmars-d-learn
On Saturday, 28 May 2016 at 14:11:56 UTC, Lodovico Giaretta wrote: On Saturday, 28 May 2016 at 14:01:35 UTC, Era Scarecrow wrote: Do you still want the template i'm building? Thank you very much for your effort. Please if you don't need it, don't make it, because I don't know if I'll use

[Issue 16087] New: Alignment (.alignof) and stack space incorrect for SIMD types.

2016-05-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16087 Issue ID: 16087 Summary: Alignment (.alignof) and stack space incorrect for SIMD types. Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW

Re: faster splitter

2016-05-28 Thread qznc via Digitalmars-d
On Saturday, 28 May 2016 at 14:18:10 UTC, Chris wrote: I used dmd, because I don't have ldc on my laptop. qznc's find is clearly the winner. DMD performance feels flaky to me. If performance is important, you should use ldc or gdc. Alternatively, you are Walter Bright and simply optimize

Re: Copyright for Phobos to D Foundation

2016-05-28 Thread Joseph Rushton Wakeling via Digitalmars-d
On Saturday, 28 May 2016 at 18:30:03 UTC, Seb wrote: On Saturday, 28 May 2016 at 18:11:16 UTC, Joseph Rushton Wakeling wrote: Copyright is extremely under-reported for Phobos, in my experience -- authors of significant components of modules do not necessarily add their name to the copyright

Re: I wrote a function that accepts input ranges, and I get compile errors when passing an array

2016-05-28 Thread Seb via Digitalmars-d-learn
On Saturday, 28 May 2016 at 20:43:00 UTC, pineapple wrote: On Saturday, 28 May 2016 at 16:25:02 UTC, Seb wrote: If you are interested how it works under the hood - it's pretty simple & elegant: I checked up on the phobos implementation and found that arrays are mutated when iterated over as

Re: @trusting generic functions

2016-05-28 Thread Era Scarecrow via Digitalmars-d-learn
On Saturday, 28 May 2016 at 13:10:56 UTC, Lodovico Giaretta wrote: The only problem is that these structures are parameterized, and the type parameters may have unsafe operations that I use. Do you still want the template i'm building? It doesn't like stack frame pointers, but will work with

Re: faster splitter

2016-05-28 Thread Chris via Digitalmars-d
On Saturday, 28 May 2016 at 12:47:59 UTC, Andrei Alexandrescu wrote: On 5/28/16 6:56 AM, qznc wrote: The sentinel value is `needleBack+1`, but range elements need not support addition. Finding a sentinel is hard and most certainly requires more assumptions about the ranges. No need for a

Re: @trusting generic functions

2016-05-28 Thread ag0aep6g via Digitalmars-d-learn
On 05/28/2016 02:43 PM, Lodovico Giaretta wrote: struct S1 { int doSomething() @safe { // do something safely return 1; } } struct S2 { int doSomething() @system { // do something usafe return 2; } } auto doSomethingDumb(T)(ref

Re: IDE - Coedit 2, update 6 released

2016-05-28 Thread Nick Sabalausky via Digitalmars-d-announce
On 05/28/2016 09:08 AM, Basile B. wrote: On Friday, 27 May 2016 at 17:49:18 UTC, Bauss wrote: On Thursday, 26 May 2016 at 23:44:21 UTC, Basile B. wrote: Mostly because an important feature of the library manager was not compatible with DUB > v0.9.24. Otherwise almost nothing. See

[Issue 16088] New: Parse error for import expression in statement

2016-05-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16088 Issue ID: 16088 Summary: Parse error for import expression in statement Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal

Re: is my code to get CTFE instantiated object valid D ?

2016-05-28 Thread chmike via Digitalmars-d-learn
On Friday, 27 May 2016 at 20:20:36 UTC, chmike wrote: I need to create an app wide singleton instance for my class. The singleton is immutable, but I want to allow mutable references to that singleton object so that I can do fast 'is' tests. I declared this class Category { protected

Re: Easier way to add libraries to visual d?

2016-05-28 Thread TheDGuy via Digitalmars-d-learn
On Saturday, 28 May 2016 at 15:29:36 UTC, TheDGuy wrote: Thanks a lot for the fast hot fix, now everything works fine! :) Great IDE! Do you mind implementing an option to reset the layout to default? Because i think i messed up and no i don't know how i can get the file view for the

Re: Easier way to add libraries to visual d?

2016-05-28 Thread Basile B. via Digitalmars-d-learn
On Saturday, 28 May 2016 at 15:31:18 UTC, TheDGuy wrote: On Saturday, 28 May 2016 at 15:29:36 UTC, TheDGuy wrote: Thanks a lot for the fast hot fix, now everything works fine! :) Great IDE! Do you mind implementing an option to reset the layout to default? Because i think i messed up and

Re: is my code to get CTFE instantiated object valid D ?

2016-05-28 Thread ag0aep6g via Digitalmars-d-learn
On 05/28/2016 06:09 PM, chmike wrote: In the following instruction of the above commit, what effect has the [] after init ? _store[0 .. __traits(classInstanceSize, T)] = typeid(T).init[]; T is a template argument that is a class derived from Error. I couldn't find an explanation here

Re: IDE - Coedit 2, update 6 released

2016-05-28 Thread Nick Sabalausky via Digitalmars-d-announce
Also, just a minor wishlist thing, but it'd be nice if the currently active file (or project name, or something) was prepended to the window's title bar, so it's displays on people's taskbar. That comes in handy when using multiple editor windows.

Re: faster splitter

2016-05-28 Thread qznc via Digitalmars-d
On Saturday, 28 May 2016 at 12:47:59 UTC, Andrei Alexandrescu wrote: On 5/28/16 6:56 AM, qznc wrote: The sentinel value is `needleBack+1`, but range elements need not support addition. Finding a sentinel is hard and most certainly requires more assumptions about the ranges. No need for a

Re: Transient ranges

2016-05-28 Thread Joseph Rushton Wakeling via Digitalmars-d
On Saturday, 28 May 2016 at 01:48:08 UTC, Jonathan M Davis wrote: On Friday, May 27, 2016 23:42:24 Seb via Digitalmars-d wrote: So what about the convention to explicitely declare a `.transient` enum member on a range, if the front element value can change? Honestly, I don't think that

Re: Transient ranges

2016-05-28 Thread Stefan Koch via Digitalmars-d
On Saturday, 28 May 2016 at 17:27:17 UTC, Joseph Rushton Wakeling wrote: On Saturday, 28 May 2016 at 01:48:08 UTC, Jonathan M Davis wrote: On Friday, May 27, 2016 23:42:24 Seb via Digitalmars-d wrote: So what about the convention to explicitely declare a `.transient` enum member on a range, if

Re: IDE - Coedit 2, update 6 released

2016-05-28 Thread Bauss via Digitalmars-d-announce
On Saturday, 28 May 2016 at 13:08:55 UTC, Basile B. wrote: On Friday, 27 May 2016 at 17:49:18 UTC, Bauss wrote: On Thursday, 26 May 2016 at 23:44:21 UTC, Basile B. wrote: Mostly because an important feature of the library manager was not compatible with DUB > v0.9.24. Otherwise almost

Re: Easier way to add libraries to visual d?

2016-05-28 Thread TheDGuy via Digitalmars-d-learn
On Saturday, 28 May 2016 at 13:25:14 UTC, Basile B. wrote: I've released a hot fix yesterday and now it works with latest DUB tag (0.9.25). But registering from the project that's loaded was already working yesterday. I think that you have forgotten to choose the right configuration to

Re: IDE - Coedit 2, update 6 released

2016-05-28 Thread Basile B. via Digitalmars-d-announce
On Saturday, 28 May 2016 at 16:23:41 UTC, Nick Sabalausky wrote: It'd be nice if there was a pre-defined set of dark highlighter attributes that could just be selected and then used out-of-the-box or as a starting point. In general, manually adjusting editor themes can get to be a pain,

D Embedded Database v0.1 Released

2016-05-28 Thread Piotrek via Digitalmars-d-announce
Short description A database engine for quick and easy integration into any D program. Full compatibility with D types and ranges. Design Goals (none is accomplished yet) - ACID - No external dependencies - Single file storage - Multithread support - Suitable for

Re: @trusting generic functions

2016-05-28 Thread Lodovico Giaretta via Digitalmars-d-learn
On Saturday, 28 May 2016 at 14:01:35 UTC, Era Scarecrow wrote: On Saturday, 28 May 2016 at 13:10:56 UTC, Lodovico Giaretta wrote: The only problem is that these structures are parameterized, and the type parameters may have unsafe operations that I use. Do you still want the template i'm

Is it possible to forbid synchronization on an object ?

2016-05-28 Thread chmike via Digitalmars-d-learn
In my long quest to implement a flyweight pattern with objects instantiated at compile time, I was indirectly notified of the possible problem of synchronization. In a flyweight pattern the user has the impression there are distinct instances where in fact objects with the same state (member

Re: Copyright for Phobos to D Foundation

2016-05-28 Thread Seb via Digitalmars-d
On Saturday, 28 May 2016 at 18:11:16 UTC, Joseph Rushton Wakeling wrote: Copyright is extremely under-reported for Phobos, in my experience -- authors of significant components of modules do not necessarily add their name to the copyright list or even the author list. Yes that's a huge

Re: Avoid GC with closures

2016-05-28 Thread Iakh via Digitalmars-d
On Friday, 27 May 2016 at 10:34:38 UTC, Kagamin wrote: On Thursday, 26 May 2016 at 18:53:35 UTC, Iakh wrote: void g() @nogc { catch scope(void); int[N] arr = [/*...*/]; arr[].sort!((a, b) => a > b); } This compiles just fine and doesn't allocate: void g() @nogc { int[2] arr =

Re: The Case Against Autodecode

2016-05-28 Thread Walter Bright via Digitalmars-d
On 5/28/2016 5:04 AM, Andrei Alexandrescu wrote: So it harkens back to the original mistake: strings should NOT be arrays with the respective primitives. An array of code units provides consistency, predictability, flexibility, and performance. It's a solid base upon which the programmer can

Re: Copyright for Phobos to D Foundation

2016-05-28 Thread Joseph Rushton Wakeling via Digitalmars-d
On Saturday, 28 May 2016 at 17:50:46 UTC, Seb wrote: Now that D foundation finally got its own page [1], it's probably time to start this dicussion. Is it safe to assume that the entire Phobos source code (except for the external C modules), belongs to the D foundation? No, not at all, and

Re: Copyright for Phobos to D Foundation

2016-05-28 Thread Seb via Digitalmars-d
On Saturday, 28 May 2016 at 18:39:20 UTC, Joseph Rushton Wakeling wrote: On Saturday, 28 May 2016 at 18:30:03 UTC, Seb wrote: On Saturday, 28 May 2016 at 18:11:16 UTC, Joseph Rushton Wakeling wrote: Copyright is extremely under-reported for Phobos, in my experience -- authors of significant

Re: A ready to use Vulkan triangle example for D

2016-05-28 Thread maik klein via Digitalmars-d-announce
On Saturday, 28 May 2016 at 17:50:30 UTC, Alex Parrill wrote: On Saturday, 28 May 2016 at 10:58:05 UTC, maik klein wrote: derelict-vulcan only works on windows, dvulkan doesn't have the platform dependend surface extensions for xlib, xcb, w32 and wayland. Without them Vulkan is unusable for

Re: Avoid GC with closures

2016-05-28 Thread Iakh via Digitalmars-d
On Thursday, 26 May 2016 at 21:10:30 UTC, bpr wrote: On Thursday, 26 May 2016 at 18:53:35 UTC, Iakh wrote: Functions with lambdas cannot be @nogc as far as they allocates closures. Counterexample: // Note that this is NOT a good way to do numerical quadrature! double integrate(scope double

Re: Transient ranges

2016-05-28 Thread Seb via Digitalmars-d
On Saturday, 28 May 2016 at 19:09:09 UTC, Stefan Koch wrote: On Saturday, 28 May 2016 at 17:27:17 UTC, Joseph Rushton Wakeling wrote: On Saturday, 28 May 2016 at 01:48:08 UTC, Jonathan M Davis wrote: On Friday, May 27, 2016 23:42:24 Seb via Digitalmars-d wrote: So what about the convention to

Re: standard alias for a class name inside the class code?

2016-05-28 Thread jhps via Digitalmars-d-learn
On Sunday, 29 May 2016 at 00:48:20 UTC, dan wrote: Especially in a declaration like static typeof(this) make_instance( ) but also in the 'new typeof(this)'. In both cases, 'this' doesn't even exist. https://dlang.org/spec/declaration.html#Typeof it's another 'this' that has not the

Re: We need to talk about error messages of functions that are passed into other functions at compile time

2016-05-28 Thread Seb via Digitalmars-d
On Saturday, 28 May 2016 at 13:37:55 UTC, maik klein wrote: I really like D's syntax for lambdas and I usually write code like this auto v = validationLayers[].all!((layerName){ return layerProps[].count!((layer){ return strcmp(cast(const(char*))layer.layerName, layerName) == 0;

Re: Battle-plan for CTFE

2016-05-28 Thread Taylor Hillegeist via Digitalmars-d-announce
On Saturday, 28 May 2016 at 12:27:26 UTC, Stefan Koch wrote: On Friday, 27 May 2016 at 23:31:24 UTC, Stefan Koch wrote: On Monday, 9 May 2016 at 16:57:39 UTC, Stefan Koch wrote: Hi Guys, I have been looking into the DMD now to see what I can do about CTFE. I will post more details as soon

Re: standard alias for a class name inside the class code?

2016-05-28 Thread dan via Digitalmars-d-learn
On Sunday, 29 May 2016 at 02:44:33 UTC, jhps wrote: On Sunday, 29 May 2016 at 00:48:20 UTC, dan wrote: Especially in a declaration like static typeof(this) make_instance( ) but also in the 'new typeof(this)'. In both cases, 'this' doesn't even exist.

Scriptlike v0.9.6 - Minor update

2016-05-28 Thread Nick Sabalausky via Digitalmars-d-announce
This is a minor update to Scriptlike: A utility library to help you write script-like programs in D. - Fixed deprecation warnings with DMD 2.070.x and 2.071.0 - Fixes the Travis-CI build which had been a little bit borked. - Interact module properly flushes stdout when prompting for user input

Free the DMD backend

2016-05-28 Thread open-source-guy via Digitalmars-d
Hi, this is a short ping about one of D's weaknesses - the restrictive license for the backend. IIRC [1, 2, 3] the status is that because some parts have been written by Walter while he was employed by Symantec, it can't get an open-source license. When I read the backend license [4], I read

  1   2   >