Re: Is @safe still a work-in-progress?

2018-08-21 Thread Mike Franklin via Digitalmars-d
On Wednesday, 22 August 2018 at 05:39:05 UTC, Mike Franklin wrote: I understand that Walter's DIPs have been put through the process just like the others, but with regard to the specific issue in this thread (https://issues.dlang.org/show_bug.cgi?id=19097), the accompanying PR

Re: Is @safe still a work-in-progress?

2018-08-21 Thread Mike Franklin via Digitalmars-d
On Wednesday, 22 August 2018 at 05:04:25 UTC, Mike Parker wrote: Whatever the status of DIP 1000, I would point out that that one of Walter's DIPs is in Community Review right now after sitting in the PR queue in Draft Review for a while. Once this review stage is done, it will go back into

Re: Is @safe still a work-in-progress?

2018-08-21 Thread Mike Franklin via Digitalmars-d
On Wednesday, 22 August 2018 at 04:49:15 UTC, Mike Franklin wrote: It is hypocritical an arrogant to believe that only our ideas have flaws and require scrutiny. Sorry, that was poorly stated and conveyed the wrong intent. It should read: It is hypocritical an arrogant to believe that

Re: Engine of forum

2018-08-21 Thread Neia Neutuladh via Digitalmars-d
On Tuesday, 21 August 2018 at 22:00:31 UTC, Jesse Phillips wrote: On Tuesday, 21 August 2018 at 19:25:14 UTC, Walter Bright wrote: With the NNTP, git, and bugzilla, we all have backups under our control. I just don't see why it is a concern[1]: "So we set out to look for a new home for our

Re: Is @safe still a work-in-progress?

2018-08-21 Thread Mike Parker via Digitalmars-d
On Wednesday, 22 August 2018 at 02:18:15 UTC, Mike Franklin wrote: Furthermore, I find it hypocritical that some of us are put through a disproportionately burdensome DIP process requiring thorough documentation, multiple peer reviews, excessive delays, and judgement that defaults to "no" for

Re: Is @safe still a work-in-progress?

2018-08-21 Thread Mike Franklin via Digitalmars-d
On Wednesday, 22 August 2018 at 04:23:52 UTC, Jonathan M Davis wrote: The reality of the matter is that the DIP system is a formal way to propose language changes in order to convince Walter and Andrei that those changes should be implemented, whereas if Walter or Andrei writes the DIP,

Re: Deduce type of struct in function arguments

2018-08-21 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, August 21, 2018 6:56:06 PM MDT Mike Parker via Digitalmars-d- learn wrote: > On Tuesday, 21 August 2018 at 14:56:21 UTC, Seb wrote: > > I'm aware, but we don't have any other process for people to > > show their support for a DIP, do we? > > > > > > And for DMD/Druntime/Phobos etc.

Re: Is @safe still a work-in-progress?

2018-08-21 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, August 21, 2018 8:18:15 PM MDT Mike Franklin via Digitalmars-d wrote: > On Wednesday, 22 August 2018 at 01:07:28 UTC, Mike Franklin wrote: > > But what bothers me the most... > > Something else that rubs me the wrong way is that DIP 1000 is > currently in a status of `DRAFT`: >

Re: Is @safe still a work-in-progress?

2018-08-21 Thread Nicholas Wilson via Digitalmars-d
On Tuesday, 21 August 2018 at 14:31:02 UTC, Atila Neves wrote: The problem is that the code we write doesn't deal directly with pointers - see the recent confusion in this forum over where `scope` on the left applies to the `this` pointer or the one returned by the member function. Kagamin

Re: Is @safe still a work-in-progress?

2018-08-21 Thread Mike Franklin via Digitalmars-d
On Wednesday, 22 August 2018 at 01:07:28 UTC, Mike Franklin wrote: But what bothers me the most... Something else that rubs me the wrong way is that DIP 1000 is currently in a status of `DRAFT`: https://github.com/dlang/DIPs/blob/master/DIPs/README.md What the heck is going on here?

Re: D support for ChromeOS

2018-08-21 Thread Joakim via Digitalmars-d-announce
On Wednesday, 22 August 2018 at 01:48:01 UTC, Joakim wrote: On Tuesday, 21 August 2018 at 20:29:34 UTC, Emil wrote: On Saturday, 3 February 2018 at 18:11:15 UTC, Daniel Kozak wrote: [...] Tried it on an Acer Chromebook R13 running Version 69.0.3497.35 (Official Build) dev (32-bit). I have

