[Issue 18530] [Reg 2.079] src/rt/tracegc.d(43): Deprecation: The delete keyword has been deprecated

2018-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18530 Martin Nowak changed: What|Removed |Added Hardware|x86 |All OS|Mac OS

What's the deal with _postblitRecurse?

2018-03-02 Thread Andrei Alexandrescu via Digitalmars-d
object.d includes this function _postblitRecurse that's intentionally public but undocumented. As far as I can see only unittests are using it. What's the deal with it? Thanks! -- Andrei

[Issue 18547] New: Win32: throwing exception in fiber crashes application

2018-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18547 Issue ID: 18547 Summary: Win32: throwing exception in fiber crashes application Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW Severity: normal

Re: Is the following well defined and allowed?

2018-03-02 Thread Steven Schveighoffer via Digitalmars-d
On 3/2/18 10:26 AM, Timon Gehr wrote: On 02.03.2018 16:05, Steven Schveighoffer wrote: On 3/2/18 10:00 AM, Timon Gehr wrote: On 02.03.2018 15:39, Steven Schveighoffer wrote: In this interpetation, -noboundscheck switches DMD to a different dialect of D. In that dialect, out-of-bounds

Re: dip1000 state

2018-03-02 Thread Paolo Invernizzi via Digitalmars-d
On Friday, 2 March 2018 at 18:07:34 UTC, carblue wrote: (It may be absolutely unrelated, but there once was a very productive and knowledgeable compiler et. al. contributor, 9rnsr, Hara Kenji; though not contributing to dmd since ~ 1.5 years any more, he's still ranked #1 in number of

Re: Is the following well defined and allowed?

2018-03-02 Thread ag0aep6g via Digitalmars-d
On 03/02/2018 03:39 PM, Steven Schveighoffer wrote: On 3/1/18 5:27 PM, ag0aep6g wrote: [...] No, I'm looking at the source code. At the very basic level, you have this: assert(foo == 0); Or whatever other condition you have. What this does is gives the compiler leeway to ASSUME foo is 0 at

[Issue 18530] [Reg 2.079] src/rt/tracegc.d(43): Deprecation: The delete keyword has been deprecated

2018-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18530 Steven Schveighoffer changed: What|Removed |Added CC|

Re: dip1000 state

2018-03-02 Thread carblue via Digitalmars-d
On Thursday, 22 February 2018 at 14:36:10 UTC, Radu wrote: Whould like to know what's the state of dip1000? The fact that it takes 8 days for any reply, doesn't that say something? @safe is a high ranked technical issue in vision papers (in german we say something like "paper is patient"),

Re: Is the following well defined and allowed?

2018-03-02 Thread Jonathan M Davis via Digitalmars-d
On Friday, March 02, 2018 11:25:00 Steven Schveighoffer via Digitalmars-d wrote: > Yes, I think assertions should be kept in @safe code. It's weird to have > array bounds checks kept, but not assertions (which is how you would do > equivalent bounds checks in a custom type). Then just don't

Re: What's the deal with _postblitRecurse?

2018-03-02 Thread Andrei Alexandrescu via Digitalmars-d
On 03/02/2018 01:50 PM, Jonathan M Davis wrote: On Friday, March 02, 2018 13:32:24 Andrei Alexandrescu via Digitalmars-d wrote: object.d includes this function _postblitRecurse that's intentionally public but undocumented. As far as I can see only unittests are using it. What's the deal with

Re: Opt-in non-null class references?

2018-03-02 Thread SimonN via Digitalmars-d
On Thursday, 1 March 2018 at 16:37:02 UTC, aliak wrote: I've put up a little experiment If you're interested: https://github.com/aliak00/optional Nice! Optional is like std's Nullable with extra bells and whistles to make it as painless as you can offer it. I've read all of Optional's

Re: What's the deal with _postblitRecurse?

2018-03-02 Thread Steven Schveighoffer via Digitalmars-d
On 3/2/18 2:45 PM, H. S. Teoh wrote: On Fri, Mar 02, 2018 at 02:23:14PM -0500, Andrei Alexandrescu via Digitalmars-d wrote: [...] But I don't have a simple method to ascribe the blame to a specific PR. Is the only way to look at the date then look at the log? Thanks. -- Andrei This is how I

Re: Validity of cast(void*)size_t.max

2018-03-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/2/18 3:26 PM, Nordlöw wrote: On Wednesday, 28 February 2018 at 20:07:50 UTC, Steven Schveighoffer wrote: auto x = cast(Object)((cast(size_t *)null) + 1); Is this preferred performance-wise over `cast(void*)(size_t.max)`? No, it just works, as opposed to, um... not working ;) I think

