Re: does the shared keyword work with mutable structs?

2018-03-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/9/18 2:33 PM, WhatMeWorry wrote: On Friday, 9 March 2018 at 10:42:47 UTC, Kagamin wrote: To make a struct noncopyable, add @disable this(this); to it, then compiler will give an error on an attempt to copy it. I tried the @disable this(this); but now it doesn't even compile? Use

Re: The D Language Foundation at Open Collective

2018-03-13 Thread M.M. via Digitalmars-d-announce
On Tuesday, 13 March 2018 at 09:48:10 UTC, rikki cattermole wrote: On 13/03/2018 10:39 PM, M.M. wrote: On Monday, 12 March 2018 at 14:37:40 UTC, rikki cattermole wrote: Can you guys add another donation package, which is basically pay what you want towards a more long term issue? To

[Issue 12597] Payload getter for std.typecons.Typedef

2018-03-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12597 Bastiaan Veelo changed: What|Removed |Added CC||basti...@veelo.net ---

D course material

2018-03-13 Thread Dmitry Olshansky via Digitalmars-d
Hi, folks! I’m testing waters for a D course at one University for first time it’ll be an optional thing. It’s still discussed but may very well become a reality. Before you ask - no, I’m not lecturing and in fact, I didn’t suggest D in the first place! Academics are finally seeing light

Re: Do we need Mat, Vec, TMmat, Diag, Sym and other matrix types?

2018-03-13 Thread Ilya Yaroshenko via Digitalmars-d
On Tuesday, 13 March 2018 at 12:23:23 UTC, jmh530 wrote: On Tuesday, 13 March 2018 at 10:35:15 UTC, 9il wrote: On Tuesday, 13 March 2018 at 04:35:53 UTC, jmh530 wrote: [snip] What's TMMat? TMat is a transposed matrix. Not sure for now if it would be required. There are some people who

Re: D course material

2018-03-13 Thread psychoticRabbit via Digitalmars-d
On Tuesday, 13 March 2018 at 12:39:24 UTC, Dmitry Olshansky wrote: Hi, folks! I’m testing waters for a D course at one University for first time it’ll be an optional thing. It’s still discussed but may very well become a reality. Before you ask - no, I’m not lecturing and in fact, I didn’t

Re: I have a patch to let lldb demangle D symbols ; help welcome to improve it

2018-03-13 Thread Luís Marques via Digitalmars-d
On Monday, 12 March 2018 at 23:03:33 UTC, Timothee Cour wrote: quite likely, try to compile with ldc or with latest dmd (2.079, which fixed underscores on OSX) so that demangling works. I just tried with dmd 2.078 and it indeed doesn't demangle (as expected) Yeah, that works. I'll be trying

Re: DConf hotel poor QoS

2018-03-13 Thread Luís Marques via Digitalmars-d
On Tuesday, 13 March 2018 at 06:41:03 UTC, Mengu wrote: On Monday, 12 March 2018 at 19:30:06 UTC, Luís Marques wrote: On Friday, 9 March 2018 at 15:26:24 UTC, Luís Marques wrote: Mar-9: I send them an email saying I continue to await a correction to my reservation. Mar-12: I get an email

[Issue 18606] New: [REG2.072] "cannot append type const(T) to type T[]" in .dup

2018-03-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18606 Issue ID: 18606 Summary: [REG2.072] "cannot append type const(T) to type T[]" in .dup Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW

Re: Unreachable warning is annoying

2018-03-13 Thread Steven Schveighoffer via Digitalmars-d
On 3/13/18 10:25 AM, Yuxuan Shui wrote: See this simple example: int staticFind(T, S...)() {     foreach(id, R; S) {     if (is(T == R))     return id;     }     }     return -1; } staticFind!(int, int, double) will generate a 'statement is unreachable' warning, and

Unreachable warning is annoying

2018-03-13 Thread Yuxuan Shui via Digitalmars-d
See this simple example: int staticFind(T, S...)() { foreach(id, R; S) { if (is(T == R)) return id; } } return -1; } staticFind!(int, int, double) will generate a 'statement is unreachable' warning, and staticFind!(int, double) won't. This behaviour is

[Issue 12486] Function returning struct isn't called if `enum` of its result is accessed