Re: D support for ChromeOS

2018-08-21 Thread Joakim via Digitalmars-d-announce
On Tuesday, 21 August 2018 at 20:29:34 UTC, Emil wrote: On Saturday, 3 February 2018 at 18:11:15 UTC, Daniel Kozak wrote: [...] Tried it on an Acer Chromebook R13 running Version 69.0.3497.35 (Official Build) dev (32-bit). I have no previous experience with llvm. [...] Looks like your

Re: Is @safe still a work-in-progress?

2018-08-21 Thread Mike Franklin via Digitalmars-d
On Tuesday, 21 August 2018 at 21:17:25 UTC, Atila Neves wrote: I don't have merge rights. I took a look anyway and it mostly looks ok, but I'm not familiar enough with that part of the codebase. It's not the implementation that's preventing it from being merged. It's the idea itself, weak

Re: Deduce type of struct in function arguments

2018-08-21 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 21 August 2018 at 14:56:21 UTC, Seb wrote: I'm aware, but we don't have any other process for people to show their support for a DIP, do we? And for DMD/Druntime/Phobos etc. having a bunch of +1 helps a PR to move faster as we as reviewers can thus realize that this is sth.

[Issue 19097] Extend Return Scope Semantics

2018-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19097 --- Comment #9 from Mike Franklin --- (In reply to Steven Schveighoffer from comment #8) > Just because Phobos follows the convention of putting the "return" parameter > as the first parameter, does that mean the language should require it? I

Re: Coreect way to create delegate for struct method.