Re: Is the following well defined and allowed?

2018-03-02 Thread Steven Schveighoffer via Digitalmars-d
On 3/2/18 1:21 PM, Jonathan M Davis wrote: On Friday, March 02, 2018 11:25:00 Steven Schveighoffer via Digitalmars-d wrote: Yes, I think assertions should be kept in @safe code. It's weird to have array bounds checks kept, but not assertions (which is how you would do equivalent bounds checks

[Issue 18501] randomShuffle and partialShuffle should return their input argument

2018-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18501 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/b9196a976c75b5584290fd111261c507af14 fix issue 18501 - randomShuffle and partialShuffle

[Issue 18501] randomShuffle and partialShuffle should return their input argument

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

Re: Validity of cast(void*)size_t.max

2018-03-02 Thread Nordlöw via Digitalmars-d-learn
On Wednesday, 28 February 2018 at 20:07:50 UTC, Steven Schveighoffer wrote: auto x = cast(Object)((cast(size_t *)null) + 1); Is this preferred performance-wise over `cast(void*)(size_t.max)`?

Re: What's the deal with _postblitRecurse?

2018-03-02 Thread Jonathan M Davis via Digitalmars-d
On Friday, March 02, 2018 14:23:14 Andrei Alexandrescu via Digitalmars-d wrote: > On 03/02/2018 01:50 PM, Jonathan M Davis wrote: > > On Friday, March 02, 2018 13:32:24 Andrei Alexandrescu via Digitalmars-d > > > > wrote: > >> object.d includes this function _postblitRecurse that's intentionally

Re: dip1000 state