2018-03-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12486 --- Comment #4 from FeepingCreature --- Posted a pull request that's awaiting review: https://github.com/dlang/dmd/pull/8013 I'm not really happy with it, but I don't know a better way to write it. --

[Issue 18605] False unreachable warning generated when labeled continue is used

2018-03-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18605 --- Comment #1 from Yuxuan Shui --- This bug is worse than I thought: auto test(T...)(int t) pure { L:foreach(_; T) { if (t) continue L; return 1; } } void main() @safe { import std.stdio

[Issue 18605] False unreachable warning generated when labeled continue is used

2018-03-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18605 --- Comment #2 from Yuxuan Shui --- Reduced a bit more: auto test(T...)() { L:foreach(_; T) { continue L; return 1; } } void main() @safe { import std.stdio : writeln;

Re: The D Language Foundation at Open Collective

2018-03-13 Thread Martin Tschierschke via Digitalmars-d-announce
On Monday, 12 March 2018 at 14:32:34 UTC, Mike Parker wrote: Today, the D Language Foundation has launched a page at Open Collective: https://opencollective.com/dlang. This brings some transparency to the process and opens new opportunities for how the Foundation handles donations. The

Re: LDC 1.8.0

2018-03-13 Thread Matthias Klumpp via Digitalmars-d-announce
On Tuesday, 13 March 2018 at 10:27:49 UTC, kinke wrote: On Tuesday, 13 March 2018 at 01:52:48 UTC, Matthias Klumpp wrote: The new and enforced "-shared" suffixes for the druntime and phobos shared libraries are a bit annoying (especially since this is a breaking change), but at least at Debian

Re: The D Language Foundation at Open Collective

2018-03-13 Thread Mike Parker via Digitalmars-d-announce
On Tuesday, 13 March 2018 at 15:26:24 UTC, Martin Tschierschke wrote: The Website needs the link, too!: https://dlang.org/foundation/donate.html Yes, there's a PR for it waiting to be merged. https://github.com/dlang/dlang.org/pull/2272

Using Address Sanitizer in LDC

2018-03-13 Thread Nordlöw via Digitalmars-d-learn
Can I use address sanitizer (ASan) in LDC 1.8 to find use of uninitialized memory in, in my case, a set of containers, currently https://github.com/nordlow/phobos-next/blob/master/src/open_hashmap_or_hashset.d If so, what arguments should I feed to ldc2's -fsanitize=

Re: how to make private class member private

2018-03-13 Thread JN via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 02:06:57 UTC, psychoticRabbit wrote: On Tuesday, 13 March 2018 at 01:39:13 UTC, Jonathan M Davis wrote: private is private to the module, not the class. There is no way in D to restrict the rest of the module from accessing the members of a class. This

[Issue 18605] New: False unreachable warning generated when labeled continue is used

2018-03-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18605 Issue ID: 18605 Summary: False unreachable warning generated when labeled continue is used Product: D Version: D2 Hardware: x86_64 OS: Linux Status:

Re: Do we need Mat, Vec, TMmat, Diag, Sym and other matrix types?

2018-03-13 Thread Martin Tschierschke via Digitalmars-d
On Tuesday, 13 March 2018 at 14:13:02 UTC, jmh530 wrote: [...] https://en.wikipedia.org/wiki/Row-_and_column-major_order I think for mathematics it is more important for easy handling, to be able to get the element of a matrix a_ij by a(i,j) and not only by a[i-1,j-1]. The underlying

Re: The D Language Foundation at Open Collective

2018-03-13 Thread Jonathan M Davis via Digitalmars-d-announce
On Tuesday, March 13, 2018 15:26:24 Martin Tschierschke via Digitalmars-d- announce wrote: > On Monday, 12 March 2018 at 14:32:34 UTC, Mike Parker wrote: > > Today, the D Language Foundation has launched a page at Open > > Collective: > > > > https://opencollective.com/dlang. > > > > This brings

Re: DConf hotel poor QoS

2018-03-13 Thread Chris via Digitalmars-d
On Monday, 12 March 2018 at 10:31:36 UTC, Martin Tschierschke wrote: On Saturday, 10 March 2018 at 04:55:02 UTC, Mike Parker wrote: Sorry to say this, but you are missing the most beautiful German city: Hamburg :-) Have a got journey! p.s. I am dreaming of the day DConf being in Hamburg...

