Re: DIP 1009 (Add Expression-Based Contract Syntax) Accepted

2018-04-10 Thread Jonathan M Davis via Digitalmars-d-announce
On Wednesday, April 11, 2018 05:23:58 really? via Digitalmars-d-announce wrote: > On Friday, 6 April 2018 at 17:36:20 UTC, H. S. Teoh wrote: > > Yeah, I think having expression syntax will make contracts more > > readable. We'll just have to see. > > Sorry, but I fail to see how (1) is more

Re: DIP 1009 (Add Expression-Based Contract Syntax) Accepted

2018-04-10 Thread really? via Digitalmars-d-announce
On Friday, 6 April 2018 at 17:36:20 UTC, H. S. Teoh wrote: Yeah, I think having expression syntax will make contracts more readable. We'll just have to see. Sorry, but I fail to see how (1) is more readable than (2) (1) in(s.length > 0, "s must not be empty") (2) in { assert(s.length >

Re: Parse .eml files

2018-04-10 Thread bachmeier via Digitalmars-d-learn
On Monday, 9 April 2018 at 19:17:20 UTC, Adam D. Ruppe wrote: [...] I had a chance to try this out and it worked without a problem. I did have to download color.d in addition to the other dependencies you listed. In the event that Google brings someone here, this is a complete working

Re: d2sqlite3 db.run, where lies the bug?

2018-04-10 Thread Ralph Amissah via Digitalmars-d
ag0aep6g, thank you most of all for fixing the bug, the removal of my immediate frustration! Also for the thorough step-wise instruction on sleuthing and fixing it. > > If you want, you can make a bug report or a pull request with the fix. > Otherwise, if you're not up to that, I can make one. >

Re: Strange Thread Causing Duplicating `writeln`

2018-04-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/9/18 6:56 PM, Jonathan wrote: On Monday, 9 April 2018 at 22:53:31 UTC, Jonathan wrote: On Monday, 9 April 2018 at 22:49:07 UTC, Cym13 wrote: I don't know, but I can't reproduce either with dmd or ldc. What was your compilation line? dmd -run file.d I am on Window 10 btw. It's a

Re: Should "a is b" compile if a and b have unrelated classes?