2018-03-02 Thread carblue via Digitalmars-d
On Friday, 2 March 2018 at 18:17:02 UTC, Paolo Invernizzi wrote: On Friday, 2 March 2018 at 18:07:34 UTC, carblue wrote: (It may be absolutely unrelated, but there once was a very productive and knowledgeable compiler et. al. contributor, 9rnsr, Hara Kenji; though not contributing to dmd

Re: Is it possible to return the subclass from a method of the parent class in dlang?

2018-03-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/2/18 3:23 PM, Christian Köstlin wrote: To give an example: class Thread { ... Thread start() {...} } class Timer : Thread { ... } void main() { // Timer timer = new Timer().start; // this does not work auto timer = new Timer().start; // because timer is of type Thread }

Re: What's the deal with _postblitRecurse?

2018-03-02 Thread Steven Schveighoffer via Digitalmars-d
On 3/2/18 3:02 PM, Steven Schveighoffer wrote: It's easier than that. The git blame view in github shows it as this commit: https://github.com/dlang/druntime/commit/f98a02142767d2d14b574cd381670dbd53b90d36 If you look in the upper left, it shows "master (#1181)", where 1181 is the PR

Re: State of D 2018 Survey

2018-03-02 Thread Bill Baxter via Digitalmars-d-announce
That's a much nicer way of saying what I was trying to get across. :-) Early respondents to a lengthy survey about D usage are not necessarily a good representation of the more casual user's needs for the language. --bb On Thu, Mar 1, 2018 at 1:49 PM, Jonathan M Davis via

Re: What's the deal with _postblitRecurse?

2018-03-02 Thread Jonathan M Davis via Digitalmars-d
On Friday, March 02, 2018 13:32:24 Andrei Alexandrescu via Digitalmars-d wrote: > object.d includes this function _postblitRecurse that's intentionally > public but undocumented. As far as I can see only unittests are using > it. What's the deal with it? Thanks! -- Andrei It looks like it was

Re: What's the deal with _postblitRecurse?

2018-03-02 Thread H. S. Teoh via Digitalmars-d
On Fri, Mar 02, 2018 at 02:23:14PM -0500, Andrei Alexandrescu via Digitalmars-d wrote: [...] > But I don't have a simple method to ascribe the blame to a specific > PR. Is the only way to look at the date then look at the log? Thanks. > -- Andrei This is how I usually do it: 1) Find the hash of

Is it possible to return the subclass from a method of the parent class in dlang?

2018-03-02 Thread Christian Köstlin via Digitalmars-d-learn
To give an example: class Thread { ... Thread start() {...} } class Timer : Thread { ... } void main() { // Timer timer = new Timer().start; // this does not work auto timer = new Timer().start; // because timer is of type Thread } thanks in advance, christian

[Issue 18548] New: [2.079 Beta] std.format ignores templated toString if another toString is not a template

2018-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18548 Issue ID: 18548 Summary: [2.079 Beta] std.format ignores templated toString if another toString is not a template Product: D Version: D2 Hardware: All OS: All

Re: template auto value

2018-03-02 Thread Timon Gehr via Digitalmars-d
On 03.03.2018 01:20, H. S. Teoh wrote: On Fri, Mar 02, 2018 at 11:51:08PM +, Jonathan Marler via Digitalmars-d wrote: I believe I found small hole in template parameter semantics. [...] you can't create a template that accepts a value of any type. Not true: template

Re: Beta 2.079.0

2018-03-02 Thread Martin Nowak via Digitalmars-d-announce
On 02/28/2018 11:48 AM, Patrick Schluter wrote: > Just for information. DWT doesn't build with 2.079 because of overloads > not allowed . I'm not good enough to do something about it but only > wanted to make people aware of it. I also opened an issue at the dwt > project.

Re: [OFF TOPIC] State of D 2018 Survey

2018-03-02 Thread psychoticRabbit via Digitalmars-d-announce
On Friday, 2 March 2018 at 13:05:58 UTC, Russel Winder wrote: Science, in and of itself, cannot be dodgy. science must involve humans, and humans are often dodgy. Yes there are debates to be had, cf. Popper, Kuhn, etc. but the foundation of science is hypotheses, experimentation, and

Re: template auto value

2018-03-02 Thread Jonathan Marler via Digitalmars-d
On Saturday, 3 March 2018 at 00:20:14 UTC, H. S. Teoh wrote: On Fri, Mar 02, 2018 at 11:51:08PM +, Jonathan Marler via Digitalmars-d wrote: [...] Not true: template counterexample(alias T) {} int x; string s; alias U = counterexample!x; // OK

Release D 2.079.0

2018-03-02 Thread Martin Nowak via Digitalmars-d-announce
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Glad to announce D 2.079.0. This release comes with experimental `@nogc` exception throwing (-dip1008), a lazily initialized GC, better support for minimal runtimes, and an experimental Windows toolchain based on the lld linker and MinGW import

Re: State of D 2018 Survey

2018-03-02 Thread psychoticRabbit via Digitalmars-d-announce
On Friday, 2 March 2018 at 12:20:31 UTC, Paulo Pinto wrote: And if you like C so much, what are you doing in a safe systems programming language forum? How safe is D.. i mean really ;-) and why do people ask me that question.. I don't get it. I program (or try to) in as many languages as

Re: dip1000 state

2018-03-02 Thread Walter Bright via Digitalmars-d
On 3/2/2018 10:07 AM, carblue wrote: I generally already used -dip1000 since DConf2017 and it served me well, until about 2 month ago, "by accident" code was committed to std.uni that broke my builds, see issue #17961. I invested a lot of time to fix this by PR 6041. The current state is: I

Re: Documentation for any* dub package, any version

2018-03-02 Thread Martin Nowak via Digitalmars-d-announce
On 02/26/2018 03:59 PM, Adam D. Ruppe wrote: > http://dplug.dpldocs.info/v6.0.22/dplug.html > > 6.0.22 of the dplug package. Cool stuff Adam, thx. Was thinking about this for a while myself. A central doc provider could have some benefit, e.g. searching across different libraries. Compared to

Re: Release D 2.079.0

2018-03-02 Thread Mike Parker via Digitalmars-d-announce
On Saturday, 3 March 2018 at 01:50:25 UTC, Martin Nowak wrote: Glad to announce D 2.079.0. I've got a blog post coming on this in a few hours, so I would ask anyone considering sharing this on /r/programming before then to please refrain :-)

Re: Documentation for any* dub package, any version

2018-03-02 Thread Adam D. Ruppe via Digitalmars-d-announce
On Saturday, 3 March 2018 at 02:12:52 UTC, Martin Nowak wrote: A central doc provider could have some benefit, e.g. searching across different libraries. Yeah, I have code for that written for select libraries already (on the main dpldocs.info site), but haven't opened it up to the full dub

[Issue 18461] codegen bug in dmd

2018-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18461 feklushkin.de...@gmail.com changed: What|Removed |Added Summary|core.bitop.bt returns |codegen bug in dmd

Re: Thinktank: CI's, compiler lists, and project automation

2018-03-02 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 03/02/2018 02:24 AM, Jacob Carlborg wrote: Travis CI allows you to specify a D compiler in the following ways: * - the latest version of the specified compiler * -beta - the latest beta * -nightly - the nightly build * - - a specific version of the compiler Where is "dmd", "ldc" or

Re: dip1000 state

2018-03-02 Thread Manu via Digitalmars-d
On 2 March 2018 at 10:07, carblue via Digitalmars-d wrote: > On Thursday, 22 February 2018 at 14:36:10 UTC, Radu wrote: >> >> Whould like to know what's the state of dip1000? > > > The fact that it takes 8 days for any reply, doesn't that say something? > @safe is a

[Issue 17779] [REG2.075.0] Link failure (undefined references) with std.regex and std.conv

2018-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17779 Mike Franklin changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 5212] no escape analysis for typesafe variadic function arguments

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

Re: Documentation for any* dub package, any version

2018-03-02 Thread Adam D. Ruppe via Digitalmars-d-announce
Gtk-d and DWT are both too big to automatically build on the server, but I did some manual work on them. DWT: http://dwt.dpldocs.info/org.eclipse.swt.widgets.html GTK-D: http://dpldocs.info/experimental-docs/gtk.Application.Application.html The gtk one has me translating some syntax from C

[Issue 18549] New: name gets overwritten in template definition

2018-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18549 Issue ID: 18549 Summary: name gets overwritten in template definition Product: D Version: D2 Hardware: x86_64 OS: All Status: NEW Severity: normal

[Issue 18208] demangle RangeError@src/core/demangle.d(230)

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

[Issue 17964] [CTFE] If array is large enough it hits __simd at CTFE

2018-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17964 --- Comment #3 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/fe4425678d9de2c085b1cdc0a97b28d2f8cf0dc8 Issue 17964 - [CTFE] If array is large enough it

[Issue 17188] stdc qsort predicate requires scope parameters

2018-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17188 --- Comment #8 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/02f30af1e4b90de78dfa959abd4ba0d3c77e0bef fix Issue 17188 - qsort predicate requires scope

[Issue 18300] core.demangle demangling of really long symbol fails

2018-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18300 github-bugzi...@puremagic.com changed: What|Removed |Added Resolution|DUPLICATE |FIXED --

[Issue 18531] core.exception.RangeError@src/core/demangle.d(216): Range violation

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

[Issue 18531] core.exception.RangeError@src/core/demangle.d(216): Range violation

2018-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18531 --- Comment #2 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/a8415b6558d1ae461b923e5e6a42d2458989f352 fix issue 18531 -

[Issue 18300] core.demangle demangling of really long symbol fails

2018-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18300 --- Comment #4 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/8b8754d77faa2d02186c9991f5ec9b23d67db280 fix issue 18300: range error with long symbol

tupleof vs @safe

2018-03-02 Thread ag0aep6g via Digitalmars-d
As far as I understand, this is generally how ref counting is supposed to be done, and with a simple payload like `int` it's supposed to be properly safe already: module my_rc_thingy; struct RCint { import core.stdc.stdlib: free, malloc; private static struct Store {

Re: tupleof vs @safe

2018-03-02 Thread ag0aep6g via Digitalmars-d
On 03/03/2018 12:22 AM, ag0aep6g wrote: But what about `tupleof`? It ignores `private` and it's allowed in `@safe` code: [...] Now that I've sent this, I find the affected Phobos type I couldn't pinpoint. It's `File`: void main() @safe { import std.stdio: File,

template auto value

2018-03-02 Thread Jonathan Marler via Digitalmars-d
I believe I found small hole in template parameter semantics. I've summarized it here (https://github.com/marler8997/dlangfeatures#template-auto-value-parameter). Wanted to get feedback before I look into creating a PR for it. -- COPY/PASTED from

Re: Is it possible to return the subclass from a method of the parent class in dlang?

2018-03-02 Thread Christian Köstlin via Digitalmars-d-learn
On 02.03.18 21:39, Steven Schveighoffer wrote: > On 3/2/18 3:23 PM, Christian Köstlin wrote: >> To give an example: >> >> class Thread { >>    ... >>    Thread start() {...} >> } >> >> class Timer : Thread { >>    ... >> } >> >> >> void main() { >>    // Timer timer = new Timer().start;  // this

[Issue 16243] wrong C++ argument passing with empty struct when interfacing with Clang

2018-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16243 --- Comment #22 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/3ec7537f76142b23f5eed062f0420a20abcc0f9b Temporary workaround for Issue 16243 (#7970) --

[Issue 18550] Offline option for dlang.org makefile

2018-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18550 --- Comment #1 from hst...@quickfur.ath.cx --- (Not to mention, the makefile outright fails because it makes assumptions incompatible with my system, therefore one of the compilation targets fail. Why generating HTML docs should depend on compiling a

[Issue 18208] demangle RangeError@src/core/demangle.d(230)

2018-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18208 --- Comment #5 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/f16bd2db0cca3559be2bda9626b86f26f62e9cc8 fix issue 18208 - add unittest --

[Issue 17188] stdc qsort predicate requires scope parameters

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

Re: Is it possible to return the subclass from a method of the parent class in dlang?

2018-03-02 Thread Christian Köstlin via Digitalmars-d-learn
>> class Timer : Thread { >>    override Timer start() { ... } >> } >> >> https://dlang.org/spec/function.html#virtual-functions >> >> (see item 6) >> >> -Steve > Thanks for this. > It works for me only without the override (with override I get > Error: function timer.Timer.start does not override

Re: Is it possible to return the subclass from a method of the parent class in dlang?

2018-03-02 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Mar 03, 2018 at 01:13:43AM +0100, Christian Köstlin via Digitalmars-d-learn wrote: > >> class Timer : Thread { > >>    override Timer start() { ... } > >> } > >> > >> https://dlang.org/spec/function.html#virtual-functions > >> > >> (see item 6) > >> > >> -Steve > > Thanks for this. > > It

[Issue 18550] New: Offline option for dlang.org makefile

2018-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18550 Issue ID: 18550 Summary: Offline option for dlang.org makefile Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement

Re: template auto value

2018-03-02 Thread H. S. Teoh via Digitalmars-d
On Fri, Mar 02, 2018 at 11:51:08PM +, Jonathan Marler via Digitalmars-d wrote: > I believe I found small hole in template parameter semantics. > [...] you can't create a template that accepts a value of any type. Not true: template counterexample(alias T) {} int x;

Re: Release D 2.079.0

2018-03-02 Thread psychoticRabbit via Digitalmars-d-announce
On Saturday, 3 March 2018 at 01:50:25 UTC, Martin Nowak wrote: Glad to announce D 2.079.0. This release comes with experimental `@nogc` exception throwing (-dip1008), a lazily initialized GC, better support for minimal runtimes, and an experimental Windows toolchain based on the lld linker

[Issue 18551] New: Improve hint for "does not override any function

2018-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18551 Issue ID: 18551 Summary: Improve hint for "does not override any function Product: D Version: D2 Hardware: x86 OS: Mac OS X Status: NEW Severity: enhancement

mysql-native v2.1.0

2018-03-02 Thread Nick Sabalausky (Abscissa) via Digitalmars-d-announce
An all-D MySQL/MariaDB client library: https://github.com/mysql-d/mysql-native == Tagged 'v2.1.0', which mainly adds a few new features, including greatly simplified shortcut syntax for prepared statements (with automatic, implicit caching and re-use):

how to install latest lcd2 for armbain

2018-03-02 Thread dangbinghoo via Digitalmars-d-learn
hi there, I just flased a armbain for nanoPi M3. And, I just installed ldc2-1.2.0 armhf using apt-get. it compiles d code with combination with gcc armhf and compiled program runs great even the arch is aarch64. But I realized that ldc2 is too old, I know that latest ldc2 is 1.8.0. So,

single loop copy in D

2018-03-02 Thread psychoticRabbit via Digitalmars-d-learn
trying to do this C code, in D, but getting error: "Error: assignment cannot be used as a condition, perhaps `==` was meant?" any help much appreciated: -- while ((*dst++ = *src++)) {} --

Re: Opt-in non-null class references?

2018-03-02 Thread deadalnix via Digitalmars-d
On Wednesday, 28 February 2018 at 14:05:19 UTC, Jonathan M Davis wrote: I expect that pretty much anything you propose that requires code flow analysis is DOA. Walter is almost always against features that require it, because it's so hard to get right, and the places that D does use it tend to

Re: Is the following well defined and allowed?

2018-03-02 Thread Daniel Kozak via Digitalmars-d
I do not know, but from my experience it is good at it. I have done many benchmarks for plenty of code, and in recent D compilers -boundscheck=off does not improve speed. To be fair using -boundscheck=off make D code slower in many cases, which is wierd but true. On Fri, Mar 2, 2018 at 8:48 AM,

Re: Garbage collected pointers?

2018-03-02 Thread Gary Willoughby via Digitalmars-d-learn
On Thursday, 1 March 2018 at 12:20:08 UTC, Steven Schveighoffer wrote: On 3/1/18 7:05 AM, Gary Willoughby wrote: On Thursday, 1 March 2018 at 10:10:27 UTC, John Burton wrote: My question is how do I tell if a pointer is "garbage collected" or not? You could try `GC.addrOf()` or `GC.query()`

Re: Garbage collected pointers?

2018-03-02 Thread Gary Willoughby via Digitalmars-d-learn
On Friday, 2 March 2018 at 08:44:53 UTC, Gary Willoughby wrote: It would be interesting to test whether those methods handle these scenarios. Yeah, it doesn't work. https://dpaste.dzfl.pl/55116efd0c9c

Re: State of D 2018 Survey

2018-03-02 Thread Paulo Pinto via Digitalmars-d-announce
On Friday, 2 March 2018 at 04:38:24 UTC, psychoticRabbit wrote: On Friday, 2 March 2018 at 03:57:25 UTC, barry.harris wrote: Sorry little rabbit, your are misguided in this belief. Back in day we all used C and this is the reason most "safer" languages exist today. You can write pretty

Re: Is the following well defined and allowed?

2018-03-02 Thread Steven Schveighoffer via Digitalmars-d
On 3/1/18 5:27 PM, ag0aep6g wrote: You're looking at the behavior of the compiled executable. Then it makes sense to say that a program compiled with the checks has defined behavior (throwing Errors) and a program without the checks does something undefined (because the compiler manual

Re: Spawning a process: Can I "have my cake and eat it too"?

2018-03-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/2/18 9:23 AM, Steven Schveighoffer wrote: On 3/1/18 11:50 PM, Nick Sabalausky (Abscissa) wrote: How could this be accomplished? Is it even possible? You'd have to do this in the parent. You can duplicate the file descriptor, so that writing to either goes to the same spot, but you

Re: Is the following well defined and allowed?

2018-03-02 Thread Steven Schveighoffer via Digitalmars-d
On 3/2/18 10:00 AM, Timon Gehr wrote: On 02.03.2018 15:39, Steven Schveighoffer wrote: In this interpetation, -noboundscheck switches DMD to a different dialect of D. In that dialect, out-of-bounds accesses (and overlapping copies, apparently) always have UB, in both @system and @safe

Re: Is the following well defined and allowed?

2018-03-02 Thread Timon Gehr via Digitalmars-d
On 02.03.2018 15:39, Steven Schveighoffer wrote: In this interpetation, -noboundscheck switches DMD to a different dialect of D. In that dialect, out-of-bounds accesses (and overlapping copies, apparently) always have UB, in both @system and @safe code. That defeats the purpose of @safe.

Re: single loop copy in D

2018-03-02 Thread Andrea Fontana via Digitalmars-d-learn
On Friday, 2 March 2018 at 09:44:20 UTC, psychoticRabbit wrote: trying to do this C code, in D, but getting error: "Error: assignment cannot be used as a condition, perhaps `==` was meant?" any help much appreciated: -- while ((*dst++ = *src++)) {} -- You can't use this syntax

Re: Postblit constructor

2018-03-02 Thread Eduard Staniloiu via Digitalmars-d-learn
On Wednesday, 28 February 2018 at 18:27:49 UTC, Jiyan wrote: On Wednesday, 28 February 2018 at 18:23:04 UTC, Jiyan wrote: Hey, i thought i had understood postblit, but in my Code the following is happening (simplified): struct C { this(this){/*Do sth*/} list!C; void opAssign(const C c) {

Re: implicit construction operator

2018-03-02 Thread Nick Treleaven via Digitalmars-d
On Monday, 26 February 2018 at 21:07:52 UTC, Meta wrote: This is possible in the language today using the implicit class construction feature of runtime variadic arrays: class VArray { Variant[] va; this(T...)(T ts) { foreach(t; ts) { va ~= Variant(t); } } } void test(VArray ta...)

Re: State of D 2018 Survey

2018-03-02 Thread psychoticRabbit via Digitalmars-d-announce
On Friday, 2 March 2018 at 11:00:09 UTC, Jonathan M Davis wrote: In any case, I expect that anyone who wants D3 is going to have a very hard time convincing Walter and Andrei that such large breaking changes would be worth it at this point. - Jonathan M Davis I agree. I don't think there is

Re: single loop copy in D

2018-03-02 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, March 02, 2018 09:44:20 psychoticRabbit via Digitalmars-d-learn wrote: > trying to do this C code, in D, but getting error: > "Error: assignment cannot be used as a condition, perhaps `==` > was meant?" > > any help much appreciated: > > -- > while ((*dst++ = *src++)) {} > --

Re: single loop copy in D

2018-03-02 Thread Simen Kjærås via Digitalmars-d-learn
On Friday, 2 March 2018 at 10:01:34 UTC, Jonathan M Davis wrote: On Friday, March 02, 2018 09:44:20 psychoticRabbit via Digitalmars-d-learn wrote: trying to do this C code, in D, but getting error: "Error: assignment cannot be used as a condition, perhaps `==` was meant?" any help much

Unexpected behaviour of foreach statement

2018-03-02 Thread Arredondo via Digitalmars-d-learn
Hi, The following works as expected: auto range = [1, 2, 3, 4, 5]; foreach (i, el; range) { writeln(i, ": ", el); } but this slight modification doesn't: auto range = iota(5); foreach (i, el; range) { writeln(i, ": ", el); } DMD 2.078.3 says: Error: cannot infer argument

Re: Unexpected behaviour of foreach statement

2018-03-02 Thread rikki cattermole via Digitalmars-d-learn
On 02/03/2018 11:21 PM, Arredondo wrote: Hi, The following works as expected: auto range = [1, 2, 3, 4, 5]; foreach (i, el; range) { writeln(i, ": ", el); } s/range/array/ Arrays have a different foreach syntax than ranges do.

Re: Unexpected behaviour of foreach statement

2018-03-02 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 2 March 2018 at 10:21:39 UTC, Arredondo wrote: Hi, The following works as expected: auto range = [1, 2, 3, 4, 5]; foreach (i, el; range) { writeln(i, ": ", el); } but this slight modification doesn't: auto range = iota(5); foreach (i, el; range) { writeln(i, ": ",

Re: Unexpected behaviour of foreach statement

2018-03-02 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, March 02, 2018 10:21:39 Arredondo via Digitalmars-d-learn wrote: > Hi, > > The following works as expected: > > auto range = [1, 2, 3, 4, 5]; > foreach (i, el; range) { > writeln(i, ": ", el); > } > > but this slight modification doesn't: > > auto range = iota(5); > foreach (i, el;

Re: State of D 2018 Survey

2018-03-02 Thread Russel Winder via Digitalmars-d-announce
On Fri, 2018-03-02 at 02:35 +, Meta via Digitalmars-d-announce wrote: > […] > D1 -> D2 nearly killed D (can't remember which, but it was either > Walter or Andrei that have said this on multiple occasions). A D2 > -> D3 transition might generate a lot of publicity if done very > carefully,

Re: State of D 2018 Survey

2018-03-02 Thread Paulo Pinto via Digitalmars-d-announce
On Friday, 2 March 2018 at 10:21:05 UTC, Russel Winder wrote: […] There are those who use C because the only other option is assembly language, so they make the right decision. This is an indicator that high-level language toolchain manufacturers have failed to port to their platform. I'll

[Issue 18541] comparison `==` of two typeid() should always be rewritten as a "is"

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

Re: single loop copy in D

2018-03-02 Thread psychoticRabbit via Digitalmars-d-learn
On Friday, 2 March 2018 at 10:08:57 UTC, Simen Kjærås wrote: This is of course only partly true. while ((*dst++ = *src++) != 0) {} works just great, and also better shows what's actually being tested for in the loop. -- Simen That's what I was after. Thanks!

Re: State of D 2018 Survey

2018-03-02 Thread Russel Winder via Digitalmars-d-announce
Whilst we are espousing opinions… On Fri, 2018-03-02 at 08:02 +, Paulo Pinto via Digitalmars-d- announce wrote: > On Friday, 2 March 2018 at 04:38:24 UTC, psychoticRabbit wrote: > > […] > > > > You can write pretty safe code in C these days, without too > > much trouble. We have the tooling

Re: Unexpected behaviour of foreach statement

2018-03-02 Thread Arredondo via Digitalmars-d-learn
On Friday, 2 March 2018 at 10:27:27 UTC, Nicholas Wilson wrote: try https://dlang.org/phobos/std_range.html#enumerate This worked. Thank you!

Re: how to install latest lcd2 for armbain

2018-03-02 Thread Johan Engelen via Digitalmars-d-learn
On Friday, 2 March 2018 at 08:25:51 UTC, dangbinghoo wrote: So, does anyone know how to install latest ldc2 from arm-debain? You can use the dlang install.sh script to download LDC and put it in your home dir: https://dlang.org/install.html -Johan

Re: Unexpected behaviour of foreach statement

2018-03-02 Thread bauss via Digitalmars-d-learn
On Friday, 2 March 2018 at 10:21:39 UTC, Arredondo wrote: Hi, The following works as expected: auto range = [1, 2, 3, 4, 5]; foreach (i, el; range) { writeln(i, ": ", el); } but this slight modification doesn't: auto range = iota(5); foreach (i, el; range) { writeln(i, ": ",

Re: Opt-in non-null class references?

2018-03-02 Thread Stefan Koch via Digitalmars-d
On Friday, 2 March 2018 at 09:59:53 UTC, deadalnix wrote: Honestly, this is not that hard. It's very hard in DMD because it doesn't go through an SSA like form at any point. It's rather disappointing to see the language spec being decided upon based on design decision made in a compiler many

Re: Unexpected behaviour of foreach statement

2018-03-02 Thread Arredondo via Digitalmars-d-learn
On Friday, 2 March 2018 at 10:32:08 UTC, Jonathan M Davis wrote: foreach does not support indices for ranges, only arrays. When you have foreach(e; range) it gets lowered to foreach(auto __range = range; !__range.empty; __range.popFront()) { auto e = __range.front; } There are no

Re: Unexpected behaviour of foreach statement

2018-03-02 Thread Arredondo via Digitalmars-d-learn
On Friday, 2 March 2018 at 10:34:31 UTC, bauss wrote: You can also call "array" from "std.array". auto range = iota(5).array; foreach (i, el; range) { writeln(i, ": ", el); } Thank you. That's how I had it in my original code, I was just trying to avoid gratuitous memory

[Issue 18541] comparison `==` of two typeid() should always be rewritten as a "is"

2018-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18541 Basile B. changed: What|Removed |Added Status|NEW |RESOLVED

Re: State of D 2018 Survey

2018-03-02 Thread psychoticRabbit via Digitalmars-d-announce
On Friday, 2 March 2018 at 10:21:05 UTC, Russel Winder wrote: ...continue with C in the face of overwhelming evidence it is the wrong thing to do. yeah, the health fanatics who promote their crap to goverments and insurance agencies, use very similar arguments about sugar, salt, alchohol,

[Issue 6082] Constructors of templated types should be callable via IFTI

2018-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6082 Steven Schveighoffer changed: What|Removed |Added CC|

  1   2   >