Re: I have a patch to let lldb demangle D symbols ; help welcome to improve it

2018-03-13 Thread Luís Marques via Digitalmars-d
On Tuesday, 13 March 2018 at 14:00:39 UTC, Luís Marques wrote: On Monday, 12 March 2018 at 23:03:33 UTC, Timothee Cour wrote: Yeah, that works. I'll be trying it more thoroughly and report any issues. Even with DMD 2.079 the frame locals don't show up... LDC FTW!

[Issue 18605] Missing return not detected when labeled continue is used

2018-03-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18605 Yuxuan Shui changed: What|Removed |Added Summary|False unreachable warning |Missing return not detected

Re: Unreachable warning is annoying

2018-03-13 Thread Yuxuan Shui via Digitalmars-d
On Tuesday, 13 March 2018 at 14:40:21 UTC, Steven Schveighoffer wrote: On 3/13/18 10:25 AM, Yuxuan Shui wrote: [...] This has been discussed before. There are a few ways around this. One is to do what you did. Another is to append a sentinel, or use id to terminate the loop: foreach(id,

Re: Do we need Mat, Vec, TMmat, Diag, Sym and other matrix types?

2018-03-13 Thread jmh530 via Digitalmars-d
On Tuesday, 13 March 2018 at 15:47:36 UTC, Martin Tschierschke wrote: On Tuesday, 13 March 2018 at 14:13:02 UTC, jmh530 wrote: [...] https://en.wikipedia.org/wiki/Row-_and_column-major_order I think for mathematics it is more important for easy handling, to be able to get the element of a

[Issue 18607] New: using labelled continue in tuple foreach can break pure

2018-03-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18607 Issue ID: 18607 Summary: using labelled continue in tuple foreach can break pure Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW

[Issue 18417] Make const and immutable postblit constructors illegal

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

Re: D course material

2018-03-13 Thread Seb via Digitalmars-d
On Tuesday, 13 March 2018 at 12:39:24 UTC, Dmitry Olshansky wrote: Hi, folks! I’m testing waters for a D course at one University for first time it’ll be an optional thing. It’s still discussed but may very well become a reality. Before you ask - no, I’m not lecturing and in fact, I didn’t

Re: Using Address Sanitizer in LDC

2018-03-13 Thread Nordlöw via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 15:12:02 UTC, Nordlöw wrote: Can I use address sanitizer (ASan) in LDC 1.8 to find use of uninitialized memory in, in my case, a set of containers, currently https://github.com/nordlow/phobos-next/blob/master/src/open_hashmap_or_hashset.d If so, what arguments

Re: Do we need Mat, Vec, TMmat, Diag, Sym and other matrix types?

2018-03-13 Thread 9il via Digitalmars-d
On Tuesday, 13 March 2018 at 14:13:02 UTC, jmh530 wrote: On Tuesday, 13 March 2018 at 13:02:45 UTC, Ilya Yaroshenko wrote: On Tuesday, 13 March 2018 at 12:23:23 UTC, jmh530 wrote: [...] Good point. Would matrix(j, i) syntax solve this issue? One of reasons to introduce Mat is API

[Issue 18282] [Scope][DIP1000]Assignment of local variable to `scope` variable not recognized by compiler

2018-03-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18282 --- Comment #4 from Walter Bright --- https://github.com/dlang/dmd/pull/8030 --

CTFE and -betterC

2018-03-13 Thread Xavier Bigand via Digitalmars-d-learn
As I am trying to do a dll that acts exactly like one written in C, I am trying to compile my code with the -betterC option. So I would not need the DllMain function. I am not sure that I use the best syntax for my CTFE function to be able to make it works with the option -betterC and to

Re: D course material

2018-03-13 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, March 13, 2018 21:30:13 aberba via Digitalmars-d wrote: > The D Programming Language (TDPL) is a big book so it will be > boring. I used it whilst learning about the complete features of > D (mostly just reading like story book though). LOL. TDPL big? It's only 463 pages including the

"Error: address of variable this assigned to this with longer lifetime"

2018-03-13 Thread Nathan S. via Digitalmars-d-learn
What is this malarky? https://run.dlang.io/is/S42EBb "onlineapp.d(16): Error: address of variable this assigned to this with longer lifetime" ```d import std.stdio; struct SmallString { char[24] small; char[] data; @disable this(); this(scope const(char)[] s) @safe {

Re: D course material

2018-03-13 Thread aberba via Digitalmars-d
On Tuesday, 13 March 2018 at 21:12:16 UTC, David Gileadi wrote: On 3/13/18 2:08 PM, aberba wrote: On Tuesday, 13 March 2018 at 17:20:57 UTC, Meta wrote: On Tuesday, 13 March 2018 at 12:39:24 UTC, Dmitry Olshansky wrote: [...] Honestly I'd recommend TDPL. It's got a lot of good real-world

Re: D course material

2018-03-13 Thread Abdulhaq via Digitalmars-d
On Tuesday, 13 March 2018 at 21:12:16 UTC, David Gileadi wrote: On 3/13/18 2:08 PM, aberba wrote: On Tuesday, 13 March 2018 at 17:20:57 UTC, Meta wrote: On Tuesday, 13 March 2018 at 12:39:24 UTC, Dmitry Olshansky wrote: [...] Honestly I'd recommend TDPL. It's got a lot of good real-world

Re: Do we need Mat, Vec, TMmat, Diag, Sym and other matrix types?

2018-03-13 Thread jmh530 via Digitalmars-d
On Tuesday, 13 March 2018 at 21:04:28 UTC, bachmeier wrote: What I have settled on is Row(x,2), which returns a range that works with foreach. I tried x[_,2] to return Row(x,2) but didn't like reading it, so I went with x[_all,2] instead. Similarly for Col(x,2) and x[2,_all]. The exact form

[Issue 18608] containers/src/containers/internal/storage_type.d(50)

2018-03-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18608 Timothee Cour changed: What|Removed |Added CC|

Re: how to make private class member private

2018-03-13 Thread Nathan S. via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 21:36:13 UTC, Arun Chandrasekaran wrote: On Tuesday, 13 March 2018 at 13:59:00 UTC, Steven Schveighoffer wrote: On 3/12/18 10:06 PM, psychoticRabbit wrote: [...] OK, so I agree there are drawbacks. But these can be worked around. [...] Private members still

Confusing TLS

2018-03-13 Thread Jack Applegame via Digitalmars-d
Code: import std.stdio; import core.thread; import core.time; auto arr = new ubyte[1]; // THIS SHOULD NOT COMPILE int main(string[] args) { new Thread({ arr[0]++; }).start(); new Thread({ arr[0]++; }).start(); Thread.sleep(1.seconds); writefln("arr[0]

Re: how to make private class member private

2018-03-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, March 13, 2018 22:25:52 Nathan S. via Digitalmars-d-learn wrote: > On Tuesday, 13 March 2018 at 21:36:13 UTC, Arun Chandrasekaran > > wrote: > > On Tuesday, 13 March 2018 at 13:59:00 UTC, Steven Schveighoffer > > > > wrote: > >> On 3/12/18 10:06 PM, psychoticRabbit wrote: > >>> [...] >

Re: Vision document for H1 2018

2018-03-13 Thread Nick Sabalausky (Abscissa) via Digitalmars-d-announce
On 03/11/2018 11:31 PM, Laeeth Isharc wrote: C# slices look great. I wonder if that might open the door for D on the CLR. I know that was attempted once a long way back, but was deemed infeasible and abandoned. IIRC, inability to implement slices was the main blocker.

Re: Vibe.d web interface tutorial

2018-03-13 Thread Nick Sabalausky (Abscissa) via Digitalmars-d-announce
On 03/13/2018 09:42 AM, Daniel Kozak wrote: Yes PHP is always to blame :) From my archives: https://semitwist.com/articles/article/view/10-fun-facts-about-php