2018-08-21 Thread Alex via Digitalmars-d-learn
On Tuesday, 21 August 2018 at 21:29:38 UTC, Andrey wrote: Hello, This is a code: import std.stdio; struct Test { static Test opCall() { Test test; test.handler = return test; } void one() const { writeln("In handler: Address = ", , "; Text = ", text); }

[Issue 19183] DIP1000 defeated if auto used instead of scope in variable declaration with template this member function

2018-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19183 --- Comment #9 from ag0aep6g --- (In reply to Atila Neves from comment #8) > > @safe code can mess with it > > No it can't, that's the point of @safe. Mess with it how? @safe applies to functions/methods, not variables/fields. You can't forbid

Re: Engine of forum

2018-08-21 Thread Jesse Phillips via Digitalmars-d
On Tuesday, 21 August 2018 at 19:25:14 UTC, Walter Bright wrote: With the NNTP, git, and bugzilla, we all have backups under our control. I just don't see why it is a concern[1]: "So we set out to look for a new home for our data dumps, and today we’re happy to announce that the Internet

Re: Engine of forum

2018-08-21 Thread tide via Digitalmars-d
On Tuesday, 21 August 2018 at 21:33:13 UTC, Patrick Schluter wrote: On Tuesday, 21 August 2018 at 06:53:18 UTC, Daniel N wrote: On Tuesday, 21 August 2018 at 03:42:21 UTC, Ali wrote: Many of those new comers who ask about the forum software .. they never stick, they dont complain, or question,

Re: Are properties mature enough?

2018-08-21 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, August 21, 2018 1:46:31 PM MDT Jim Balter via Digitalmars-d- learn wrote: > That's a lot of detail. The bottom line is that the warning in > the spec is completely wrong and should be removed -- using > property functions is not discouraged, nor is @property. > @property should be

Re: Auto keyword and when to use it

2018-08-21 Thread QueenSvetlana via Digitalmars-d-learn
On Tuesday, 21 August 2018 at 18:44:15 UTC, Jim Balter wrote: Python is not statically typed; D is. Why are you talking about Python? You asked whether D's auto is like C#'s var ... it is, but it doesn't have C#'s pointless restriction of not being allowed for non-local declarations. I think

Re: Engine of forum

2018-08-21 Thread Patrick Schluter via Digitalmars-d
On Tuesday, 21 August 2018 at 06:53:18 UTC, Daniel N wrote: On Tuesday, 21 August 2018 at 03:42:21 UTC, Ali wrote: Many of those new comers who ask about the forum software .. they never stick, they dont complain, or question, or try to change for the better, they simply leave I think this

Re: Generically call a function on Variant's payload?

2018-08-21 Thread Nick Sabalausky (Abscissa) via Digitalmars-d-learn
On 08/21/2018 03:27 PM, Steven Schveighoffer wrote: If you examine how the code for variant works, it's quite clever. It establishes a "handler" that is generated with full compile-time type info available when the value is *assigned*, but then cast to a function taking a void pointer and an

[Issue 19183] DIP1000 defeated if auto used instead of scope in variable declaration with template this member function

2018-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19183 --- Comment #8 from Atila Neves --- > @safe code can mess with it No it can't, that's the point of @safe. Mess with it how? > Why shouldn't this compile? There's no `scope` anywhere now (except maybe an > inferred one) Function template =>

Coreect way to create delegate for struct method.

2018-08-21 Thread Andrey via Digitalmars-d-learn
Hello, This is a code: import std.stdio; struct Test { static Test opCall() { Test test; test.handler = return test; } void one() const { writeln("In handler: Address = ", , "; Text = ", text); } void execute() { text = "Inited!";

Re: Is @safe still a work-in-progress?

2018-08-21 Thread Atila Neves via Digitalmars-d
On Tuesday, 21 August 2018 at 19:36:39 UTC, Walter Bright wrote: On 8/21/2018 7:31 AM, Atila Neves wrote: The problem is that the code we write doesn't deal directly with pointers - see the recent confusion in this forum over where `scope` on the left applies to the `this` pointer or the one

[Issue 19183] DIP1000 defeated if auto used instead of scope in variable declaration with template this member function

2018-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19183 --- Comment #7 from ag0aep6g --- (In reply to Atila Neves from comment #6) > What's @trusted is that I'm calling `free` on the same pointer I allocated > in the constructor, and the other thing needing checking is the postblit. If you want to keep

Re: D support for ChromeOS

2018-08-21 Thread Emil via Digitalmars-d-announce
On Saturday, 3 February 2018 at 18:11:15 UTC, Daniel Kozak wrote: Today I have added basic support for D language (ldc and dub) to chromebrew: https://github.com/skycocker/chromebrew/pull/1717 So if you have ChromeBook with Chrome OS (developer mode is needed for chromebrew), you can try it,

[Issue 19183] DIP1000 defeated if auto used instead of scope in variable declaration with template this member function

2018-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19183 --- Comment #6 from Atila Neves --- I typed the code from memory and made a mistake. Yes, it's supposed to be `.ptr`. There's no way I can call core.stdc.stdlib.free without @trusted _somewhere_, since `free` isn't @safe - free(42) is obviously

[Issue 19097] Extend Return Scope Semantics

2018-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19097 Steven Schveighoffer changed: What|Removed |Added CC||schvei...@yahoo.com --- Comment #8

Re: Are properties mature enough?

2018-08-21 Thread Jim Balter via Digitalmars-d-learn
On Monday, 20 August 2018 at 00:49:02 UTC, Jonathan M Davis wrote: On Sunday, August 19, 2018 12:32:17 PM MDT QueenSvetlana via Digitalmars-d- learn wrote: In the D Style Guide, it says: Properties https://dlang.org/dstyle.html#properties Functions should be property functions whenever

Re: Auto keyword and when to use it

2018-08-21 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, August 21, 2018 12:22:42 PM MDT QueenSvetlana via Digitalmars-d- learn wrote: > On Monday, 20 August 2018 at 17:55:11 UTC, JN wrote: > > class Foo > > { > > > > auto bar; > > > > } > > > > because now the compiler doesn't know what type 'bar' is > > supposed to be. > > Just to

Re: Auto keyword and when to use it

2018-08-21 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, August 21, 2018 9:04:31 AM MDT Steven Schveighoffer via Digitalmars-d-learn wrote: > On 8/20/18 9:15 PM, Mike Parker wrote: > > I tend to use type inference liberally, almost always with > > const/immutbale locals, though I tend to use auto only when the type > > name is longer than

Re: Is @safe still a work-in-progress?

2018-08-21 Thread Walter Bright via Digitalmars-d
On 8/21/2018 7:31 AM, Atila Neves wrote: The problem is that the code we write doesn't deal directly with pointers - see the recent confusion in this forum over where `scope` on the left applies to the `this` pointer or the one returned by the member function. That's what I was saying :-)

Re: Engine of forum

2018-08-21 Thread Walter Bright via Digitalmars-d
On 8/21/2018 7:18 AM, Seb wrote: some rely on stackoverflow, some have an active wiki There are a few good points to move D.learn to Stack Overflow and that's actually one thing that we have talked about a few times and somehow never has happened. In the D survey there was a 2:1 "consensus"

Re: Generically call a function on Variant's payload?

2018-08-21 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/21/18 3:11 PM, Nick Sabalausky (Abscissa) wrote: On 08/21/2018 03:03 AM, Nicholas Wilson wrote: On Monday, 20 August 2018 at 00:27:04 UTC, Nick Sabalausky (Abscissa) wrote: Suppose I've wrapped a Variant in a struct/class which ensures the Variant *only* ever contains types which satisfy

[Issue 19183] DIP1000 defeated if auto used instead of scope in variable declaration with template this member function

2018-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19183 --- Comment #5 from ag0aep6g --- (In reply to Atila Neves from comment #4) > I made a mistake when I posted the code. This compiles but shouldn't (the > only difference is removing `scope` from the destructor). [...] > @safe: > > const(int)*

Re: D, Parasail, Pascal, and Rust vs The Steelman

2018-08-21 Thread Jim Balter via Digitalmars-d
On Wednesday, 21 March 2018 at 16:08:07 UTC, Martin Tschierschke wrote: On Wednesday, 21 March 2018 at 12:52:19 UTC, Paulo Pinto wrote: An article comparing the above languages as per the DoD language requirements [0]. http://jedbarber.id.au/steelman.html [0] -

Re: Generically call a function on Variant's payload?

2018-08-21 Thread Nick Sabalausky (Abscissa) via Digitalmars-d-learn
On 08/21/2018 03:03 AM, Nicholas Wilson wrote: On Monday, 20 August 2018 at 00:27:04 UTC, Nick Sabalausky (Abscissa) wrote: Suppose I've wrapped a Variant in a struct/class which ensures the Variant *only* ever contains types which satisfy a particular constraint (for example: isInputRange, or

Re: ushort + ushort = int?

2018-08-21 Thread Jim Balter via Digitalmars-d-learn
On Monday, 20 August 2018 at 08:34:56 UTC, Andrey wrote: Hello, Here is a code that you can execute using online compiler https://run.dlang.io/: import std.stdio; void main() { ushort first = 5; ushort second = 1000; ushort result = first + second; writeln(result); } I hae

Re: ./install.sh dmd broken?

2018-08-21 Thread Jean-Louis Leroy via Digitalmars-d
On Monday, 13 August 2018 at 17:10:13 UTC, Jonathan Marler wrote: The problem is downloading "install.sh" directly to "~/dlang/install.sh". This causes the install script to think that it has already downloaded the "d-keyring.gpg" so it never downloads it, causing the "invalid signature"

Re: Auto keyword and when to use it

2018-08-21 Thread Jim Balter via Digitalmars-d-learn
On Tuesday, 21 August 2018 at 18:18:25 UTC, QueenSvetlana wrote: On Tuesday, 21 August 2018 at 16:15:32 UTC, XavierAP wrote: Only if someone likes "Type x = new Type()" instead of "auto x = new Type()" I would say they're clearly wrong. As you stated it's up to the programmer to decided. I'm

Re: Auto keyword and when to use it

2018-08-21 Thread QueenSvetlana via Digitalmars-d-learn
On Monday, 20 August 2018 at 17:55:11 UTC, JN wrote: class Foo { auto bar; } because now the compiler doesn't know what type 'bar' is supposed to be. Just to clarify, even if I set bar in the constructor, I can't declare it with auto first, correct? I would have to declare a specific

Re: Auto keyword and when to use it

2018-08-21 Thread QueenSvetlana via Digitalmars-d-learn
On Tuesday, 21 August 2018 at 16:15:32 UTC, XavierAP wrote: Only if someone likes "Type x = new Type()" instead of "auto x = new Type()" I would say they're clearly wrong. As you stated it's up to the programmer to decided. I'm in favor of Type x = new Type() because when it comes to

[Issue 18609] `is` expression identifier accessible outside `static if`

2018-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18609 ZombineDev changed: What|Removed |Added CC||petar.p.ki...@gmail.com --- Comment #1 from

Re: Friends don't let friends use inout with scope and -dip1000

2018-08-21 Thread Nick Treleaven via Digitalmars-d
On Tuesday, 21 August 2018 at 13:42:31 UTC, Kagamin wrote: int[] escape(scope int[] r) { return r; //error, can't return scoped argument } ... int[] escape(T)(scope int[] r) { return r; //ok! `scope` silently promoted to `return` } You can't have strictly scoped parameter in a

Re: Auto keyword and when to use it

2018-08-21 Thread XavierAP via Digitalmars-d-learn
On Monday, 20 August 2018 at 17:52:17 UTC, QueenSvetlana wrote: So I can't declare class level variables with auto, correct? only local method variables? One difference between D's auto and C#'s var or C++'s auto is that the latter languages allow automatically typed declarations only for

[Issue 18609] `is` expression identifier accessible outside `static if`

2018-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18609 Nick Treleaven changed: What|Removed |Added Keywords||accepts-invalid

Re: Dub and it's build directory

2018-08-21 Thread Seb via Digitalmars-d-learn
On Tuesday, 21 August 2018 at 12:31:20 UTC, Petar Kirov [ZombineDev] wrote: What Dub does is what it calls "platform probing" [3]. It creates a temporary .d file containing various `pragma (msg, ..)` statements that output information to stderr during compilation. Of course the question is

Re: LDC 1.11.0

2018-08-21 Thread Joakim via Digitalmars-d-announce
On Sunday, 19 August 2018 at 10:11:42 UTC, 鲜卑拓跋枫 wrote: Many thanks for your effort! And hope the subsequent LDC releases with LLVM 7.0 will be mature enough on AArch64 and RISC-V for production environment. Who is actually running AArch64 or RISC-V in a "production environment?" Maybe a few

wiki.dlang.org confirmation emails marked as spam by gmail

2018-08-21 Thread Peter Alexander via Digitalmars-d
gmail gives the reason: "Lots of messages from k3.1azy.net were identified as spam in the past." Not sure what can be done. Just an FYI.

Re: Beta 2.082.0

2018-08-21 Thread Kagamin via Digitalmars-d-announce
On Saturday, 18 August 2018 at 16:51:18 UTC, Martin Nowak wrote: I understand that common Windows users have a very different thread model than linux developers, hence the crappy Anti-Virus rootkits. I'd expect the Windows dev audience we're targeting with D to be a bit more capable than

Re: Auto keyword and when to use it

2018-08-21 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/20/18 9:15 PM, Mike Parker wrote: I tend to use type inference liberally, almost always with const/immutbale locals, though I tend to use auto only when the type name is longer than four characters. For me, it's a nice way to save keystrokes. Some take a dim view of that approach and

Re: Deduce type of struct in function arguments

2018-08-21 Thread Seb via Digitalmars-d-learn
On Tuesday, 21 August 2018 at 08:47:53 UTC, Mike Parker wrote: On Tuesday, 21 August 2018 at 08:32:17 UTC, Seb wrote: How and where to vote? At the pull request via +1 and the upcoming "official" discussion of the PR. Except that there's no voting process for DIPs. The Community

[Issue 19097] Extend Return Scope Semantics

2018-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19097 Atila Neves changed: What|Removed |Added CC||atila.ne...@gmail.com --- Comment #7 from

Re: Engine of forum

2018-08-21 Thread Steven Schveighoffer via Digitalmars-d
On 8/21/18 10:08 AM, Ali wrote: On Tuesday, 21 August 2018 at 05:30:07 UTC, Walter Bright wrote: Ask 10 people, and you'll get 10 different answers on what a better forum would be. Actually I think we can get 8 out of those 10 to agree, rust, ocaml, fsharp, nim, scala, clojure .. all use

Re: Is @safe still a work-in-progress?

2018-08-21 Thread Atila Neves via Digitalmars-d
On Tuesday, 21 August 2018 at 00:09:03 UTC, Walter Bright wrote: On 8/20/2018 6:46 AM, Steven Schveighoffer wrote: I would, but I have no idea how dip1000 is supposed to work. I think only you understand it. Even looking at the PR that you have been citing over and over, I can't make heads or

Re: Friends don't let friends use inout with scope and -dip1000

2018-08-21 Thread Atila Neves via Digitalmars-d
On Tuesday, 21 August 2018 at 11:28:39 UTC, Nicholas Wilson wrote: On Tuesday, 21 August 2018 at 10:57:15 UTC, Atila Neves wrote: On Tuesday, 21 August 2018 at 09:50:46 UTC, Atila Neves wrote: On Monday, 20 August 2018 at 15:55:54 UTC, Kagamin wrote: On Monday, 20 August 2018 at 13:02:23 UTC,

Re: Engine of forum

2018-08-21 Thread Arun Chandrasekaran via Digitalmars-d
On Tuesday, 21 August 2018 at 14:18:40 UTC, Seb wrote: On Tuesday, 21 August 2018 at 03:42:21 UTC, Ali wrote: On Monday, 20 August 2018 at 09:52:01 UTC, Peter Alexander wrote: [...] What are the specific problems solved by using better software? Well, most software projects, have different

Re: Engine of forum

2018-08-21 Thread Bastiaan Veelo via Digitalmars-d
On Tuesday, 21 August 2018 at 14:08:01 UTC, Ali wrote: [...] But what I really meant, is that out of those who leaves, there is possible a very small percentage who left, because they couldnt communicate effectively with the community, Are you serious? This forum software is the most

Re: Cast to original type each argument in template pack

2018-08-21 Thread Alex via Digitalmars-d-learn
On Tuesday, 21 August 2018 at 08:08:58 UTC, Andrey wrote: Hello, I have a function: string format(string pattern, T...)(T value) { auto writer = appender!string(); writer.formattedWrite!pattern(convertToUnderlyingType(value)); //Tuple!T(value).expand.to!(OriginalType!T) return

Re: Engine of forum

2018-08-21 Thread Seb via Digitalmars-d
On Tuesday, 21 August 2018 at 03:42:21 UTC, Ali wrote: On Monday, 20 August 2018 at 09:52:01 UTC, Peter Alexander wrote: What are the specific problems solved or opportunities realised by moving to a real forum? What are the specific problems solved by using better software? Well, most

Re: Engine of forum

2018-08-21 Thread Ali via Digitalmars-d
On Tuesday, 21 August 2018 at 05:30:07 UTC, Walter Bright wrote: Ask 10 people, and you'll get 10 different answers on what a better forum would be. Actually I think we can get 8 out of those 10 to agree, rust, ocaml, fsharp, nim, scala, clojure .. all use https://www.discourse.org/ I think

Re: Friends don't let friends use inout with scope and -dip1000

2018-08-21 Thread Steven Schveighoffer via Digitalmars-d
On 8/21/18 9:42 AM, Kagamin wrote: except for templated functions: int[] escape(scope int[] r) {     return r; //error, can't return scoped argument } int[] escape(return int[] r) {     return r; //ok, just as planned } int[] escape(return scope int[] r) {     return r; //ok, `return

Re: Friends don't let friends use inout with scope and -dip1000

2018-08-21 Thread Kagamin via Digitalmars-d
...except for templated functions: int[] escape(scope int[] r) { return r; //error, can't return scoped argument } int[] escape(return int[] r) { return r; //ok, just as planned } int[] escape(return scope int[] r) { return r; //ok, `return scope` reduced to just `return` } int[]

[Issue 19175] @safe code can escape local array references

2018-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19175 --- Comment #4 from anonymous4 --- @safe: struct A(T) { int[] r; this(int[] q){r=q;} } int[] escape(T)(int[] r) { return A!int(r).r; } int[] f() { int[6] xs = [0, 1, 2, 3, 4, 5]; return xs.escape!int; } --

[Issue 19175] @safe code can escape local array references

2018-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19175 --- Comment #3 from anonymous4 --- Reduced: @safe: struct A(alias fun) { int[] r; this(int[] q){r=q;} } template m(alias fun) { auto m(int[] r) { return A!fun(r); } } auto foo() { int[6] xs = [0, 1, 2, 3, 4, 5];

Re: Dub and it's build directory

2018-08-21 Thread Petar via Digitalmars-d-learn
On Monday, 20 August 2018 at 18:59:23 UTC, Russel Winder wrote: Hi, [...] Hi Russel, So the questions are: 1. How does Dub find the compiler version number, in this case 2.081, given that neither DMD or LDC seem to have a way of delivering only the version number. The __VERSION__ [1]

Re: Trouble with LDC2 and definition file to hide console?

2018-08-21 Thread Kagamin via Digitalmars-d-learn
MS has resource compiler too: https://docs.microsoft.com/en-us/windows/desktop/menurc/resource-compiler

Re: Trouble with LDC2 and definition file to hide console?

2018-08-21 Thread Kagamin via Digitalmars-d-learn
On Monday, 20 August 2018 at 13:42:58 UTC, spikespaz wrote: I would also like to know how to add a PNG or ICO file to my compiled executable. I have icons in the resolutions of 16, 32, 64, 128, 256. Currently I'm adding them in using GitHub's RCEDIT tool (https://github.com/electron/rcedit)

Re: Friends don't let friends use inout with scope and -dip1000

2018-08-21 Thread Kagamin via Digitalmars-d
I mean if one method in structure is trusted, other methods need manual verification too.

Re: Friends don't let friends use inout with scope and -dip1000

2018-08-21 Thread Kagamin via Digitalmars-d
On Tuesday, 21 August 2018 at 10:57:15 UTC, Atila Neves wrote: Also, if I have to remember to annotate correctly, surely this is a massive hole in @safe dip1000? In general, safety works per method and doesn't help much in building safe data structures, those are trusted as a whole. EMSI

Re: Friends don't let friends use inout with scope and -dip1000

2018-08-21 Thread Kagamin via Digitalmars-d
On Tuesday, 21 August 2018 at 10:57:15 UTC, Atila Neves wrote: Never mind, I forgot to use -dip1000. Ok, cool, so _why_ does it work as intended now? Also, if I have to remember to annotate correctly, surely this is a massive hole in @safe dip1000? It thought dip1000 was impenetrable, but if

Re: Friends don't let friends use inout with scope and -dip1000

2018-08-21 Thread Nicholas Wilson via Digitalmars-d
On Tuesday, 21 August 2018 at 10:57:15 UTC, Atila Neves wrote: On Tuesday, 21 August 2018 at 09:50:46 UTC, Atila Neves wrote: On Monday, 20 August 2018 at 15:55:54 UTC, Kagamin wrote: On Monday, 20 August 2018 at 13:02:23 UTC, Atila Neves wrote: On Monday, 20 August 2018 at 12:56:42 UTC,

[Issue 18051] missing enum support in formattedRead/unformatValue

2018-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18051 --- Comment #1 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/6a0a91a8135cc0ce10253c23e788b0782bce165e Use version(TestComplex) as a workaround against issue

[Issue 19162] [REG: 2.079.0] Public Import Overlapping Names Conflict Resolution

2018-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19162 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/1798119abff6b7226ad65ce57339a26f0ab0bf4e Fix issue 19162

[Issue 19162] [REG: 2.079.0] Public Import Overlapping Names Conflict Resolution

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

Re: Friends don't let friends use inout with scope and -dip1000

2018-08-21 Thread Atila Neves via Digitalmars-d
On Tuesday, 21 August 2018 at 09:50:46 UTC, Atila Neves wrote: On Monday, 20 August 2018 at 15:55:54 UTC, Kagamin wrote: On Monday, 20 August 2018 at 13:02:23 UTC, Atila Neves wrote: On Monday, 20 August 2018 at 12:56:42 UTC, Kagamin wrote: [...] I need `return` for what exactly? Your code

[Issue 19183] DIP1000 defeated if auto used instead of scope in variable declaration with template this member function

2018-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19183 --- Comment #4 from Atila Neves --- I made a mistake when I posted the code. This compiles but shouldn't (the only difference is removing `scope` from the destructor). I also surrounded the call to `free` with @trusted instead of the whole

Re: Beta 2.082.0

2018-08-21 Thread Atila Neves via Digitalmars-d-announce
On Friday, 17 August 2018 at 20:01:32 UTC, Martin Nowak wrote: Glad to announce the first beta for the 2.082.0 release, ♥ to the 47 contributors for this release. [...] Could I pretty please get this absolutely non-controversial regression fix in before the release?

Re: D need an ORM library!

2018-08-21 Thread bauss via Digitalmars-d-learn
On Monday, 20 August 2018 at 02:30:16 UTC, binghoo dang wrote: hi, I thinks D need an ORM library for Sqlite/Mysql/PostgreSQL, entity currently support all the three targets, but entity's API is too complex and cumbersome for using. Is there a more light-weight and simpler implementation

[Issue 19183] DIP1000 defeated if auto used instead of scope in variable declaration with template this member function

2018-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19183 ZombineDev changed: What|Removed |Added CC||petar.p.ki...@gmail.com --- Comment #3 from

Re: Friends don't let friends use inout with scope and -dip1000

2018-08-21 Thread Atila Neves via Digitalmars-d
On Monday, 20 August 2018 at 15:55:54 UTC, Kagamin wrote: On Monday, 20 August 2018 at 13:02:23 UTC, Atila Neves wrote: On Monday, 20 August 2018 at 12:56:42 UTC, Kagamin wrote: [...] I need `return` for what exactly? Your code still compiles, and my point is it shouldn't. It sure isn't

[Issue 19183] DIP1000 defeated if auto used instead of scope in variable declaration with template this member function

2018-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19183 --- Comment #2 from Atila Neves --- I used dmd 2.081.2. I just tried it again and it compiles. Just in case there's something wrong with the Arch Linux package, I used dmd.081.2 from install.sh. Same result. I also tried the 2.082.0 beta 1. Same

[Issue 19175] @safe code can escape local array references

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

Re: Found on proggit: Why D is a good choice for writing a language

2018-08-21 Thread zabruk via Digitalmars-d
On Tuesday, 21 August 2018 at 08:21:41 UTC, tiensonqin wrote: now it's fixed, Thank you!

Re: Deduce type of struct in function arguments

2018-08-21 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 21 August 2018 at 08:32:17 UTC, Seb wrote: How and where to vote? At the pull request via +1 and the upcoming "official" discussion of the PR. Except that there's no voting process for DIPs. The Community Review is not intended as a way to vote, simply to provide feedback

Re: Deduce type of struct in function arguments

2018-08-21 Thread Seb via Digitalmars-d-learn
On Tuesday, 21 August 2018 at 06:29:12 UTC, Andrey wrote: On Monday, 20 August 2018 at 17:45:25 UTC, Seb wrote: ... yet. Though you can vote for this DIP and show your support there: https://github.com/dlang/DIPs/pull/71 It even comes with an implementation in DMD already:

Re: Found on proggit: Why D is a good choice for writing a language

2018-08-21 Thread tiensonqin via Digitalmars-d
On Friday, 17 August 2018 at 11:29:46 UTC, zabruk wrote: https://lambdahackers.com/@b4asile/why-d-is-a-good-choice-for-writing-a-toy-language-4vapyvas5a Can anyone explain me the purpose of javascript on this page? Especialy various mouse click event handlers, those break common well-known

Re: D need an ORM library!

2018-08-21 Thread Russel Winder via Digitalmars-d-learn
On Tue, 2018-08-21 at 01:42 +, binghoo dang via Digitalmars-d-learn wrote: […] > > SQLAlchemy is very great, and I remember that > in D wiki has mentioned this, but the status is "Proposed Project > Mentors: TBA". SQLAlchemy is how SQL building and ORM should be done, in Python. For

Cast to original type each argument in template pack

2018-08-21 Thread Andrey via Digitalmars-d-learn
Hello, I have a function: string format(string pattern, T...)(T value) { auto writer = appender!string(); writer.formattedWrite!pattern(convertToUnderlyingType(value)); //Tuple!T(value).expand.to!(OriginalType!T) return writer.data; } The "value" in this function can be any type

Re: Generically call a function on Variant's payload?

2018-08-21 Thread Nicholas Wilson via Digitalmars-d-learn
On Monday, 20 August 2018 at 00:27:04 UTC, Nick Sabalausky (Abscissa) wrote: Suppose I've wrapped a Variant in a struct/class which ensures the Variant *only* ever contains types which satisfy a particular constraint (for example: isInputRange, or hasLength, etc...). Is there a way to call a

Re: Engine of forum

2018-08-21 Thread Daniel N via Digitalmars-d
On Tuesday, 21 August 2018 at 03:42:21 UTC, Ali wrote: Many of those new comers who ask about the forum software .. they never stick, they dont complain, or question, or try to change for the better, they simply leave I think this is the best forum I have ever used, it's a big contributing

Re: Deduce type of struct in function arguments

2018-08-21 Thread Andrey via Digitalmars-d-learn
On Monday, 20 August 2018 at 17:45:25 UTC, Seb wrote: ... yet. Though you can vote for this DIP and show your support there: https://github.com/dlang/DIPs/pull/71 It even comes with an implementation in DMD already: https://github.com/dlang/dmd/pull/8460 How and where to vote?

[Issue 18545] Casting away const with cast() triggers alias this, but returns the supertype anyway

2018-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18545 --- Comment #1 from FeepingCreature --- It turns out what's happening here is that cast() constNullable is equivalent to Nullable(constNullable)... which implicitly casts to constNullable.get. alias get this strikes again! Nullable should maybe

Re: Generically call a function on Variant's payload?

2018-08-21 Thread Nick Sabalausky (Abscissa) via Digitalmars-d-learn
On 08/20/2018 10:57 PM, Jonathan M Davis wrote: Runtime reflection is theoretically possible in D, but it requires generating the appropriate stuff for every type involved so that the runtime stuff has something to work with. Java built all of that into the language and has the JVM to boot,