Re: #import mapi.h

2018-03-21 Thread Timoses via Digitalmars-d-learn
On Wednesday, 21 March 2018 at 16:22:45 UTC, Martin Tschierschke wrote: Is there an step by step introduction how to convert a C header of an external lib into the right extern(C){} block? A blog post or tutorial, or chapter in a D book? (I have those from Packt Publishing) While googling I

Re: OK, I'm stumped on this one: dstep, struct, mixin, bitfields

2018-03-21 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 21 March 2018 at 18:00:38 UTC, Russel Winder wrote: ubyte, "version", 5, version is a D keyword, so I would suggest trying "version_" there instead and see if it works. (I'm guessing btw, the error message was way to long and illegible, but this is an easy first guess

Re: Template condition evaluation (shortcircuit)

2018-03-21 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Mar 21, 2018 at 05:42:34PM +, rumbu via Digitalmars-d-learn wrote: > I tried to define a template: > > enum isFoo(alias T) = > T.stringof.length >= 3 && T.stringof[0..3] == "abc"; > > int i; > pragma(msg, isFoo!i); > > Error: string slice [0 .. 3] is out of bounds > Error:

Re: OK, I'm stumped on this one: dstep, struct, mixin, bitfields

2018-03-21 Thread Ali Çehreli via Digitalmars-d-learn
On 03/21/2018 11:00 AM, Russel Winder wrote: > The code I am playing with generated by DStep involves lots of lots of > structs with mixin bitfields. All of them seem to compile file, except > one. How is it that: > > mixin(bitfields!( > ubyte, "current_next", 1, > ubyte,

Re: Flaw in DIP1000? Returning a Result Struct in DIP1000

2018-03-21 Thread Jonathan M Davis via Digitalmars-d
On Wednesday, March 21, 2018 17:13:40 Jack Stouffer via Digitalmars-d wrote: > Consider this example simplified from this PR > https://github.com/dlang/phobos/pull/6281 > > -- > struct GetoptResult > { > Option[] options; > } > > struct Option > { > string optShort; > string

Re: OK, I'm stumped on this one: dstep, struct, mixin, bitfields

2018-03-21 Thread Russel Winder via Digitalmars-d-learn
On Wed, 2018-03-21 at 18:11 +, Adam D. Ruppe via Digitalmars-d- learn wrote: > On Wednesday, 21 March 2018 at 18:00:38 UTC, Russel Winder wrote: > > ubyte, "version", 5, > > > version is a D keyword, so I would suggest trying "version_" > there instead and see if it works. (I'm

Re: strip() and formattedRead()

2018-03-21 Thread realhet via Digitalmars-d-learn
On Wednesday, 21 March 2018 at 18:50:18 UTC, Adam D. Ruppe wrote: On Wednesday, 21 March 2018 at 18:44:12 UTC, realhet wrote: Compiling this I get an error: "formattedRead: cannot deduce arguments from (string, string, float, float, float)" What compiler version are you using? The newest

[Issue 17906] Deprecated functions should not cause deprecated warnings for using deprecated features

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17906 --- Comment #4 from FeepingCreature --- Huh, seems like you're right. Not sure if this was fixed or it always worked that way. Either way, good to know! I guess this bug report is about Mathias Lang's problem now. --

Re: OK, I'm stumped on this one: dstep, struct, mixin, bitfields

2018-03-21 Thread Jacob Carlborg via Digitalmars-d-learn
On 2018-03-21 20:30, Russel Winder wrote: Thanks to Adam and Ali, it was clear and obvious. Please report and issue so it's not forgotten. -- /Jacob Carlborg

Re: Flaw in DIP1000? Returning a Result Struct in DIP1000

2018-03-21 Thread Jack Stouffer via Digitalmars-d
On Wednesday, 21 March 2018 at 18:50:59 UTC, Jonathan M Davis wrote: The struct being returned would need to be marked with scope (or its members marked with scope) such that the compiler treated the result as containing values from the function arguments. I don't know whether that's possible

D's type declarations seem to read right to left.

2018-03-21 Thread tipdbmp via Digitalmars-d-learn
D's type declarations seem to read right to left. int an_integer; int[10] an_array_of_10_integers; int[10]* a_pointer_to_an_array_of_10_integers = _array_of_10_integers; int*[10] an_array_of_10_pointers_to_integers; int*[10]* a_pointer_to_an_array_of_10_pointers_to_integers =

Re: does it scale to have 1 person approve of all phobos additions?

2018-03-21 Thread Andrei Alexandrescu via Digitalmars-d
On 03/20/2018 06:56 PM, Meta wrote: Does it make sense? In my opinion, no, but according to Andrei be has tried being less hands-on before and it resulted in measurably worse quality code in Phobos; thus, he re-established himself as the gatekeeper. I agree that it doesn't scale and think that

Re: How to use an associative array with array values.

2018-03-21 Thread tipdbmp via Digitalmars-d-learn
I see. I guess the other would be: { int[8192] bar; int[8192][string] foo; foo["a"] = bar; foo["a"][8191] = -1; }

Re: why does this compile fine, but dies when you run it.

2018-03-21 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 21 March 2018 at 18:53:39 UTC, steven kladitis wrote: int[] array3; array3[0]=4; array3 is empty. You are trying to set a value that doesn't exist..

[Issue 17906] Deprecated functions should not cause deprecated warnings for using deprecated features

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17906 --- Comment #2 from FeepingCreature --- That's also true, but my example refers specifically to deprecated functions using deprecated types. However, I labelled the bug report wrong, and your example actually fits it

Re: Flaw in DIP1000? Returning a Result Struct in DIP1000

2018-03-21 Thread Jack Stouffer via Digitalmars-d
On Wednesday, 21 March 2018 at 19:15:41 UTC, Meta wrote: But the compiler doesn't like that. However, I _did_ get it working by doing this: GetoptResult getopt(T...)(scope T opts) @safe { return GetoptResult([Option(opts[0], opts[1])]); } Which is not ideal, obviously, but the notion that

Re: D's type declarations seem to read right to left.

2018-03-21 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 21 March 2018 at 20:07:09 UTC, tipdbmp wrote: I think this is a big improvement over C's "spiral" way of reading types: Yes, D is perfect and has achieved sanity where before there was none. You can read basically anything with little knowledge. void function()[]

Re: D's type declarations seem to read right to left.

2018-03-21 Thread Nick Sabalausky via Digitalmars-d-learn
On Wednesday, 21 March 2018 at 20:07:09 UTC, tipdbmp wrote: D's type declarations seem to read right to left. int an_integer; int[10] an_array_of_10_integers; int[10]* a_pointer_to_an_array_of_10_integers = _array_of_10_integers; int*[10] an_array_of_10_pointers_to_integers; int*[10]*

[Issue 18461] codegen bug - OPbt expressions and assignments to ambiguous symbols

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18461 Walter Bright changed: What|Removed |Added Summary|codegen bug in dmd -|codegen bug - OPbt

Re: Need example of usage DerelictPQ

2018-03-21 Thread number via Digitalmars-d-learn
On Wednesday, 24 December 2014 at 11:56:40 UTC, Suliman wrote: Could anybody provide any simple examples of usage DerelictPQ. I do not have experience of C, and I can't understand how to use this driver. I need just basics like connect, select and insert.

Re: Slow start up time of runtime (correction: Windows real-time protection)

2018-03-21 Thread Dennis via Digitalmars-d-learn
On Wednesday, 21 March 2018 at 13:26:48 UTC, HeiHon wrote: I added exclusions for the folder, where I installed dmd and ldc and I added an exclusion for the folder, where I compile my D programs. Now startup of dmd and freshly compiled programs is fast again. I've done this too now, thanks

[Issue 18461] codegen bug - OPbt expressions and assignments to ambiguous symbols

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18461 --- Comment #11 from Walter Bright --- https://github.com/dlang/dmd/pull/8065 --

Re: Packages and module import

2018-03-21 Thread Jacob Carlborg via Digitalmars-d-learn
On 2018-03-21 17:06, Russel Winder wrote: No I wasn't. And it works a treat. Cool :). I recommend having a look at the changelog and the usage information (--help). -- /Jacob Carlborg

Re: Flaw in DIP1000? Returning a Result Struct in DIP1000

2018-03-21 Thread jmh530 via Digitalmars-d
On Wednesday, 21 March 2018 at 17:13:40 UTC, Jack Stouffer wrote: [snip] How can we return non-scoped result variables constructed from scope variables without copies? If you re-wrote this so that it just had pointers, would it be simpler? Below is my attempt, not sure it's the same...

Re: Cumulative code coverage?

2018-03-21 Thread Seb via Digitalmars-d
On Wednesday, 21 March 2018 at 16:39:48 UTC, H. S. Teoh wrote: Is it possible to get cumulative code coverage using dmd? I.e., accumulate code coverage stats over a series of runs from an external test suite. Currently, it seems that compiling with -cov will just overwrite the *.lst files

Re: does it scale to have 1 person approve of all phobos additions?

2018-03-21 Thread Jonathan M Davis via Digitalmars-d
On Wednesday, March 21, 2018 09:45:46 Russel Winder via Digitalmars-d wrote: > D has the Dub repository, so why is Phobos being "batteries included" even > an issue now? Some folks seem to think that something _has_ to be in the standard library, or the language is sub-standard, and some folks

[Issue 10933] findSplitBefore/After should have needle-less overloads

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10933 --- Comment #1 from Luís Marques --- Yup, I've ran into the same issue multiple times. This last time with the plain findSplit; I don't recall if also with findSplitBefore/After. This workaround works:

Re: How to use an associative array with array values.

2018-03-21 Thread Jesse Phillips via Digitalmars-d-learn
On Wednesday, 21 March 2018 at 18:31:29 UTC, tipdbmp wrote: I see. I guess the other would be: { int[8192] bar; int[8192][string] foo; foo["a"] = bar; foo["a"][8191] = -1; } https://run.dlang.io/is/AK2X2t Are you looking to use static arrays or dynamic? You can't use the new

Re: strip() and formattedRead()

2018-03-21 Thread Ali Çehreli via Digitalmars-d-learn
On 03/21/2018 11:44 AM, realhet wrote:   float x,y,z;   if(formattedRead("    vertex -5.1 2.4 3.666".strip, "vertex %f %f %f", x, y, z)){     writefln("v(%f, %f, %f)", x, y, z);   } formattedRead wants to modify the source, so it takes it by reference, which rvalues cannot be passed

Re: Flaw in DIP1000? Returning a Result Struct in DIP1000

2018-03-21 Thread Meta via Digitalmars-d
On Wednesday, 21 March 2018 at 17:13:40 UTC, Jack Stouffer wrote: Consider this example simplified from this PR https://github.com/dlang/phobos/pull/6281 -- struct GetoptResult { Option[] options; } struct Option { string optShort; string help; } GetoptResult

Re: Manipulate slice or specific element of range and return range

2018-03-21 Thread Timoses via Digitalmars-d-learn
On Wednesday, 21 March 2018 at 12:07:49 UTC, Simen Kjærås wrote: On Wednesday, 21 March 2018 at 11:30:28 UTC, Timoses wrote: unittest { assert("my capitalized string".capitalize == "myCapitalizedString"); } auto capitalize(string s) { import std.regex, std.uni; return

Re: Manipulate slice or specific element of range and return range

2018-03-21 Thread Timoses via Digitalmars-d-learn
On Wednesday, 21 March 2018 at 12:53:56 UTC, Ali Çehreli wrote: Here is another one that uses ForwardRange. import std.range; // empty, take, save, chain, popFrontN; import std.uni; // asLowerCase; import std.algorithm; // equal, filter; import std.conv; // text; auto initialLowerCased(R)(R

OK, I'm stumped on this one: dstep, struct, mixin, bitfields

2018-03-21 Thread Russel Winder via Digitalmars-d-learn
The code I am playing with generated by DStep involves lots of lots of structs with mixin bitfields. All of them seem to compile file, except one. How is it that: mixin(bitfields!( ubyte, "current_next", 1, ubyte, "version", 5, ubyte, "one2", 2)); /* TS ID */ can

Re: #import mapi.h

2018-03-21 Thread nkm1 via Digitalmars-d-learn
On Wednesday, 21 March 2018 at 16:22:45 UTC, Martin Tschierschke wrote: Is there an step by step introduction how to convert a C header of an external lib into the right extern(C){} block? A blog post or tutorial, or chapter in a D book? (I have those from Packt Publishing) (Especially I am

strip() and formattedRead()

2018-03-21 Thread realhet via Digitalmars-d-learn
Hi, I just got this problem and since an hour can't find answer to it. float x,y,z; if(formattedRead("vertex -5.1 2.4 3.666".strip, "vertex %f %f %f", x, y, z)){ writefln("v(%f, %f, %f)", x, y, z); } Compiling this I get an error: "formattedRead: cannot deduce arguments from

why does this compile fine, but dies when you run it.

2018-03-21 Thread steven kladitis via Digitalmars-d-learn
import std.stdio; void main(){ int[3] array1 = [ 10, 20, 30 ]; auto array2 = array1; // array2's elements are different // from array1's array2[0] = 11; int[] array3; //array4[0]=3; array3[0]=4; auto array4 = array3; writeln(array1,'\n',array2,'\n',array3,'\n',array4); } -- windows 7 64 bit (

Calling Windows Command

2018-03-21 Thread Vino via Digitalmars-d-learn
Hi All, Request your help in calling the windows command to delete all file and folders recursively as the D function rmdirRecurse does not delete file in the permission of the file is readonly in windows 2008 R2 import std.process: execute; import std.array: empty; auto RemoveDir () (

Re: strip() and formattedRead()

2018-03-21 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 21 March 2018 at 18:44:12 UTC, realhet wrote: Compiling this I get an error: "formattedRead: cannot deduce arguments from (string, string, float, float, float)" What compiler version are you using? The newest versions allow this code, though the old ones require an intermediate

[Issue 17906] Deprecated functions should not cause deprecated warnings for using deprecated features

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17906 Mathias Lang changed: What|Removed |Added CC|

Re: #dbugfix 17592

2018-03-21 Thread 12345swordy via Digitalmars-d
On Wednesday, 21 March 2018 at 14:04:58 UTC, Adam D. Ruppe wrote: On Wednesday, 21 March 2018 at 13:39:28 UTC, 12345swordy wrote: You can simply check the .dtor symbols at compile time to see if every .dtor symbol from child to root have a .dtor that have the @nogc attribute In Simen's

Re: OK, I'm stumped on this one: dstep, struct, mixin, bitfields

2018-03-21 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Mar 21, 2018 at 07:30:28PM +, Russel Winder via Digitalmars-d-learn wrote: [...] > But :-( > > Why does version have to be a keyword? [...] version(all) { ... } version(none) { ... } version(Posix) { ... } version(Windows) { ... } But yeah, using

Flaw in DIP1000? Returning a Result Struct in DIP1000

2018-03-21 Thread Jack Stouffer via Digitalmars-d
Consider this example simplified from this PR https://github.com/dlang/phobos/pull/6281 -- struct GetoptResult { Option[] options; } struct Option { string optShort; string help; } GetoptResult getopt(T...)(scope T opts) @safe { GetoptResult res; auto o =

[Issue 10933] findSplitBefore/After should have needle-less overloads

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10933 Luís Marques changed: What|Removed |Added CC||l...@luismarques.eu --

[Issue 17906] Deprecated functions should not cause deprecated warnings for using deprecated features

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17906 --- Comment #3 from Mathias Lang --- Could you paste the message generated ? In your example, I would expect a deprecation to be generated for the import, but not on the actual function declaration. --

Template condition evaluation (shortcircuit)

2018-03-21 Thread rumbu via Digitalmars-d-learn
I tried to define a template: enum isFoo(alias T) = T.stringof.length >= 3 && T.stringof[0..3] == "abc"; int i; pragma(msg, isFoo!i); Error: string slice [0 .. 3] is out of bounds Error: template object.__equals cannot deduce function from argument types !()(string, string), candidates

Re: Cumulative code coverage?

2018-03-21 Thread H. S. Teoh via Digitalmars-d
On Wed, Mar 21, 2018 at 05:34:58PM +, Seb via Digitalmars-d wrote: > On Wednesday, 21 March 2018 at 16:39:48 UTC, H. S. Teoh wrote: > > Is it possible to get cumulative code coverage using dmd? I.e., > > accumulate code coverage stats over a series of runs from an > > external test suite.

Re: Cumulative code coverage?

2018-03-21 Thread H. S. Teoh via Digitalmars-d
On Wed, Mar 21, 2018 at 12:35:08PM -0700, H. S. Teoh via Digitalmars-d wrote: [...] > Cool, passing --DRT-covopt="merge:1" did the trick. [...] Speaking of which, are the --DRT-* options documented anywhere?? I don't even know where to begin to look, besides in the druntime code itself. T --

[Issue 18645] New: DMD segmentation fault

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18645 Issue ID: 18645 Summary: DMD segmentation fault Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: major Priority: P1

Re: .dup with twodimensional arrays

2018-03-21 Thread berni via Digitalmars-d
On Wednesday, 21 March 2018 at 10:26:03 UTC, Steven Schveighoffer wrote: import std.algorithm: map; import std.array: array; solutions ~= tmp .map!(a => a.dup) // every access to an element dups it first .array; // build an array out of the result Oh, thanks, that's already

Re: "mydll" sample from C:\D\dmd2\samples\d\mydll\ doesn't compile. DMD 2.079.0, Windows 7

2018-03-21 Thread Vitalii via Digitalmars-d
On Wednesday, 21 March 2018 at 08:46:12 UTC, Mike Parker wrote: On Wednesday, 21 March 2018 at 08:44:15 UTC, Mike Parker wrote: On Wednesday, 21 March 2018 at 08:30:54 UTC, Vitalii wrote: In earlier version 2.073.3 of DMD compiler 32-bit version of "mydll" builds successfully, but 64-bit

Re: does it scale to have 1 person approve of all phobos additions?

2018-03-21 Thread Russel Winder via Digitalmars-d
On Tue, 2018-03-20 at 15:09 -0700, Timothee Cour via Digitalmars-d wrote: > > […] > * if phobos is supposed to be batteries included > […] Perhaps the lesson of Python, which always used to be "batteries included", but now clearly is not, especially given PyPI, is that D/Phobos should not be

Re: #dbugfix 17592

2018-03-21 Thread Simen Kjærås via Digitalmars-d
On Wednesday, 21 March 2018 at 08:49:11 UTC, Mike Franklin wrote: I think `rt_finalize` can be made `@nogc` in the runtime. And this is where you're wrong. Consider this: class A { @nogc ~this() {} } class B : A { ~this() {} } A a = new B(); destroy(a); // Is this @nogc?

[Issue 16037] assigning delegate to a scope variable shouldn't allocate closure

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16037 --- Comment #10 from anonymous4 --- (In reply to Mathias Lang from comment #9) > The web can get wide > pretty quickly, and suddenly your user is stuck in a situation where he has > to spend an unreasonable amount of time

Re: #dbugfix Issue 5710

2018-03-21 Thread Kagamin via Digitalmars-d
On Tuesday, 20 March 2018 at 02:45:34 UTC, Jonathan M Davis wrote: IMHO, it would be _huge_ if this issue could be fixed. The whole issue with "multiple context pointers" can get really annoying, and it can't always be reasonably worked around. However, I don't recall anyone ever coming up

Re: .dup with twodimensional arrays

2018-03-21 Thread berni via Digitalmars-d
Oops, sorry. I just have seen, that I posted in the wrong forum, should have been in "New users Learn". Is it possible to move this post over?

Re: Draft Review DIP: Enum and Function Parameter Attributes

2018-03-21 Thread Meta via Digitalmars-d-announce
On Wednesday, 21 March 2018 at 05:57:47 UTC, Mike Parker wrote: On Wednesday, 21 March 2018 at 02:26:02 UTC, Meta wrote: Low hanging fruit: Thanks for the feedback, but Draft Review comments should go in the PR thread. I'll add a link over there to the post, but when you get a chance, it

[Issue 18461] codegen bug in dmd - assignments to ambiguous symbols

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18461 Walter Bright changed: What|Removed |Added Hardware|x86_64 |All

Re: Please vote for Dub integration into Sonatype Nexus

2018-03-21 Thread Russel Winder via Digitalmars-d
On Tue, 2018-03-20 at 18:55 +, Dmitry Olshansky via Digitalmars-d wrote: > On Tuesday, 20 March 2018 at 06:48:15 UTC, Andre Pany wrote: > > Hi, > > > > if you have by chance a Sonatype account please vote for this > > issue to get Dub integrated into Sonatype Nexus: > >

[Issue 18461] codegen bug in dmd - assignments to ambiguous symbols

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18461 Walter Bright changed: What|Removed |Added Keywords||wrong-code

.dup with twodimensional arrays

2018-03-21 Thread berni via Digitalmars-d
I need code, that generates a copy of a twodimensional array. What I do is: auto tmp = new int[][](X,X); foreach (i; 0..X) tmp[i] = solution[i].dup; solutions ~= tmp; because solutions ~= solution.dup obviously doesn't work (the refs are copied, not the elements of the inner arrays). Is

Re: .dup with twodimensional arrays

2018-03-21 Thread Steven Schveighoffer via Digitalmars-d
On 3/21/18 5:59 AM, berni wrote: I need code, that generates a copy of a twodimensional array. What I do is: auto tmp = new int[][](X,X); foreach (i; 0..X) tmp[i] = solution[i].dup; solutions ~= tmp; because solutions ~= solution.dup obviously doesn't work (the refs are copied, not the

Re: D-dll support: testers needed round 2

2018-03-21 Thread evilrat via Digitalmars-d
On Friday, 9 February 2018 at 20:34:33 UTC, Benjamin Thaut wrote: My work on dll support for D continues. There is another iteration I need help testing with. Getting started tutorial: http://stuff.benjamin-thaut.de/D/getting_started.html A binary distribution is provided, see the tutorial

[Issue 18598] cyclic constructor calls have undefined behavior but are accepted in @safe code

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18598 --- Comment #3 from Walter Bright --- (In reply to ag0aep6g from comment #2) > Is that a problem for normal (non-constructor) functions as well? Yes. I'm open to advice on what to do about it. --

[Issue 18637] [scope][DIP1000] "copying & i into allocated memory escapes a reference to local variable i" where it's inappropriate

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18637 Walter Bright changed: What|Removed |Added CC|

Re: Is there a way to pipeline program with random-access ranges in C#?

2018-03-21 Thread Dukc via Digitalmars-d-learn
On Tuesday, 20 March 2018 at 15:57:16 UTC, Kagamin wrote: On Tuesday, 20 March 2018 at 15:06:14 UTC, Dukc wrote: Won't quite do it, because that would not iterate backwards. Linq has no chunking, so you would need to write it, maybe similar to SelectMany, but with the opposite meaning.

Re: #dbugfix 17592

2018-03-21 Thread bauss via Digitalmars-d
On Tuesday, 20 March 2018 at 21:27:53 UTC, 12345swordy wrote: This is very important to me as I am very interested in using the language for game development. Yes I know that it's marked as "Duplicated", but I strongly disagree as it is different enough to consider is own issue. Alex The

Re: #dbugfix 17592

2018-03-21 Thread Mike Franklin via Digitalmars-d
On Tuesday, 20 March 2018 at 21:27:53 UTC, 12345swordy wrote: This is very important to me as I am very interested in using the language for game development. Yes I know that it's marked as "Duplicated", but I strongly disagree as it is different enough to consider is own issue. Alex

Re: Draft Review DIP: Enum and Function Parameter Attributes

2018-03-21 Thread Mike Parker via Digitalmars-d-announce
On Wednesday, 21 March 2018 at 02:26:02 UTC, Meta wrote: Low hanging fruit: Thanks for the feedback, but Draft Review comments should go in the PR thread. I'll add a link over there to the post, but when you get a chance, it would help to paste your remarks into a comment there.

[Issue 15660] break immutable with pure function and mutable reference params

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15660 --- Comment #8 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/ab5a18635adaa3e2271e0f4b569500a89ac74235 fix Issue 15660 - break immutable with pure function and

[Issue 15660] break immutable with pure function and mutable reference params

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15660 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

Re: #dbugfix 17592

2018-03-21 Thread Mike Parker via Digitalmars-d
On Tuesday, 20 March 2018 at 21:27:53 UTC, 12345swordy wrote: This is very important to me as I am very interested in using the language for game development. Yes I know that it's marked as "Duplicated", but I strongly disagree as it is different enough to consider is own issue. Alex

[Issue 18644] [dip1000] escape of outer local not detected

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18644 --- Comment #2 from Walter Bright --- https://github.com/dlang/dmd/pull/8062 --

"mydll" sample from C:\D\dmd2\samples\d\mydll\ doesn't compile. DMD 2.079.0, Windows 7

2018-03-21 Thread Vitalii via Digitalmars-d
Hi everyone! I need sample to make 64-bit dll in D with C interface. I tried to use "mydll" sample in C:\D\dmd2\samples\d\mydll\, but it fails: -- C:\D\dmd2\samples\d\mydll>..\..\..\windows\bin\dmd -m64 -ofmydll.dll -L/IMPLIB mydll.d dll.d mydll.def LINK : fatal error LNK1146: no

Re: "mydll" sample from C:\D\dmd2\samples\d\mydll\ doesn't compile. DMD 2.079.0, Windows 7

2018-03-21 Thread Mike Parker via Digitalmars-d
On Wednesday, 21 March 2018 at 08:44:15 UTC, Mike Parker wrote: On Wednesday, 21 March 2018 at 08:30:54 UTC, Vitalii wrote: In earlier version 2.073.3 of DMD compiler 32-bit version of "mydll" builds successfully, but 64-bit get the same error messages as above. I use 64-bit path settings.

[Issue 18644] [dip1000] escape of outer local not detected

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18644 Walter Bright changed: What|Removed |Added Keywords||safe --

[Issue 18644] New: [dip1000] escape of outer local not detected

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18644 Issue ID: 18644 Summary: [dip1000] escape of outer local not detected Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal

[Issue 18644] [dip1000] escape of outer local not detected

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18644 --- Comment #3 from Walter Bright --- (In reply to Jonathan M Davis from comment #1) > int i; > int* foo() { return } should behave like: int* foo(int* p) { return p; } and then the error is detected:

Re: Is there a way to pipeline program with random-access ranges in C#?

2018-03-21 Thread Kagamin via Digitalmars-d-learn
On Wednesday, 21 March 2018 at 07:40:01 UTC, Dukc wrote: ...except that IEnumerables cannot popBack(), so can only do that by doing an additional copy and reversing that. But I quess there's no better alternative, short of doing it C-style... A random access range would be represented as

Re: "mydll" sample from C:\D\dmd2\samples\d\mydll\ doesn't compile. DMD 2.079.0, Windows 7

2018-03-21 Thread Mike Parker via Digitalmars-d
On Wednesday, 21 March 2018 at 08:30:54 UTC, Vitalii wrote: In earlier version 2.073.3 of DMD compiler 32-bit version of "mydll" builds successfully, but 64-bit get the same error messages as above. I use 64-bit path settings. DMD compiler version 2.079.0, Windows 7 Pro (6.1, build 7601:

Re: recursive template expansion: Why does this not compile?

2018-03-21 Thread ag0aep6g via Digitalmars-d-learn
On 03/21/2018 01:47 AM, Ontonator wrote: The following code does not compile: void main() {} class SuperClass {} class TemplatedClass(T : SuperClass) {} class A : SuperClass {     alias T = TemplatedClass!B; } class B : SuperClass {     alias T = TemplatedClass!C; } class C : SuperClass {}

[Issue 18444] [DIP25][DIP1000] Tracking issue for: "The implementation doesn't match DIPs 25/1000"

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18444 --- Comment #4 from Walter Bright --- (In reply to Carsten Blüggel from comment #3) > If it's of no special value for You, then it's worth to be/remain RESOLVED. > My vision is, phobos to be fully -dip1000 compilable before

[Issue 18643] New: Compiling error when combining CAS and numeric literal.

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18643 Issue ID: 18643 Summary: Compiling error when combining CAS and numeric literal. Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW

[Issue 18644] [dip1000] escape of outer local not detected

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18644 Jonathan M Davis changed: What|Removed |Added CC|

Manipulate slice or specific element of range and return range

2018-03-21 Thread Timoses via Digitalmars-d-learn
Hey, I'm struggling to find a way to achieve this. I've looked through std.algorithm but didn't find anything.. Maybe I'm blind. What I would like to do is filter out all spaces in a string and change the front letter to lower case: string m = "My Capital String"; string lower = m

Static Arrays: Behaviour of Passing & Returning

2018-03-21 Thread Quantum Nerd via Digitalmars-d-learn
Hello everybody, I am fairly new to the D language, and I've been trying to understand the behaviour of passing arrays to functions, especially also static arrays. There is an example that puzzles me: import std.stdio; double[3] sqr( double[3] v ) { double[3] r; writefln( "v (%20s) : %s",

Re: Manipulate slice or specific element of range and return range

2018-03-21 Thread Ali Çehreli via Digitalmars-d-learn
On 03/21/2018 04:30 AM, Timoses wrote: Hey, I'm struggling to find a way to achieve this. I've looked through std.algorithm but didn't find anything.. Maybe I'm blind. What I would like to do is filter out all spaces in a string and change the front letter to lower case:     string m =

D, Parasail, Pascal, and Rust vs The Steelman

2018-03-21 Thread Paulo Pinto via Digitalmars-d
An article comparing the above languages as per the DoD language requirements [0]. http://jedbarber.id.au/steelman.html [0] - https://en.wikipedia.org/wiki/Steelman_language_requirements

Re: D-dll support: testers needed round 2

2018-03-21 Thread Martin Nowak via Digitalmars-d
On Friday, 9 February 2018 at 20:34:33 UTC, Benjamin Thaut wrote: My work on dll support for D continues. There is another iteration I need help testing with. Getting started tutorial: http://stuff.benjamin-thaut.de/D/getting_started.html The DIP can again found be here:

Re: Slow start up time of runtime (correction: Windows real-time protection)

2018-03-21 Thread HeiHon via Digitalmars-d-learn
On Tuesday, 20 March 2018 at 16:56:59 UTC, Dennis wrote: On Tuesday, 20 March 2018 at 12:18:16 UTC, Adam D. Ruppe wrote: On Tuesday, 20 March 2018 at 09:44:41 UTC, Dennis wrote: This now leaves the question what's the best way to mitigate this, because I would gladly get rid of the second of

Re: Draft Review DIP: Enum and Function Parameter Attributes

2018-03-21 Thread Martin Tschierschke via Digitalmars-d-announce
On Wednesday, 21 March 2018 at 00:12:43 UTC, Mike Parker wrote: As it stands, this DIP [1] is currently the candidate to become DIP 1013. Any an all feedback for Draft Review is welcome. Please read the intent [2] behind the Draft Review before participating. Thanks! [1]

Re: Please vote for Dub integration into Sonatype Nexus

2018-03-21 Thread Andre Pany via Digitalmars-d
On Wednesday, 21 March 2018 at 09:37:15 UTC, Russel Winder wrote: On Tue, 2018-03-20 at 18:55 +, Dmitry Olshansky via Digitalmars-d wrote: On Tuesday, 20 March 2018 at 06:48:15 UTC, Andre Pany wrote: > Hi, > > if you have by chance a Sonatype account please vote for > this issue to get

Re: D-dll support: testers needed round 2

2018-03-21 Thread Martin Nowak via Digitalmars-d
On Saturday, 10 February 2018 at 02:24:58 UTC, rikki cattermole wrote: -import switch makes me a little concerned, what exactly is it changing that makes it required? I remember that we figured out that the MS Linker can optimize away the indirection when linking statically, so the paragraph

Re: Manipulate slice or specific element of range and return range

2018-03-21 Thread Simen Kjærås via Digitalmars-d-learn
On Wednesday, 21 March 2018 at 11:30:28 UTC, Timoses wrote: Hey, I'm struggling to find a way to achieve this. I've looked through std.algorithm but didn't find anything.. Maybe I'm blind. What I would like to do is filter out all spaces in a string and change the front letter to lower

Re: Static Arrays: Behaviour of Passing & Returning

2018-03-21 Thread Simen Kjærås via Digitalmars-d-learn
On Wednesday, 21 March 2018 at 12:01:01 UTC, Quantum Nerd wrote: How is it possible that b in main() and r in the function occupy the same memory? I would expect the same behaviour as with c. Can somebody with more experience shed some light on this? I'm pretty sure you're seeing NRVO -

Re: #dbugfix 17592

2018-03-21 Thread 12345swordy via Digitalmars-d
On Wednesday, 21 March 2018 at 11:13:41 UTC, Simen Kjærås wrote: On Wednesday, 21 March 2018 at 08:49:11 UTC, Mike Franklin wrote: I think `rt_finalize` can be made `@nogc` in the runtime. And this is where you're wrong. Consider this: class A { @nogc ~this() {} } class B : A {

Re: .dup with twodimensional arrays

2018-03-21 Thread Petar via Digitalmars-d
On Wednesday, 21 March 2018 at 09:59:52 UTC, berni wrote: I need code, that generates a copy of a twodimensional array. What I do is: auto tmp = new int[][](X,X); foreach (i; 0..X) tmp[i] = solution[i].dup; solutions ~= tmp; because solutions ~= solution.dup obviously doesn't work (the

[Issue 17906] Use of delete should be allowed without a deprecation in a deprecated scope

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17906 Seb changed: What|Removed |Added Keywords||pull --- Comment #5 from Seb

Re: -betterC is amazing, make (/keep making) it more sophisticated!

2018-03-21 Thread Walter Bright via Digitalmars-d
On 3/21/2018 3:48 PM, Seb wrote: I heard that Walter recently ported his DMC++ to D Yes, indeed: https://github.com/DigitalMars/Compiler I want to convert the back end to D, too, but am blocked by https://github.com/dlang/dmd/pull/7714 Seb, can you help with that?

[Issue 18634] std.container.rbtree does not work with delegate comparators

2018-03-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18634 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

Re: -betterC is amazing, make (/keep making) it more sophisticated!

2018-03-21 Thread jmh530 via Digitalmars-d
On Wednesday, 21 March 2018 at 22:48:36 UTC, Seb wrote: I heard that Walter recently ported his DMC++ to D and I heard that someone was working on this, so chances aren't too bad that this might happen ;-) You might check out Atila's github page (I don't think it's ready for release

  1   2   >