Re: how to make private class member private

2018-03-13 Thread Amorphorious via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 06:10:26 UTC, psychoticRabbit wrote: On Tuesday, 13 March 2018 at 05:35:30 UTC, Amorphorious wrote: There is another problem: 3rd: You are a brainwashed monkey who can't think for himself. Gee..takes some real brains to come up with that one. See, You learned

Re: how to make private class member private

2018-03-13 Thread Arun Chandrasekaran via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 13:59:00 UTC, Steven Schveighoffer wrote: On 3/12/18 10:06 PM, psychoticRabbit wrote: [...] OK, so I agree there are drawbacks. But these can be worked around. [...] Private members still have external linkage. Is there anyway to solve this?

Re: "Error: address of variable this assigned to this with longer lifetime"

2018-03-13 Thread Nathan S. via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 21:07:33 UTC, ag0aep6g wrote: You're storing a reference to `small` in `data`. When a SmallString is copied, that reference will still point to the original `small`. When the original goes out of scope, the reference becomes invalid, a dangling pointer. Can't have

[Issue 18608] containers/src/containers/internal/storage_type.d(50)

2018-03-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18608 Timothee Cour changed: What|Removed |Added Status|NEW |RESOLVED

Re: how to make private class member private

2018-03-13 Thread Nathan S. via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 09:14:26 UTC, psychoticRabbit wrote: what I don't like, is that I have no way at all to protect members of my class, from things in the module, without moving that class out of that module. D wants me to completely trust the module, no matter what. That's make a

