Re: Destructors vs. Finalizers

2017-07-26 Thread Mike Parker via Digitalmars-d
On Wednesday, 26 July 2017 at 09:29:15 UTC, Moritz Maxeiner wrote: As class destructors (in contrast to class finalizers) are then called exclusively in a deterministic fashion, there's no reason to forbid them from allocating using the GC, so I don't think using the @nogc attribute would be

Re: Update to Bare Metal STM32F4 (ARM Cortex-M4) LCD Demo Proof of Concept

2017-07-26 Thread Laeeth Isharc via Digitalmars-d-announce
On Thursday, 20 July 2017 at 12:23:31 UTC, Mike wrote: A few years ago I created a bare metal demo on an ARM Cortex-M4 microcontroller entirely in D. It was just a demonstration that one could do bare metal programming for microcontrollers in D without any dependencies on C or assembly. It

[Issue 17694] traits compiles fails for property of property

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17694 Steven Schveighoffer changed: What|Removed |Added Status|NEW |RESOLVED

Re: static foreach is now in github master

2017-07-26 Thread Laeeth Isharc via Digitalmars-d-announce
On Monday, 17 July 2017 at 18:14:35 UTC, Andrei Alexandrescu wrote: For those who want to play with our new static foreach feature and are willing to take the steps to building their own dmd, the feature is now merged in master: https://github.com/dlang/dmd/pull/6760 Happy hacking! Andrei

Re: Destructors vs. Finalizers

2017-07-26 Thread Steven Schveighoffer via Digitalmars-d
On 7/26/17 8:19 AM, Guillaume Piolat wrote: On Wednesday, 26 July 2017 at 02:58:00 UTC, Mike Parker wrote: When cleaning up, the GC will ensure that all destructors are run where they exist, followed by all finalizers. And destroy would be changed to call rt_destruct instead of rt_finalize.

Re: Destructors vs. Finalizers

2017-07-26 Thread Mike Parker via Digitalmars-d
On Wednesday, 26 July 2017 at 12:19:15 UTC, Guillaume Piolat wrote: I don't get the distinction between destructors and "finalizers" but imho the problem is very much that the GC is calling ~this. Destructors are deterministic, finalizers are not. At least, that's how I understand the

[Issue 17694] New: traits compiles fails for property of property

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17694 Issue ID: 17694 Summary: traits compiles fails for property of property Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal

Re: all OS functions should be "nothrow @trusted @nogc"

2017-07-26 Thread Steven Schveighoffer via Digitalmars-d
On 7/26/17 7:55 AM, Timon Gehr wrote: On 26.07.2017 13:22, Steven Schveighoffer wrote: On 7/26/17 6:01 AM, Timon Gehr wrote: On 26.07.2017 03:09, Steven Schveighoffer wrote: ... In other words, I think we can assume for any C functions that are passed pointers that dereference those

Re: Destructors vs. Finalizers

2017-07-26 Thread Guillaume Piolat via Digitalmars-d
On Wednesday, 26 July 2017 at 02:58:00 UTC, Mike Parker wrote: When cleaning up, the GC will ensure that all destructors are run where they exist, followed by all finalizers. And destroy would be changed to call rt_destruct instead of rt_finalize. Thoughts? I don't get the distinction

Re: all OS functions should be "nothrow @trusted @nogc"

2017-07-26 Thread Timon Gehr via Digitalmars-d
On 26.07.2017 13:22, Steven Schveighoffer wrote: On 7/26/17 6:01 AM, Timon Gehr wrote: On 26.07.2017 03:09, Steven Schveighoffer wrote: ... In other words, I think we can assume for any C functions that are passed pointers that dereference those pointers, passing null is safely going to

Bug in File.byRecord ?

2017-07-26 Thread closescreen via Digitalmars-d-learn
I have a file with empty lines: 2,3 and 5,6 filename.csv (with linenumbers for better view in this message) 1>Joe,Carpenter,30 2> 3> 4>Fred,Blacksmith,40 5> 6> Now, if I run: rdmd --eval='"filename.csv".File.byRecord!(string,string,int)("%s,%s,%d").writeln' It prints:

[Issue 16416] Phobos std.uni out of date (should be updated to latest Unicode standard)

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16416 Dmitry Olshansky changed: What|Removed |Added CC|

[Issue 17681] [Function setTimes] additional function touch(f)

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17681 Steven Schveighoffer changed: What|Removed |Added CC|

Re: all OS functions should be "nothrow @trusted @nogc"

2017-07-26 Thread Steven Schveighoffer via Digitalmars-d
On 7/26/17 6:01 AM, Timon Gehr wrote: On 26.07.2017 03:09, Steven Schveighoffer wrote: On 7/25/17 8:45 PM, Timon Gehr wrote: ... What Moritz is saying is that the following implementation of fclose is correct according to the C standard: int fclose(FILE *stream){ if(stream == NULL){

Re: all OS functions should be "nothrow @trusted @nogc"

2017-07-26 Thread Steven Schveighoffer via Digitalmars-d
On 7/26/17 3:05 AM, Shachar Shemesh wrote: On 25/07/17 18:26, Andrei Alexandrescu wrote: (btw void[] doesn't work) Can you expand on this point? Shachar Because anything casts to void[] implicitly. e.g.: void main() @safe { int *[] arr = new int*[5]; read(0, arr); // reading raw

[Issue 17692] Filtering a struct instance's .tupleof loses contained this reference

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17692 Vladimir Panteleev changed: What|Removed |Added Hardware|x86_64 |All

[Issue 17690] [REG2.066.0] scope guards leak declarations

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17690 Vladimir Panteleev changed: What|Removed |Added Keywords|

[Issue 17690] [REG2.066.0] scope guards leak declarations

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17690 Vladimir Panteleev changed: What|Removed |Added Summary|scope guards leak

[Issue 17689] finally clause leaks declarations

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17689 Vladimir Panteleev changed: What|Removed |Added Keywords|

[Issue 17686] [REG2.075.0] Covariant return types doesn't work with override in some cases

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17686 Vladimir Panteleev changed: What|Removed |Added Summary|[REG2.075] Covariant return

[Issue 17277] Member and aggregate alignment semantics

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17277 ki...@gmx.net changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Issue 17686] [REG2.075] Covariant return types doesn't work with override in some cases

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17686 --- Comment #3 from Vladimir Panteleev --- Please include the entire test case in the bug report itself. Here it is: interface INode { @property INode parentNode(); @property IDocument ownerDocument(); }

[Issue 17685] DMD 2.060 regression: align is not respected for structs

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17685 Vladimir Panteleev changed: What|Removed |Added Status|NEW

[Issue 17277] Member and aggregate alignment semantics

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17277 Vladimir Panteleev changed: What|Removed |Added CC|

Re: all OS functions should be "nothrow @trusted @nogc"

2017-07-26 Thread Timon Gehr via Digitalmars-d
On 26.07.2017 05:02, Walter Bright wrote: On 7/25/2017 5:56 PM, Andrei Alexandrescu wrote: I'd think that would be the case, but failed to find a fgetc implementation that mentions it's undefined for a null FILE*. Is there a link? Thx. -- Andrei The documentation for DMC++ fgetc() is:

Re: all OS functions should be "nothrow @trusted @nogc"

2017-07-26 Thread Timon Gehr via Digitalmars-d
On 26.07.2017 02:56, Andrei Alexandrescu wrote: What Moritz is saying is that the following implementation of fclose is correct according to the C standard: int fclose(FILE *stream){ if(stream == NULL){ return go_wild_and_corrupt_all_the_memory(); }else{ return

Re: all OS functions should be "nothrow @trusted @nogc"

2017-07-26 Thread Timon Gehr via Digitalmars-d
On 26.07.2017 03:09, Steven Schveighoffer wrote: On 7/25/17 8:45 PM, Timon Gehr wrote: ... What Moritz is saying is that the following implementation of fclose is correct according to the C standard: int fclose(FILE *stream){ if(stream == NULL){ return

[Issue 17684] [REG 2.062] `static alias this` bug or incomplete implementation?

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17684 Vladimir Panteleev changed: What|Removed |Added Summary|`static alias this` bug or |[REG

Re: Why structs and classes instanciations are made differently ?

2017-07-26 Thread Houdini via Digitalmars-d-learn
On Tuesday, 25 July 2017 at 17:16:00 UTC, Kagamin wrote: On Tuesday, 25 July 2017 at 15:56:45 UTC, Houdini wrote: Yes, but it isn't the default way in C++ to do dynamic instanciation. https://github.com/isocpp/CppCoreGuidelines this? It's only 2 years old. The new operator predates it by

[Issue 17683] __traits compiles does not work with package.d

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17683 Vladimir Panteleev changed: What|Removed |Added Status|NEW

[Issue 11847] Importing "package.d" module causes qualified name lookup to fail for sub modules

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11847 Vladimir Panteleev changed: What|Removed |Added CC|

Re: [your code here] Pure RPN calculator

2017-07-26 Thread Timon Gehr via Digitalmars-d
On 26.07.2017 11:45, Timon Gehr wrote: On 26.07.2017 04:37, Seb wrote: On Tuesday, 25 July 2017 at 21:13:54 UTC, Max Haughton wrote: Semi-Functional/pure RPN calculator: https://run.dlang.io/is/JGkBZx This is probably too long, but it demonstrates the compiler enforced safety and purity

Re: [your code here] Pure RPN calculator

2017-07-26 Thread Timon Gehr via Digitalmars-d
On 26.07.2017 04:37, Seb wrote: On Tuesday, 25 July 2017 at 21:13:54 UTC, Max Haughton wrote: Semi-Functional/pure RPN calculator: https://run.dlang.io/is/JGkBZx This is probably too long, but it demonstrates the compiler enforced safety and purity (State is passed through the fold), while

Re: [your code here] Pure RPN calculator

2017-07-26 Thread Timon Gehr via Digitalmars-d
On 26.07.2017 04:37, Seb wrote: On Tuesday, 25 July 2017 at 21:13:54 UTC, Max Haughton wrote: Semi-Functional/pure RPN calculator: https://run.dlang.io/is/JGkBZx This is probably too long, but it demonstrates the compiler enforced safety and purity (State is passed through the fold), while

[Issue 17681] [Function setTimes] additional function touch(f)

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17681 --- Comment #1 from Vladimir Panteleev --- The way to do this on Linux is to call utime(fileName, null). (In reply to Martin Tschierschke from comment #0) > The work around in the moment is to use execute("touch

[Issue 17686] [REG2.075] Covariant return types doesn't work with override in some cases

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17686 --- Comment #2 from Daniel Kozak --- introduced in this commit: https://github.com/dlang/dmd/commit/fb315d03f0744b8406d31b9c106d3a42c0c178b3 --

[Issue 17458] [std.regex] Assertion failure in package.d

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17458 --- Comment #4 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/7a51c0e24eea6c02336d2aa897c608974ea2ac57 Fix issue 17458 add messages to asserts

[Issue 17680] Broken ddmd source links in documentation

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17680 --- Comment #2 from Vladimir Panteleev --- https://github.com/dlang/dmd/pull/7030 Pretty please file separate issues for separate issues next time! --

Re: Destructors vs. Finalizers

2017-07-26 Thread Moritz Maxeiner via Digitalmars-d
On Wednesday, 26 July 2017 at 02:58:00 UTC, Mike Parker wrote: Regarding the issue with `destroy` not being @nogc, I my understanding is it comes down to `rt_finalize` not being @nogc. I haven't dug too deeply into the discussions around it, but I'm wondering if it's possible to separate the

[Issue 17680] Broken ddmd source links in documentation

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17680 Vladimir Panteleev changed: What|Removed |Added Hardware|x86_64 |All

[Issue 17680] Broken ddmd source links in documentation

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17680 Vladimir Panteleev changed: What|Removed |Added Keywords||pull

[Issue 17677] [REG 2.073.0] ICE when adding ulong to cfloat

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17677 Vladimir Panteleev changed: What|Removed |Added Keywords||ice

Re: scope pointers in @safe code

2017-07-26 Thread John Colvin via Digitalmars-d
On Wednesday, 26 July 2017 at 08:20:42 UTC, Shachar Shemesh wrote: void fn(scope int* var) @safe { (*var)++; } void fn2() @safe { int a; fn(); } The above program does not compile: d.d(8): Error: cannot take address of local a in @safe function fn2 I propose that the scope

Re: all OS functions should be "nothrow @trusted @nogc"

2017-07-26 Thread Moritz Maxeiner via Digitalmars-d
On Wednesday, 26 July 2017 at 06:44:51 UTC, Shachar Shemesh wrote: On 25/07/17 18:29, Moritz Maxeiner wrote: On Tuesday, 25 July 2017 at 14:39:15 UTC, Shachar Shemesh wrote: On 25/07/17 17:24, Moritz Maxeiner wrote: On Tuesday, 25 July 2017 at 13:50:16 UTC, Shachar Shemesh wrote: The title

[Issue 17693] std.json cannot parse dub.json package files

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17693 Vladimir Panteleev changed: What|Removed |Added Status|NEW

[Issue 17673] regex(["\\\\\\\\|\\\\\"", "\"|$"]) - wrong whichPattern

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17673 --- Comment #2 from Dmitry Olshansky --- (In reply to Dmitry Olshansky from comment #1) > https://github.com/dlang/phobos/pull/5660 Sorry wrong window. --

[Issue 17458] [std.regex] Assertion failure in package.d

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17458 --- Comment #3 from Dmitry Olshansky --- https://github.com/dlang/phobos/pull/5660 --

[Issue 17673] regex(["\\\\\\\\|\\\\\"", "\"|$"]) - wrong whichPattern

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17673 --- Comment #1 from Dmitry Olshansky --- https://github.com/dlang/phobos/pull/5660 --

[Issue 17693] New: std.json cannot parse dub.json package files

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17693 Issue ID: 17693 Summary: std.json cannot parse dub.json package files Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: trivial

[Issue 17458] [std.regex] Assertion failure in package.d

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17458 --- Comment #2 from Vladimir Panteleev --- The error message needs to be improved, then. "Assertion failure" is devoid of any information. See also: https://github.com/dlang/phobos/pull/5578 --

Re: all OS functions should be "nothrow @trusted @nogc"

2017-07-26 Thread Moritz Maxeiner via Digitalmars-d
On Wednesday, 26 July 2017 at 00:35:13 UTC, Steven Schveighoffer wrote: On 7/25/17 5:23 PM, Moritz Maxeiner wrote: On Tuesday, 25 July 2017 at 20:16:41 UTC, Steven Schveighoffer wrote: The behavior is defined. It will crash with a segfault. In C land that behaviour is a platform

[Issue 17458] [std.regex] Assertion failure in package.d

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17458 --- Comment #1 from Dmitry Olshansky --- Not a bug - there is no match, before calling matches.hit one must check it for !matches.empty. --

[Issue 17066] [REG2.073a] std.regex captures got immutable

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17066 Dmitry Olshansky changed: What|Removed |Added Status|REOPENED|RESOLVED

[Issue 17673] regex(["\\\\\\\\|\\\\\"", "\"|$"]) - wrong whichPattern

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17673 Dmitry Olshansky changed: What|Removed |Added Assignee|nob...@puremagic.com

[Issue 17668] regex(q"<[^]>")

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17668 --- Comment #1 from Dmitry Olshansky --- https://github.com/dlang/phobos/pull/5657 --

scope pointers in @safe code

2017-07-26 Thread Shachar Shemesh via Digitalmars-d
void fn(scope int* var) @safe { (*var)++; } void fn2() @safe { int a; fn(); } The above program does not compile: d.d(8): Error: cannot take address of local a in @safe function fn2 I propose that the scope keyword be activated to mean "I do not pass the pointer you gave me out

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 2 Begins

2017-07-26 Thread Olivier FAURE via Digitalmars-d
On Tuesday, 25 July 2017 at 09:53:02 UTC, Mike Parker wrote: On Tuesday, 25 July 2017 at 07:58:13 UTC, Olivier FAURE wrote: I feel like making a list of alternative proposals and why they were rejected would still be a good idea, both to improve the quality of the debate in this thread (people

Re: Crypto.lib and ssl.lib for Win32

2017-07-26 Thread MGW via Digitalmars-d-learn
On Tuesday, 25 July 2017 at 21:51:39 UTC, Adam D. Ruppe wrote: On Tuesday, 25 July 2017 at 12:11:08 UTC, MGW wrote: Where can I find the ready made for usage or how to create cryptro.lib and ssl.lib for Windows 32 that are necessary for my project? Do you have the crypto.dll and ssl.dll? If

Re: How to make autocompletion for IDE?

2017-07-26 Thread Andrea Fontana via Digitalmars-d-learn
On Tuesday, 25 July 2017 at 10:45:38 UTC, unDEFER wrote: On Tuesday, 25 July 2017 at 10:35:14 UTC, Andrea Fontana wrote: If you want to add UFCS suggestions to DCD it would be useful for your project and all other IDEs too! Andrea Thank you, I will think. But if it was easy, authors self

Redox + D

2017-07-26 Thread Suliman via Digitalmars-d
I think most of people have heard about https://redox-os.org It is pretty modern micro-kernel OS written in Rust. I am not Rust fan, but if it solve some low-level task and allow to build on top of it more hight-level tools why not to use it? Now it have port of GCC, Python and some other

Re: all OS functions should be "nothrow @trusted @nogc"

2017-07-26 Thread Shachar Shemesh via Digitalmars-d
On 25/07/17 18:26, Andrei Alexandrescu wrote: (btw void[] doesn't work) Can you expand on this point? Shachar

Re: Is there a way to use x86 and x86_mscoff with dub simultaneously.

2017-07-26 Thread Jacob Carlborg via Digitalmars-d
On 2017-07-26 00:41, Sönke Ludwig wrote: What you can do is to create a configuration that only works for x86_64: name "myproject" configuration "library" { platforms "x86_64" targetType "library" // ... } This will cause the configuration resolution

[Issue 15432] Win64: bad code offset in debug line number info

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15432 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 15432] Win64: bad code offset in debug line number info

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15432 --- Comment #6 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/399b12d8d6feaf43ced88c2559404f29ab70c496 fix issue 15432: Win64: bad code offset in debug line number

Re: Cast to subclass in the dmd compiler

2017-07-26 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-07-25 23:06, unDEFER wrote: I have found the answer in the code. Right code is: Import imp = m.isImport(); if (imp !is null) Thank you. That's the correct solution. For Expression, there's a field called "op" that indicates what kind of expression it is, which can used in

Re: Get UDA of unit tests during Runtime.moduleUnitTester

2017-07-26 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-07-26 05:27, Matthew Remmel wrote: So as mentioned above, the first problem is that using ModuleInfo.unitTest returns an aggregated function of all 3 unit tests for that module, instead of each one individually, so the UDA information is lost. The second problem is that running

Re: all OS functions should be "nothrow @trusted @nogc"

2017-07-26 Thread Shachar Shemesh via Digitalmars-d
On 25/07/17 18:29, Moritz Maxeiner wrote: On Tuesday, 25 July 2017 at 14:39:15 UTC, Shachar Shemesh wrote: On 25/07/17 17:24, Moritz Maxeiner wrote: On Tuesday, 25 July 2017 at 13:50:16 UTC, Shachar Shemesh wrote: The title really does says it all. Since you explicitly state *all* OS

Re: D easily overlooked?

2017-07-26 Thread Bienlein via Digitalmars-d
When looking at other language ranking sites, D always scores better then Rust. Yet, Rust gets included in the ranking but D is ... nowhere to be seen. Well, on the Tiobe index D is currently on place 23 way ahead of Lua, Scala, Rust, Kotlin, Groovy. So there is obviously asomething wrong

[Issue 17692] New: Filtering a struct instance's .tupleof loses contained this reference

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17692 Issue ID: 17692 Summary: Filtering a struct instance's .tupleof loses contained this reference Product: D Version: D2 Hardware: x86_64 OS: Linux

<    1   2