2018-04-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/10/18 5:52 PM, Michael Coulombe wrote: I had a bug in my code that was messing me up for a while, and it boiled down to an identity check between two Object references with unrelated static types, like below: class A {} class B {} void main() {     A a = new A;     B b = new B;     if

Re: #include C headers in D code

2018-04-10 Thread Atila Neves via Digitalmars-d-announce
On Tuesday, 10 April 2018 at 20:32:05 UTC, Seb wrote: On Tuesday, 10 April 2018 at 16:51:57 UTC, Atila Neves wrote: If you get to the point where you can #include , it will be doubly impressive! Not *if*, *when*. ;) Atila FYI people have been fighting with this for a long time:

Re: Range length property

2018-04-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/10/18 6:07 PM, Cym13 wrote: On Tuesday, 10 April 2018 at 20:08:14 UTC, Jonathan M Davis wrote: On Tuesday, April 10, 2018 19:47:10 Nordlöw via Digitalmars-d-learn wrote: On Tuesday, 10 April 2018 at 14:34:40 UTC, Adam D. Ruppe wrote: > On Tuesday, 10 April 2018 at 14:25:52 UTC, Nordlöw

Re: Range length property

2018-04-10 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Apr 10, 2018 at 10:07:40PM +, Cym13 via Digitalmars-d-learn wrote: [...] > On the other hand I don't think the end user should have to scratch > his head to find the length of a range, especially if it's not trivial > to get (say, O(log n) kind of case). Therefore exposing a method in

Re: Should "a is b" compile if a and b have unrelated classes?

2018-04-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, April 10, 2018 21:52:22 Michael Coulombe via Digitalmars-d-learn wrote: > I had a bug in my code that was messing me up for a while, and it > boiled down to an identity check between two Object references > with unrelated static types, like below: > > class A {} > class B {} > void

Re: Range length property

2018-04-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, April 10, 2018 22:07:40 Cym13 via Digitalmars-d-learn wrote: > On Tuesday, 10 April 2018 at 20:08:14 UTC, Jonathan M Davis wrote: > > On Tuesday, April 10, 2018 19:47:10 Nordlöw via > > > > Digitalmars-d-learn wrote: > >> On Tuesday, 10 April 2018 at 14:34:40 UTC, Adam D. Ruppe wrote:

Re: Range length property

2018-04-10 Thread Cym13 via Digitalmars-d-learn
On Tuesday, 10 April 2018 at 20:08:14 UTC, Jonathan M Davis wrote: On Tuesday, April 10, 2018 19:47:10 Nordlöw via Digitalmars-d-learn wrote: On Tuesday, 10 April 2018 at 14:34:40 UTC, Adam D. Ruppe wrote: > On Tuesday, 10 April 2018 at 14:25:52 UTC, Nordlöw wrote: >> Should ranges always

Should "a is b" compile if a and b have unrelated classes?

2018-04-10 Thread Michael Coulombe via Digitalmars-d-learn
I had a bug in my code that was messing me up for a while, and it boiled down to an identity check between two Object references with unrelated static types, like below: class A {} class B {} void main() { A a = new A; B b = new B; if (a is b) {} // compiles } I was surprised that

Re: Range length property

2018-04-10 Thread Per Nordlöw via Digitalmars-d-learn
On Tuesday, 10 April 2018 at 20:16:18 UTC, Steven Schveighoffer wrote: e.g. std.array.array is going to pre-allocate an array of the correct length and fill it in, vs. appending each element as it gets them from the range. Personally, I would store the length because typically a container

Re: #include C headers in D code

2018-04-10 Thread David Nadlinger via Digitalmars-d-announce
On Tuesday, 10 April 2018 at 20:32:05 UTC, Seb wrote: On Tuesday, 10 April 2018 at 16:51:57 UTC, Atila Neves wrote: If you get to the point where you can #include , it will be doubly impressive! Not *if*, *when*. ;) Atila FYI people have been fighting with this for a long time:

Re: code-d 0.17.0 + serve-d 0.1.2

2018-04-10 Thread greatsam4sure via Digitalmars-d-announce
On Tuesday, 10 April 2018 at 03:37:59 UTC, evilrat wrote: On Monday, 9 April 2018 at 19:10:46 UTC, Samson wrote: [...] Disable "normal" code-d, close VS, remove %appdata%/code-d, launch VS & enable code-d beta serve-d, enjoy. [...] Thanks, your suggestion work for me. Many thanks to you

Re: code-d 0.17.0 + serve-d 0.1.2

2018-04-10 Thread greatsam4sure via Digitalmars-d-announce
On Tuesday, 10 April 2018 at 03:37:59 UTC, evilrat wrote: On Monday, 9 April 2018 at 19:10:46 UTC, Samson wrote: [...] Disable "normal" code-d, close VS, remove %appdata%/code-d, launch VS & enable code-d beta serve-d, enjoy. [...] Thanks your suggestion work for me. many thanks to you

[Issue 18693] std.math.rndtonl and core.math.rndtonl result in link errors

2018-04-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18693 --- Comment #1 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/b4f675fe150afaa577d6a41d6013ca33d932bd57 Work On Issue 18693 - Remove rndtonl from std.math

Re: #include C headers in D code

2018-04-10 Thread Seb via Digitalmars-d-announce
On Tuesday, 10 April 2018 at 16:51:57 UTC, Atila Neves wrote: If you get to the point where you can #include , it will be doubly impressive! Not *if*, *when*. ;) Atila FYI people have been fighting with this for a long time: https://github.com/dlang/druntime/pull/1316

[Issue 18754] New: Type sequence instantiation missing from language specification

2018-04-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18754 Issue ID: 18754 Summary: Type sequence instantiation missing from language specification Product: D Version: D2 Hardware: All OS: All Status: NEW

Re: Range length property

2018-04-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/10/18 4:08 PM, Jonathan M Davis wrote: On Tuesday, April 10, 2018 19:47:10 Nordlöw via Digitalmars-d-learn wrote: I'm thinking of my own container Hashmap having its range ByKeyValue requiring one extra word of memory to store the iteration count which, in turn, can be used to calculate

Re: d2sqlite3 db.run, where lies the bug?

2018-04-10 Thread ag0aep6g via Digitalmars-d
On 04/10/2018 08:04 PM, Ralph Amissah wrote: The exact location of problem may be provided in the error statement "core.exception.UnicodeException@src/rt/util/utf.d(292): invalid UTF-8 sequence". [...] Mock problem string with test code follows (d2sqlite3 required): [... code ...] A more

Re: Range length property

2018-04-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, April 10, 2018 19:47:10 Nordlöw via Digitalmars-d-learn wrote: > On Tuesday, 10 April 2018 at 14:34:40 UTC, Adam D. Ruppe wrote: > > On Tuesday, 10 April 2018 at 14:25:52 UTC, Nordlöw wrote: > >> Should ranges always provide a length property? > > > > No. > > > >> If so, in which cases

Re: #include C headers in D code

2018-04-10 Thread Atila Neves via Digitalmars-d-announce
On Tuesday, 10 April 2018 at 19:28:09 UTC, Steven Schveighoffer wrote: On 4/10/18 2:36 PM, Atila Neves wrote: Haha, I remember. I do plan on dealing with emplace_back, but I have no idea how just yet and I was hoping nobody was going to call me on it until then. Busted! :P I think we

Re: Range length property

2018-04-10 Thread Nordlöw via Digitalmars-d-learn
On Tuesday, 10 April 2018 at 14:34:40 UTC, Adam D. Ruppe wrote: On Tuesday, 10 April 2018 at 14:25:52 UTC, Nordlöw wrote: Should ranges always provide a length property? No. If so, in which cases is a length property an advantage or a requirement? Just provide it whenever it is cheap to

Re: Destructor call

2018-04-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/10/18 3:24 PM, Jonathan M Davis wrote: On Tuesday, April 10, 2018 18:52:19 kinke via Digitalmars-d-learn wrote: On Tuesday, 10 April 2018 at 18:34:54 UTC, n0fun wrote: Why the destructor is called in the second case and why not in the first? The first case is RAII, where destruction

[Issue 18698] static foreach + __traits(allMembers, moduleName)

2018-04-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18698 --- Comment #16 from Manu --- I remember my work-around; I ran the foreach inside a static module constructor! >From there I generated my reflection information about the module and registered it at runtime (in the module

Re: #include C headers in D code

2018-04-10 Thread Steven Schveighoffer via Digitalmars-d-announce
On 4/10/18 2:36 PM, Atila Neves wrote: Haha, I remember. I do plan on dealing with emplace_back, but I have no idea how just yet and I was hoping nobody was going to call me on it until then. Busted! :P I think we all agree you aren't going to instantiate C++ templates in D (and who

Re: Destructor call

2018-04-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, April 10, 2018 18:52:19 kinke via Digitalmars-d-learn wrote: > On Tuesday, 10 April 2018 at 18:34:54 UTC, n0fun wrote: > > Why the destructor is called in the second case and why not in > > the first? > > The first case is RAII, where destruction isn't done for not > fully constructed

Re: Destructor call

2018-04-10 Thread kinke via Digitalmars-d-learn
On Tuesday, 10 April 2018 at 18:34:54 UTC, n0fun wrote: Why the destructor is called in the second case and why not in the first? The first case is RAII, where destruction isn't done for not fully constructed instances. The second case is GC finalization at program shutdown and looks like a

[Issue 11997] rdmd should search its binary path for the compiler

2018-04-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11997 --- Comment #6 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/dlang/tools https://github.com/dlang/tools/commit/2e516ab51a5d1c0329312aa56960281c95e57a33 rdmd: Append binExt to the compiler path to check from the

Re: #include C headers in D code

2018-04-10 Thread Atila Neves via Digitalmars-d-announce
On Tuesday, 10 April 2018 at 18:01:37 UTC, Steven Schveighoffer wrote: On 4/10/18 12:51 PM, Atila Neves wrote: On Tuesday, 10 April 2018 at 13:53:34 UTC, Steven Schveighoffer wrote: If you get to the point where you can #include , it will be doubly impressive! Not *if*, *when*. ;) I hope

Re: Migrating an existing more modern GC to D's gc.d

2018-04-10 Thread Jacob Carlborg via Digitalmars-d
On 2018-04-10 08:47, Jonathan M Davis wrote: Regardless, I think that it's clear that in order to do anything with thread-local pools, we'd have to lock down the type system even further to disallow casts to or from shared or immutable, and that would really be a big problem given the inherent

Destructor call

2018-04-10 Thread n0fun via Digitalmars-d-learn
import std.stdio; struct S(alias n) { this(int) { throw new Exception("Exception"); } ~this() { writeln("destructor " ~ n); } } void main() { writeln("--- 1 ---"); try { auto s = S!"1"(0); } catch (Exception) {} writeln("--- 2 ---");

Re: What are AST Macros?

2018-04-10 Thread Jacob Carlborg via Digitalmars-d
On 2018-04-09 18:39, Cym13 wrote: On Monday, 9 April 2018 at 15:30:33 UTC, Stefan Koch wrote: On Friday, 6 April 2018 at 21:45:45 UTC, Zach Tollen wrote: I think Walter's reason was that such macros would hide too many idiosyncrasies in how they were programmed, such that a lot of code

Re: #include C headers in D code

2018-04-10 Thread Steven Schveighoffer via Digitalmars-d-announce
On 4/10/18 12:51 PM, Atila Neves wrote: On Tuesday, 10 April 2018 at 13:53:34 UTC, Steven Schveighoffer wrote: If you get to the point where you can #include , it will be doubly impressive! Not *if*, *when*. ;) I hope you are right, but I remain skeptical :) If I may throw a curveball

d2sqlite3 db.run, where lies the bug?

2018-04-10 Thread Ralph Amissah via Digitalmars-d
/+ Not sure where to report this, nor of where the bug lies. I hope SQLite (and d2sqlite3) is used widely enough for this to be of interest here. I have sets of document files that are broken up and placed (inserted) into an sqlite3 db, some of which fail with what is to me an inexplicable utf-8

Re: Is std.variant.visit not @nogc?

2018-04-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/10/18 12:59 PM, Paul Backus wrote: On Tuesday, 10 April 2018 at 12:34:07 UTC, aliak wrote: Awesome! this is a neat trick: union {   AliasSeq!(T0, T1) values; } Is that usage documented somewhere, or is it somewhere in phobos maybe? Also, can Algebraic be fully replaced with this

Re: Range length property

2018-04-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, April 10, 2018 14:25:52 Nordlöw via Digitalmars-d-learn wrote: > Should ranges always provide a length property? > > If so, in which cases is a length property an advantage or a > requirement? Whether a range has a length property or not is primarily dependent on how efficient it is

Re: code-d 0.17.0 + serve-d 0.1.2

2018-04-10 Thread Johannes Loher via Digitalmars-d-announce
Am 10.04.2018 um 14:27 schrieb WebFreak001: > On Monday, 9 April 2018 at 21:45:57 UTC, Johannes Loher wrote: >> Am 04.04.2018 um 20:34 schrieb greatsam4sure: >>> [...] >> I just tried to get this to work, too, but I was not able to get it to >> work correctly. It seems that running dub fails

[Issue 18737] An assert(0) should be a leaf in constructor flow analysis

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

[Issue 18737] An assert(0) should be a leaf in constructor flow analysis

2018-04-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18737 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/88f48d698e19da62c0246e7f74e60477a4804ee6 fix Issue 18737 - An assert(0) should be a leaf in

Re: Is std.variant.visit not @nogc?

2018-04-10 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 10 April 2018 at 12:34:07 UTC, aliak wrote: Awesome! this is a neat trick: union { AliasSeq!(T0, T1) values; } Is that usage documented somewhere, or is it somewhere in phobos maybe? Also, can Algebraic be fully replaced with this version then or is there some functionality

Re: #include C headers in D code

2018-04-10 Thread Atila Neves via Digitalmars-d-announce
On Tuesday, 10 April 2018 at 13:53:34 UTC, Steven Schveighoffer wrote: On 4/9/18 7:03 AM, Atila Neves wrote: [...] Awesome. Can't say I will use it, as I don't use C much, but I understand how difficult a task this is. Thanks! If you get to the point where you can #include , it will be

[Issue 17991] ICE with imports without module

2018-04-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17991 --- Comment #3 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/bed9bf405d1e743e8a594185cd9f40f1b2db92ad Fix Issue 17991 - ICE with imports without module

[Issue 18753] chunkBy compile error causes ICE

2018-04-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18753 hst...@quickfur.ath.cx changed: What|Removed |Added Keywords||ice --

[Issue 18753] chunkBy compile error causes ICE

2018-04-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18753 hst...@quickfur.ath.cx changed: What|Removed |Added See Also||https://issues.dlang.org/sh

[Issue 14909] Template argument of std.algoirthm.iteration.chunkBy cannot access a local variable

2018-04-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14909 hst...@quickfur.ath.cx changed: What|Removed |Added See Also||https://issues.dlang.org/sh

[Issue 18753] chunkBy compile error causes ICE

2018-04-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18753 hst...@quickfur.ath.cx changed: What|Removed |Added See Also||https://issues.dlang.org/sh

[Issue 18753] New: chunkBy compile error causes ICE

2018-04-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18753 Issue ID: 18753 Summary: chunkBy compile error causes ICE Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: critical Priority:

[Issue 18751] chunkBy predicate cannot access local variable

2018-04-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18751 hst...@quickfur.ath.cx changed: What|Removed |Added See Also||https://issues.dlang.org/sh

Re: stirling numbers and multidimensional arrays

2018-04-10 Thread popgen via Digitalmars-d-learn
On Sunday, 8 April 2018 at 16:51:14 UTC, ag0aep6g wrote: On 04/08/2018 06:15 PM, popgen wrote: [...] [...] [...] [...] [...] Should it be `q <= k` here? You're using q as an index into an array of length k + 1. If you go up to i, you'll exceed that and go out of bounds. That you're

[Issue 18742] std.regex: Using CodePointSet in AAs breaks if reference count changes

2018-04-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18742 Jack Stouffer changed: What|Removed |Added Blocks||17206 Referenced

[Issue 17206] [Tracking] Check that opEquals and toHash are both defined or neither are defined

2018-04-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17206 Jack Stouffer changed: What|Removed |Added Depends on||18742 Referenced

trouble building dlang.org

2018-04-10 Thread Zach Tollen via Digitalmars-d-learn
I'm trying to update the language spec. I have the standard dmd installed on my Mac in `~/dlang/dmd` using the install script from the website "curl -fsS https://dlang.org/install.sh | bash -s dmd". Okay, good, done. Now, according to: dlang.org/CONTRIBUTING.md: "git clone

Re: DUB: Only fetch and cache packages in dub.json without running build

2018-04-10 Thread John Colvin via Digitalmars-d
On Tuesday, 10 April 2018 at 13:50:38 UTC, Clinton wrote: Hi all, I'm setting up a CircleCI config for my project. Right now I'm trying to cache dependencies before running builds. This way I can run "dub build --nodeps" immediately after the packages are cached to avoid extra network calls

Re: DUB: Only fetch and cache packages in dub.json without running build

2018-04-10 Thread John Colvin via Digitalmars-d
On Tuesday, 10 April 2018 at 15:31:41 UTC, John Colvin wrote: On Tuesday, 10 April 2018 at 13:50:38 UTC, Clinton wrote: Hi all, I'm setting up a CircleCI config for my project. Right now I'm trying to cache dependencies before running builds. This way I can run "dub build --nodeps"

Re: DUB: Only fetch and cache packages in dub.json without running build

2018-04-10 Thread Sönke Ludwig via Digitalmars-d
Am 10.04.2018 um 15:50 schrieb Clinton: Hi all, I'm setting up a CircleCI config for my project. Right now I'm trying to cache dependencies before running builds. This way I can run "dub build --nodeps" immediately after the packages are cached to avoid extra network calls and speed it up.

Re: Homebrew dmd betas

2018-04-10 Thread David Gileadi via Digitalmars-d-announce
On 4/10/18 1:46 AM, John Colvin wrote: On Saturday, 7 April 2018 at 18:39:12 UTC, Martin Nowak wrote: First beta for the 2.079.1 patch release. Comes with a handful of fixes. http://dlang.org/download.html#dmd_beta http://dlang.org/changelog/2.079.1.html Please report any bugs at

Re: SMTP Mail

2018-04-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 10 April 2018 at 15:10:44 UTC, Vino wrote: The variable "to" is of type string[] but we need it as Array!string The variable "Subject" but we need it as Array!string. You'll have to convert them yourself if that is a must, but why would you need that?

Re: SMTP Mail

2018-04-10 Thread Vino via Digitalmars-d-learn
On Tuesday, 10 April 2018 at 13:51:02 UTC, Adam D. Ruppe wrote: On Tuesday, 10 April 2018 at 11:09:56 UTC, Vino wrote: Now the program works, but the attachment does not work as expected, message.addAttachment("text/plain", "C:\\Temp\\Test\Test1.txt", "Test"); What did you expect that

Re: DUB: Only fetch and cache packages in dub.json without running build

2018-04-10 Thread Andre Pany via Digitalmars-d
On Tuesday, 10 April 2018 at 13:50:38 UTC, Clinton wrote: Hi all, I'm setting up a CircleCI config for my project. Right now I'm trying to cache dependencies before running builds. This way I can run "dub build --nodeps" immediately after the packages are cached to avoid extra network calls

Re: Range length property

2018-04-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 10 April 2018 at 14:25:52 UTC, Nordlöw wrote: Should ranges always provide a length property? No. If so, in which cases is a length property an advantage or a requirement? Just provide it whenever it is cheap to do so. If you need to do complex calculations or especially loop

Range length property

2018-04-10 Thread Nordlöw via Digitalmars-d-learn
Should ranges always provide a length property? If so, in which cases is a length property an advantage or a requirement?

Re: DUB: Only fetch and cache packages in dub.json without running build

2018-04-10 Thread Clinton via Digitalmars-d
On Tuesday, 10 April 2018 at 13:50:38 UTC, Clinton wrote: Hi all, I'm setting up a CircleCI config for my project. Right now I'm trying to cache dependencies before running builds. This way I can run "dub build --nodeps" immediately after the packages are cached to avoid extra network calls

Re: Thoughts on Herb Sutter's Metaclasses?

2018-04-10 Thread jmh530 via Digitalmars-d
On Tuesday, 10 April 2018 at 09:32:49 UTC, Chris Katko wrote: Wow, that thread had very little discussion, and a huge amount of bickering over whether someone actually understood what someone else might have said. My take-away was that it can be done in D, but would be simpler with AST

Re: code-d 0.17.0 + serve-d 0.1.2

2018-04-10 Thread WebFreak001 via Digitalmars-d-announce
On Tuesday, 10 April 2018 at 13:11:16 UTC, evilrat wrote: On Tuesday, 10 April 2018 at 11:54:47 UTC, WebFreak001 wrote: fyi "deprecated" code-d beta and normal code-d is exactly the same plugin right now using exactly the same serve-d versions, except for the deprecation message. I

Re: How to destruct class instances allocated by a Region-allocator over a single GC block

2018-04-10 Thread rikki cattermole via Digitalmars-d-learn
On 11/04/2018 1:56 AM, Eduard Staniloiu wrote: On Monday, 9 April 2018 at 14:51:24 UTC, Per Nordlöw wrote: On Monday, 9 April 2018 at 13:51:47 UTC, Steven Schveighoffer wrote: Well, you know the type, because make returned it no? The contract is, you call obj = make!X(args), then you have to

Re: How to destruct class instances allocated by a Region-allocator over a single GC block

2018-04-10 Thread Eduard Staniloiu via Digitalmars-d-learn
On Monday, 9 April 2018 at 14:51:24 UTC, Per Nordlöw wrote: On Monday, 9 April 2018 at 13:51:47 UTC, Steven Schveighoffer wrote: Well, you know the type, because make returned it no? The contract is, you call obj = make!X(args), then you have to call dispose(obj), where obj is of the type X.

Re: DUB: Only fetch and cache packages in dub.json without running build

2018-04-10 Thread rikki cattermole via Digitalmars-d
On 11/04/2018 1:50 AM, Clinton wrote: Hi all, I'm setting up a CircleCI config for my project. Right now I'm trying to cache dependencies before running builds. This way I can run "dub build --nodeps" immediately after the packages are cached to avoid extra network calls and speed it up.

Re: #include C headers in D code

2018-04-10 Thread Steven Schveighoffer via Digitalmars-d-announce
On 4/9/18 7:03 AM, Atila Neves wrote: Here's my blog post about my project that allows directly #including C headers in D* https://atilanevesoncode.wordpress.com/2018/04/09/include-c-headers-in-d-code/ The summary is that, modulo bugs, things like this work:     #include     void

Re: SMTP Mail

2018-04-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 10 April 2018 at 11:09:56 UTC, Vino wrote: Now the program works, but the attachment does not work as expected, message.addAttachment("text/plain", "C:\\Temp\\Test\Test1.txt", "Test"); What did you expect that "Test" argument to do if it was going to read the file as the

DUB: Only fetch and cache packages in dub.json without running build

2018-04-10 Thread Clinton via Digitalmars-d
Hi all, I'm setting up a CircleCI config for my project. Right now I'm trying to cache dependencies before running builds. This way I can run "dub build --nodeps" immediately after the packages are cached to avoid extra network calls and speed it up. I'm wondering if there's a way to

[Issue 18584] Undefined identifier when not specifying 'this'

2018-04-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18584 RazvanN changed: What|Removed |Added CC|

Re: code-d 0.17.0 + serve-d 0.1.2

2018-04-10 Thread evilrat via Digitalmars-d-announce
On Tuesday, 10 April 2018 at 11:54:47 UTC, WebFreak001 wrote: fyi "deprecated" code-d beta and normal code-d is exactly the same plugin right now using exactly the same serve-d versions, except for the deprecation message. I wouldn't be complaining if it's not the case. With normal code-d

Re: Thoughts on Herb Sutter's Metaclasses?

2018-04-10 Thread 12345swordy via Digitalmars-d
On Tuesday, 10 April 2018 at 09:32:49 UTC, Chris Katko wrote: On Tuesday, 10 April 2018 at 05:55:06 UTC, Joakim wrote: On Tuesday, 10 April 2018 at 01:21:07 UTC, Chris Katko wrote: [...] See previous forum thread on the topic, with Walter chiming in a bit too:

[Issue 18734] bitnum parameter of core.bitop.bt should be signed

2018-04-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18734 --- Comment #2 from ag0aep6g --- (In reply to uplink.coder from comment #1) > DMD does not recognize bodies only function signatures. > So change it all you like :) it's only going to be used on systems where the > intrinsic

Re: Space before parens in all function definitions

2018-04-10 Thread Andrei Alexandrescu via Digitalmars-d
On 04/09/2018 02:50 PM, Seb wrote: On Monday, 9 April 2018 at 16:22:15 UTC, Andrei Alexandrescu wrote: On 04/07/2018 07:01 AM, Sönke Ludwig wrote: Am 07.04.2018 um 04:23 schrieb Andrei Alexandrescu: Why is there a space before "(" in our /library/ docs?

Re: Is std.variant.visit not @nogc?

2018-04-10 Thread aliak via Digitalmars-d-learn
On Tuesday, 10 April 2018 at 03:48:25 UTC, Paul Backus wrote: Nope! It's just a tagged union, almost exactly the same as what you'd write by hand in C. You can take a look at the source yourself, if you're curious---it's actually pretty simple:

Re: code-d 0.17.0 + serve-d 0.1.2

2018-04-10 Thread WebFreak001 via Digitalmars-d-announce
On Monday, 9 April 2018 at 21:45:57 UTC, Johannes Loher wrote: Am 04.04.2018 um 20:34 schrieb greatsam4sure: [...] I just tried to get this to work, too, but I was not able to get it to work correctly. It seems that running dub fails somehow: [...] hm before it would have completely

Re: Migrating an existing more modern GC to D's gc.d

2018-04-10 Thread Steven Schveighoffer via Digitalmars-d
On 4/10/18 4:37 AM, David Bennett wrote: On Tuesday, 10 April 2018 at 08:10:32 UTC, Jonathan M Davis wrote: Yes. They expect it to work, and as the language is currently designed, it works perfectly well. In fact, it's even built into the language. e.g.     int[] foo() pure     {    

[Issue 18734] bitnum parameter of core.bitop.bt should be signed

2018-04-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18734 uplink.co...@googlemail.com changed: What|Removed |Added CC||uplink.co...@googlemail.com

Re: #include C headers in D code

2018-04-10 Thread Joakim via Digitalmars-d-announce
On Tuesday, 10 April 2018 at 09:36:39 UTC, Atila Neves wrote: On Monday, 9 April 2018 at 20:19:35 UTC, Seb wrote: On Monday, 9 April 2018 at 19:36:23 UTC, Atila Neves wrote: On Monday, 9 April 2018 at 18:15:33 UTC, kinke wrote: [...] This whole idea came about because a couple of years ago

[Issue 18752] New: std.file.read runnable example fails

2018-04-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18752 Issue ID: 18752 Summary: std.file.read runnable example fails Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: minor Priority: P1

Re: SMTP Mail

2018-04-10 Thread Vino via Digitalmars-d-learn
On Monday, 9 April 2018 at 19:19:53 UTC, Adam D. Ruppe wrote: On Monday, 9 April 2018 at 15:38:55 UTC, Vino.B wrote: Thank you very much, I copied your folder arsd under the phobes folder in c:\D\... and the program was placed on my desktop and tried to execute it from the desktop via rdmd.

[Issue 18199] Error with lambda in struct initializer

2018-04-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18199 --- Comment #10 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/019f0016cf7a6e11584fe0188f9e692215cce212 fix Issue 18199 - Error with lambda in struct initializer

[Issue 18199] Error with lambda in struct initializer

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

Re: #include C headers in D code

2018-04-10 Thread Atila Neves via Digitalmars-d-announce
On Tuesday, 10 April 2018 at 08:45:06 UTC, Walter Bright wrote: On 4/9/2018 4:03 AM, Atila Neves wrote: Here's my blog post about my project that allows directly #including C headers in D* Very nice work, and great article! Thanks!

Re: Thoughts on Herb Sutter's Metaclasses?

2018-04-10 Thread Chris Katko via Digitalmars-d
On Tuesday, 10 April 2018 at 05:55:06 UTC, Joakim wrote: On Tuesday, 10 April 2018 at 01:21:07 UTC, Chris Katko wrote: [...] See previous forum thread on the topic, with Walter chiming in a bit too: https://forum.dlang.org/thread/kglnxqbcugerhynng...@forum.dlang.org Wow, that thread had

Re: Migrating an existing more modern GC to D's gc.d

2018-04-10 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, April 10, 2018 08:37:47 David Bennett via Digitalmars-d wrote: > On Tuesday, 10 April 2018 at 08:10:32 UTC, Jonathan M Davis wrote: > > Yes. They expect it to work, and as the language is currently > > designed, it works perfectly well. In fact, it's even built > > into the language.

Re: #include C headers in D code

2018-04-10 Thread Walter Bright via Digitalmars-d-announce
On 4/9/2018 4:03 AM, Atila Neves wrote: Here's my blog post about my project that allows directly #including C headers in D* Very nice work, and great article!

Re: Migrating an existing more modern GC to D's gc.d

2018-04-10 Thread David Bennett via Digitalmars-d
On Tuesday, 10 April 2018 at 08:10:32 UTC, Jonathan M Davis wrote: Yes. They expect it to work, and as the language is currently designed, it works perfectly well. In fact, it's even built into the language. e.g. int[] foo() pure { return [1, 2, 3, 4]; } void main()

Re: Migrating an existing more modern GC to D's gc.d

2018-04-10 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, April 10, 2018 07:55:00 David Bennett via Digitalmars-d wrote: > On Tuesday, 10 April 2018 at 06:47:53 UTC, Jonathan M Davis wrote: > > As it stands, it's impossible to have thread-local memory > > pools. It's quite legal to construct an object as shared or > > thread-local and cast it

Re: Migrating an existing more modern GC to D's gc.d

2018-04-10 Thread David Bennett via Digitalmars-d
On Tuesday, 10 April 2018 at 06:47:53 UTC, Jonathan M Davis wrote: As it stands, it's impossible to have thread-local memory pools. It's quite legal to construct an object as shared or thread-local and cast it to the other. In fact, it's _highly_ likely that that's how any shared object of any

Re: Migrating an existing more modern GC to D's gc.d

2018-04-10 Thread David Bennett via Digitalmars-d
On Tuesday, 10 April 2018 at 06:43:28 UTC, Dmitry Olshansky wrote: On Tuesday, 10 April 2018 at 06:10:10 UTC, David Bennett wrote: I was thinking about messing with the GC in my free time just yesterday... how hard would it be: [snip] Lost immutable and that thread-local is often casted to

[Issue 18749] bt instruction using 64-bit register for 32-bit offset

2018-04-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18749 Ketmar Dark changed: What|Removed |Added CC|

[Issue 18748] bt instruction with immediate offset uses 64-bit variant for 32-bit data

2018-04-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18748 Ketmar Dark changed: What|Removed |Added CC|

Re: Migrating an existing more modern GC to D's gc.d

2018-04-10 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, April 10, 2018 06:10:10 David Bennett via Digitalmars-d wrote: > On Tuesday, 10 April 2018 at 05:26:28 UTC, Dmitry Olshansky wrote: > > On Monday, 9 April 2018 at 19:50:16 UTC, H. S. Teoh wrote: > >> Last I remembered, you were working on a GC prototype for D? > > > > Still there, but

Re: Migrating an existing more modern GC to D's gc.d

2018-04-10 Thread Dmitry Olshansky via Digitalmars-d
On Tuesday, 10 April 2018 at 06:10:10 UTC, David Bennett wrote: On Tuesday, 10 April 2018 at 05:26:28 UTC, Dmitry Olshansky wrote: On Monday, 9 April 2018 at 19:50:16 UTC, H. S. Teoh wrote: Last I remembered, you were working on a GC prototype for D? Still there, but my spare time is super

Re: #include C headers in D code

2018-04-10 Thread Stefan via Digitalmars-d-announce
On Monday, 9 April 2018 at 11:03:48 UTC, Atila Neves wrote: Here's my blog post about my project that allows directly #including C headers in D* neat!

  1   2   >