Re: how to make private class member private

2018-03-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, March 13, 2018 21:36:13 Arun Chandrasekaran via Digitalmars-d- learn wrote: > On Tuesday, 13 March 2018 at 13:59:00 UTC, Steven Schveighoffer > > wrote: > > On 3/12/18 10:06 PM, psychoticRabbit wrote: > >> [...] > > > > OK, so I agree there are drawbacks. But these can be worked > >

Re: D course material

2018-03-13 Thread David Gileadi via Digitalmars-d
On 3/13/18 2:08 PM, aberba wrote: On Tuesday, 13 March 2018 at 17:20:57 UTC, Meta wrote: On Tuesday, 13 March 2018 at 12:39:24 UTC, Dmitry Olshansky wrote: [...] Honestly I'd recommend TDPL. It's got a lot of good real-world examples, including some OOP ones, but more importantly examples

Re: D course material

2018-03-13 Thread aberba via Digitalmars-d
On Tuesday, 13 March 2018 at 12:39:24 UTC, Dmitry Olshansky wrote: Hi, folks! I’m testing waters for a D course at one University for first time it’ll be an optional thing. It’s still discussed but may very well become a reality. Before you ask - no, I’m not lecturing and in fact, I didn’t

Re: Do we need Mat, Vec, TMmat, Diag, Sym and other matrix types?

2018-03-13 Thread bachmeier via Digitalmars-d
On Tuesday, 13 March 2018 at 12:09:04 UTC, jmh530 wrote: On Tuesday, 13 March 2018 at 10:39:29 UTC, 9il wrote: On Tuesday, 13 March 2018 at 05:36:06 UTC, J-S Caux wrote: Your suggestion [4] that matrix[i] returns a Vec is perhaps too inflexible. What one needs sometimes is to return a row,

Re: D course material

2018-03-13 Thread aberba via Digitalmars-d
On Tuesday, 13 March 2018 at 17:20:57 UTC, Meta wrote: On Tuesday, 13 March 2018 at 12:39:24 UTC, Dmitry Olshansky wrote: [...] Honestly I'd recommend TDPL. It's got a lot of good real-world examples, including some OOP ones, but more importantly examples that demonstrate concurrent

Re: "Error: address of variable this assigned to this with longer lifetime"

2018-03-13 Thread ag0aep6g via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 20:49:16 UTC, Nathan S. wrote: "onlineapp.d(16): Error: address of variable this assigned to this with longer lifetime" ```d [...] struct SmallString { char[24] small; char[] data; [...] this(scope const(char)[] s) @safe { [...]

[Issue 18608] New: containers/src/containers/internal/storage_type.d(50)

2018-03-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18608 Issue ID: 18608 Summary: containers/src/containers/internal/storage_type.d(50) Product: D Version: D2 Hardware: x86 OS: Mac OS X Status: NEW Severity:

Re: "Error: address of variable this assigned to this with longer lifetime"

2018-03-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, March 13, 2018 21:35:50 Nathan S. via Digitalmars-d-learn wrote: > On Tuesday, 13 March 2018 at 21:07:33 UTC, ag0aep6g wrote: > > You're storing a reference to `small` in `data`. When a > > SmallString is copied, that reference will still point to the > > original `small`. When the

Re: Lazy caching map()?

2018-03-13 Thread H. S. Teoh via Digitalmars-d
On Sat, Mar 10, 2018 at 08:54:16PM +, aliak via Digitalmars-d wrote: > On Friday, 9 March 2018 at 19:41:46 UTC, H. S. Teoh wrote: > > [...] More precisely, given an array `T[] src` of source data and a > > function func(T) that's pretty expensive to compute, return an > > object `result` such

Re: rvalue types

2018-03-13 Thread H. S. Teoh via Digitalmars-d
On Tue, Mar 13, 2018 at 06:51:01AM +, Dmitry Olshansky via Digitalmars-d wrote: [...] > While writing Pry I soon come to realize that using types to store > information is a dead end. They are incredibly brittle esp. once you > start optimizing on them using operations such as T1 eqivalent to

[Issue 18607] using labelled continue in tuple foreach can break pure and @safe

2018-03-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18607 ag0aep6g changed: What|Removed |Added Keywords||safe CC|

[Issue 18535] auto-tester fails on Win_32_64 : `The system cannot find the path specified.`

2018-03-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18535 Seb changed: What|Removed |Added CC||greensunn...@gmail.com ---

Re: D course material

2018-03-13 Thread Meta via Digitalmars-d
On Tuesday, 13 March 2018 at 12:39:24 UTC, Dmitry Olshansky wrote: Hi, folks! I’m testing waters for a D course at one University for first time it’ll be an optional thing. It’s still discussed but may very well become a reality. Before you ask - no, I’m not lecturing and in fact, I didn’t

Re: Unreachable warning is annoying

2018-03-13 Thread Steven Schveighoffer via Digitalmars-d
On 3/13/18 12:50 PM, Yuxuan Shui wrote: On Tuesday, 13 March 2018 at 14:40:21 UTC, Steven Schveighoffer wrote: On 3/13/18 10:25 AM, Yuxuan Shui wrote: [...] This has been discussed before. There are a few ways around this. One is to do what you did. Another is to append a sentinel, or use

Re: Unreachable warning is annoying

2018-03-13 Thread H. S. Teoh via Digitalmars-d
On Tue, Mar 13, 2018 at 01:32:55PM -0400, Steven Schveighoffer via Digitalmars-d wrote: [...] > An unrolled foreach on a tuple has a notion that the flow control > jumps out of the loop, and it's OK to skip further loops (even though > they are technically unrolled). [...] This is not true.

Re: rvalue types

2018-03-13 Thread Meta via Digitalmars-d
On Tuesday, 13 March 2018 at 17:33:14 UTC, H. S. Teoh wrote: I think the general idea is a good approach, and it seems that ultimately we're just reinventing expression DSLs. Overloading built-in operators works up to a point, and then you really want to just use a string DSL, parse that in

Re: Access to structures defined in C

2018-03-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 14 March 2018 at 01:58:24 UTC, Joe wrote: The C header of course declares this as: extern char *files[]; The way to declare it in a D module appears to be: extern (C) { __gshared extern char *[] files; } A D array[] should *almost never* be used in extern(C). (tbh I'm

Re: how to make private class member private

2018-03-13 Thread Amorphorious via Digitalmars-d-learn
On Wednesday, 14 March 2018 at 01:41:33 UTC, psychoticRabbit wrote: On Tuesday, 13 March 2018 at 21:38:59 UTC, Amorphorious wrote: You are a moron...etc..etc..etc..etc. See. This is what happens when you have access to a keyboard while high on ice. Yep. So maybe you should

Re: Do we need Mat, Vec, TMmat, Diag, Sym and other matrix types?

2018-03-13 Thread 9il via Digitalmars-d
On Tuesday, 13 March 2018 at 17:10:03 UTC, jmh530 wrote: "Note that using row-major ordering may require more memory and time than column-major ordering, because the routine must transpose the row-major order to the column-major order required by the underlying LAPACK routine." Maybe we

Re: Do we need Mat, Vec, TMmat, Diag, Sym and other matrix types?

2018-03-13 Thread Manu via Digitalmars-d
On 12 March 2018 at 20:37, 9il via Digitalmars-d wrote: > Hi All, > > The Dlang multidimensional range type, ndslice, is a struct composed a an > iterator, lengths and possibly strides. It does not own memory and does not > know anything about its content. ndslice is

Re: Vision document for H1 2018

2018-03-13 Thread rumbu via Digitalmars-d-announce
On Tuesday, 13 March 2018 at 23:20:22 UTC, Nick Sabalausky (Abscissa) wrote: On 03/11/2018 11:31 PM, Laeeth Isharc wrote: C# slices look great. I wonder if that might open the door for D on the CLR. I know that was attempted once a long way back, but was deemed infeasible and abandoned.

Re: CTFE and -betterC

2018-03-13 Thread rikki cattermole via Digitalmars-d-learn
You will still need DllMain, that is a platform requirement.

Re: how to pass -pie flag to dmd(or rdmd or ldc) ?

2018-03-13 Thread Joakim via Digitalmars-d
On Wednesday, 14 March 2018 at 01:31:20 UTC, timotheecour wrote: On Thursday, 26 January 2017 at 07:38:50 UTC, Jacob Carlborg wrote: On 2017-01-26 04:43, Timothee Cour via Digitalmars-d wrote: Can we do this is 1 step? ``` rdmd -offoo.o -c foo.d g++ -o foo foo.o -pie -Wl,--export-dynamic ```

Re: how to pass -pie flag to dmd(or rdmd or ldc) ?

2018-03-13 Thread timotheecour via Digitalmars-d
On Thursday, 26 January 2017 at 07:38:50 UTC, Jacob Carlborg wrote: On 2017-01-26 04:43, Timothee Cour via Digitalmars-d wrote: Can we do this is 1 step? ``` rdmd -offoo.o -c foo.d g++ -o foo foo.o -pie -Wl,--export-dynamic ``` Ideally something like this would be great: ``` rdmd -offoo

Re: how to make private class member private

2018-03-13 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 21:38:59 UTC, Amorphorious wrote: You are a moron...etc..etc..etc..etc. See. This is what happens when you have access to a keyboard while high on ice.

Access to structures defined in C

2018-03-13 Thread Joe via Digitalmars-d-learn
What is the correct way to declare and access storage managed by C? For example, say a C module defines an array of filenames, e.g., char *files[] = { "one", "two", "three", 0}; The C header of course declares this as: extern char *files[]; The way to declare it in a D module appears to be:

Re: overload binary + operator to work with different types

2018-03-13 Thread Marc via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 19:05:00 UTC, Jonathan M Davis wrote: On Tuesday, March 13, 2018 18:55:35 Marc via Digitalmars-d-learn wrote: I want to basically make this work: >[...] I managed to do this: > [...] } Note the ref in the fucntion return, I also want to return a reference to the

Re: rvalue types

2018-03-13 Thread Dmitry Olshansky via Digitalmars-d
On Tuesday, 13 March 2018 at 17:33:14 UTC, H. S. Teoh wrote: Now usage: alias powMod = bluePrint.instantiate; // here we do optimizations and CTFE-based codegen powMod(a,b,c); // use as many times as needed Wouldn't CTFE-based codegen be pretty slow too? Until newCTFE is merged, it would

Re: Unreachable warning is annoying

2018-03-13 Thread Timon Gehr via Digitalmars-d
On 13.03.2018 18:43, H. S. Teoh wrote: On Tue, Mar 13, 2018 at 01:32:55PM -0400, Steven Schveighoffer via Digitalmars-d wrote: [...] An unrolled foreach on a tuple has a notion that the flow control jumps out of the loop, and it's OK to skip further loops (even though they are technically

Re: overload binary + operator to work with different types

2018-03-13 Thread Simen Kjærås via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 18:55:35 UTC, Marc wrote: I want to basically make this work: auto l = new List(); l += 5; I managed to do this: class List { int[] items; ref List opBinary(string op)(int rhs) if(op == "+") { items ~= rhs;

Re: Unreachable warning is annoying

2018-03-13 Thread Steven Schveighoffer via Digitalmars-d
On 3/13/18 3:21 PM, Timon Gehr wrote: On 13.03.2018 18:43, H. S. Teoh wrote: On Tue, Mar 13, 2018 at 01:32:55PM -0400, Steven Schveighoffer via Digitalmars-d wrote: [...] An unrolled foreach on a tuple has a notion that the flow control jumps out of the loop, and it's OK to skip further loops

Re: overload binary + operator to work with different types

2018-03-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/13/18 3:28 PM, Simen Kjærås wrote: Now, since we've established that there's no way to do exactly what you want, maybe it's time to take a look at what you actually want. :p Why do you want to write that code? Why would a.append(1, 2, 3); not be good enough? Typically, we can do this

Re: The D Language Foundation at Open Collective

2018-03-13 Thread Martin Tschierschke via Digitalmars-d-announce
On Tuesday, 13 March 2018 at 15:54:56 UTC, Jonathan M Davis wrote: On Tuesday, March 13, 2018 15:26:24 Martin Tschierschke via Digitalmars-d- announce wrote: [...] BTW, opencollective.com has a link to windfair.net listed in your backer profile, but it links via https, and windfair.net seems

Re: LDC 1.8.0

2018-03-13 Thread kinke via Digitalmars-d-announce
On Tuesday, 13 March 2018 at 15:35:02 UTC, Matthias Klumpp wrote: Unfortunately, we ship both - while Debian packages only use the shared libraries, and we want the shared libraries to be default, we also want to make the static ones available for people who want to opt into that for software

Are there any working instructions about how to build and test dmd on Windows?

2018-03-13 Thread rumbu via Digitalmars-d-learn
I know that there are contributing guides but I fail to successfully follow any of them: https://wiki.dlang.org/Starting_as_a_Contributor 1. Bash install script will not run under Windows. Using git bash will result in error (Command error: undefined switch '-C') 2. Digger it's not compiling

Re: Lazy caching map()?

2018-03-13 Thread aliak via Digitalmars-d
On Tuesday, 13 March 2018 at 17:24:35 UTC, H. S. Teoh wrote: Very nice. Using memoize did occur to me, but I needed an array interface to it. Didn't think of using memoize with map, for some reason. Thanks for the idea! However, looking at the implementation of memoize, it seems that it's

Re: Are there any working instructions about how to build and test dmd on Windows?

2018-03-13 Thread Rubn via Digitalmars-d-learn
Yah it's not fun. Some notes: You might need to set MSVC_CC environment variable cause it doesn't use the right format for VS path, depending on your version. https://github.com/dlang/dmd/blob/v2.079.0/src/vcbuild/msvc-dmc.d#L19 You could open a command prompt with the batch file running

Re: Do we need Mat, Vec, TMmat, Diag, Sym and other matrix types?

2018-03-13 Thread bachmeier via Digitalmars-d
On Tuesday, 13 March 2018 at 22:08:10 UTC, jmh530 wrote: With respect to interacting with libraries, I agree that a user should choose either row-order or column-order and stick to it. But what options are available for the user of a column-major language (or array library) to call mir if mir

Re: Lazy caching map()?

2018-03-13 Thread H. S. Teoh via Digitalmars-d
On Wed, Mar 14, 2018 at 12:12:44AM +, aliak via Digitalmars-d wrote: [...] > Btw, I just saw someone posted a link to an old forum post of yours: > https://forum.dlang.org/post/mailman.2562.1403196857.2907.digitalmar...@puremagic.com > > Mind if I add that (or a version of it) to a library

Re: UFCS in generic libraries, silent hijacking, and compile errors.

2018-03-13 Thread aliak via Digitalmars-d-learn
On Sunday, 11 March 2018 at 15:24:31 UTC, Jonathan M Davis wrote: On Sunday, March 11, 2018 08:39:54 aliak via Digitalmars-d-learn wrote: On Saturday, 10 March 2018 at 23:00:07 UTC, Jonathan M Davis > issue in practice. That doesn't mean that it's never a > problem, but from what I've seen,

Re: How to simplify nested ifs

2018-03-13 Thread aliak via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 13:13:07 UTC, rumbu wrote: On Tuesday, 13 March 2018 at 12:23:06 UTC, Ozan Süel wrote: Hi I have a construction like the following if (source) { if (source.pool) { if (source.pool.repository) { if (source.pool.repository.directory) { if

[Issue 17390] Pass flags to linker driver without -Xlinker

2018-03-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17390 Timothee Cour changed: What|Removed |Added CC|

[Issue 17390] Pass flags to linker driver without -Xlinker

2018-03-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17390 --- Comment #4 from Timothee Cour --- also, -Xcc is now part of ldc --

<    1   2