Re: Orange not working?

2018-07-12 Thread JN via Digitalmars-d-learn
On Friday, 13 July 2018 at 05:29:58 UTC, Timoses wrote: On Thursday, 12 July 2018 at 20:44:43 UTC, JN wrote: I am trying to make use of the Orange package, I added the latest version from dub to my project: "orange": "~>1.0.0" and copy pasted the "simple usage" code from

Re: Orange not working?

2018-07-12 Thread Timoses via Digitalmars-d-learn
On Thursday, 12 July 2018 at 20:44:43 UTC, JN wrote: I am trying to make use of the Orange package, I added the latest version from dub to my project: "orange": "~>1.0.0" and copy pasted the "simple usage" code from https://github.com/jacob-carlborg/orange , but I am getting a long list of

Re: Copy Constructor DIP

2018-07-12 Thread Manu via Digitalmars-d
On Thu, 12 Jul 2018 at 20:15, Meta via Digitalmars-d wrote: > > On Friday, 13 July 2018 at 02:32:59 UTC, Manu wrote: > > Seriously, if I was making this proposal to you, and you were > > in my > > position... there is no way in hell that you'd allow any of us > > to slip > > something so

Re: Guido van Rossum has resigned

2018-07-12 Thread Meta via Digitalmars-d
On Thursday, 12 July 2018 at 21:16:02 UTC, Walter Bright wrote: as Python's BDFL. https://mail.python.org/pipermail/python-committers/2018-July/005664.html I looked up PEP 572 and... *this* is what people are up in arms about? Assignment in expressions, which works fine the majority of the

Re: Copy Constructor DIP

2018-07-12 Thread Meta via Digitalmars-d
On Friday, 13 July 2018 at 02:32:59 UTC, Manu wrote: Seriously, if I was making this proposal to you, and you were in my position... there is no way in hell that you'd allow any of us to slip something so substantial by like that with the wave of a hand. This DIP depends on @implicit. How can

Re: Copy Constructor DIP

2018-07-12 Thread Manu via Digitalmars-d
On Thu, 12 Jul 2018 at 19:15, Andrei Alexandrescu via Digitalmars-d wrote: > > On 7/12/18 6:34 PM, Manu wrote: > > On Thu, 12 Jul 2018 at 06:50, Andrei Alexandrescu via Digitalmars-d > > wrote: > >> > >> On 07/11/2018 11:11 AM, Atila Neves wrote: > >>> On Wednesday, 11 July 2018 at 07:40:32 UTC,

Re: How to define syscall() in freebsd?

2018-07-12 Thread Heromyth via Digitalmars-d
On Thursday, 12 July 2018 at 20:19:17 UTC, Brian wrote: freebsd syscall() https://www.freebsd.org/cgi/man.cgi?query=syscall=2 How to define it in D? It should be fine like this: extern (C) nothrow @nogc size_t syscall(size_t ident, ...);

Re: Copy Constructor DIP

2018-07-12 Thread Manu via Digitalmars-d
On Thu., 12 Jul. 2018, 7:10 pm Andrei Alexandrescu via Digitalmars-d, < digitalmars-d@puremagic.com> wrote: > On 7/12/18 7:15 PM, Manu wrote: > > On Thu, 12 Jul 2018 at 08:36, Andrei Alexandrescu via Digitalmars-d > > wrote: > >> > >> On 07/12/2018 11:14 AM, Luís Marques wrote: > >>> On

Re: REPL semantics

2018-07-12 Thread jmh530 via Digitalmars-d
On Thursday, 12 July 2018 at 22:17:29 UTC, Luís Marques wrote: I actually never tried the existing REPLs, what are your issues with them? No Windows support. For drepl: "Works on any OS with full shared library support by DMD (currently linux, OSX, and FreeBSD)."

Re: Copy Constructor DIP

2018-07-12 Thread Andrei Alexandrescu via Digitalmars-d
On 7/12/18 10:05 PM, Manu wrote: On Thu, 12 Jul 2018 at 18:25, Andrei Alexandrescu via Digitalmars-d wrote: On 7/12/18 4:29 PM, Manu wrote: Being able to implement them both independently is*occasionally* useful, but 95% of the time, destruct + copy-construct is an equally efficient

Re: REPL semantics

2018-07-12 Thread jmh530 via Digitalmars-d
On Thursday, 12 July 2018 at 22:24:19 UTC, Luís Marques wrote: Right. Hopefully there aren't too many weird cases once that is generalized to other corners of the language. I also never used REPLs for major development, only for debugging and minor tests, so I don't have experience with that

Re: Copy Constructor DIP

2018-07-12 Thread Andrei Alexandrescu via Digitalmars-d
On 7/12/18 6:37 PM, Manu wrote: On Thu, 12 Jul 2018 at 07:15, Andrei Alexandrescu via Digitalmars-d wrote: On 07/12/2018 09:49 AM, Atila Neves wrote: On Thursday, 12 July 2018 at 06:54:37 UTC, RazvanN wrote: [...] If by "come in pairs" you mean that you can define them both, then yes,

Re: Copy Constructor DIP

2018-07-12 Thread Andrei Alexandrescu via Digitalmars-d
On 7/12/18 6:34 PM, Manu wrote: On Thu, 12 Jul 2018 at 06:50, Andrei Alexandrescu via Digitalmars-d wrote: On 07/11/2018 11:11 AM, Atila Neves wrote: On Wednesday, 11 July 2018 at 07:40:32 UTC, RazvanN wrote: But there's a super explicit `@implicit` thing written right there... so should we

Re: Copy Constructor DIP

2018-07-12 Thread Andrei Alexandrescu via Digitalmars-d
On 7/12/18 7:15 PM, Manu wrote: On Thu, 12 Jul 2018 at 08:36, Andrei Alexandrescu via Digitalmars-d wrote: On 07/12/2018 11:14 AM, Luís Marques wrote: On Thursday, 12 July 2018 at 14:56:33 UTC, Luís Marques wrote: When designing D libraries than lean towards DSL style, I've frequently felt

Re: Copy Constructor DIP

2018-07-12 Thread Manu via Digitalmars-d
On Thu, 12 Jul 2018 at 18:25, Andrei Alexandrescu via Digitalmars-d wrote: > > On 7/12/18 4:29 PM, Manu wrote: > > Being able to implement them both independently is*occasionally* > > useful, but 95% of the time, destruct + copy-construct is an equally > > efficient implementation for assignment.

Re: Blogpost about the T.init problem

2018-07-12 Thread Cym13 via Digitalmars-d-announce
On Wednesday, 11 July 2018 at 07:30:59 UTC, FeepingCreature wrote: That would work, it's just a really horrible hack and I hate it. Bastiaan's solution to simply change the default value slipped my mind but is really cleaner and in the same line of thought. We're constructing a fictitious

Re: Copy Constructor DIP

2018-07-12 Thread Andrei Alexandrescu via Digitalmars-d
On 7/12/18 4:29 PM, Manu wrote: Being able to implement them both independently is*occasionally* useful, but 95% of the time, destruct + copy-construct is an equally efficient implementation for assignment. I'd suggest that this destruct+copy-construct pattern is a perfectly good substitute for

Re: Copy Constructor DIP

2018-07-12 Thread Andrei Alexandrescu via Digitalmars-d
On 7/12/18 2:30 PM, ag0aep6g wrote: On 07/12/2018 03:40 PM, Andrei Alexandrescu wrote: On 07/10/2018 04:58 PM, Manu wrote: [...] 1. Explain the need and reasoning behind `@implicit`. Razvan: I think it would help to explain that the attribute is necessary to avoid changing semantics of

Re: Copy Constructor DIP

2018-07-12 Thread Manu via Digitalmars-d
On Thu, 12 Jul 2018 at 08:36, Andrei Alexandrescu via Digitalmars-d wrote: > > On 07/12/2018 11:14 AM, Luís Marques wrote: > > On Thursday, 12 July 2018 at 14:56:33 UTC, Luís Marques wrote: > >> When designing D libraries than lean towards DSL style, I've > >> frequently felt impaired by the lack

Re: Copy Constructor DIP

2018-07-12 Thread Manu via Digitalmars-d
On Thu, 12 Jul 2018 at 08:30, Luís Marques via Digitalmars-d wrote: > > On Thursday, 12 July 2018 at 15:14:19 UTC, Luís Marques wrote: > > More details. The DIP says: > > > > "The structName type needs to be identical to typeof(this); an > > error is issued otherwise. This requirement may be

Re: Copy Constructor DIP

2018-07-12 Thread Manu via Digitalmars-d
On Tue, 10 Jul 2018 at 03:50, RazvanN via Digitalmars-d wrote: > > Hi everyone! > > I managed to put together a first draft of the DIP for adding the > copy constructor to the language [1]. If anyone is interested, > please take a look. Suggestions and comments about technical > aspects and

Re: Copy Constructor DIP

2018-07-12 Thread Manu via Digitalmars-d
On Thu, 12 Jul 2018 at 06:50, Andrei Alexandrescu via Digitalmars-d wrote: > > On 07/11/2018 11:11 AM, Atila Neves wrote: > > On Wednesday, 11 July 2018 at 07:40:32 UTC, RazvanN wrote: > >>> But there's a super explicit `@implicit` thing written right there... > >>> so should we expect that an

Re: Guido van Rossum has resigned

2018-07-12 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 12 July 2018 at 22:28:00 UTC, Walter Bright wrote: I have no plans to resign until they carry me out in a box. That can be arranged. (lol you guys we should carry walter out of to the stage of the next dconf in a box)

Re: REPL semantics

2018-07-12 Thread Luís Marques via Digitalmars-d
On Thursday, 12 July 2018 at 19:07:15 UTC, Luís Marques wrote: Consider a D REPL session like this: Unlike cling, drepl doesn't seem to support overloading: Welcome to D REPL. D> import std.stdio; std D> void bar(long) { writeln("long"); } bar D> void bar(int) { writeln("int"); } bar D>

Re: Copy Constructor DIP

2018-07-12 Thread Manu via Digitalmars-d
On Thu, 12 Jul 2018 at 07:15, Andrei Alexandrescu via Digitalmars-d wrote: > > On 07/12/2018 09:49 AM, Atila Neves wrote: > > On Thursday, 12 July 2018 at 06:54:37 UTC, RazvanN wrote: > > > >> [...] > > > >> If by "come in pairs" you mean that you can define them both, then yes, > >> that is the

Re: Guido van Rossum has resigned

2018-07-12 Thread H. S. Teoh via Digitalmars-d
On Thu, Jul 12, 2018 at 03:28:00PM -0700, Walter Bright via Digitalmars-d wrote: > On 7/12/2018 2:22 PM, Luís Marques wrote: > > On Thursday, 12 July 2018 at 21:16:02 UTC, Walter Bright wrote: > > > as Python's BDFL. > > > > Don't get any ideas! > > I have no plans to resign until they carry me

Re: Guido van Rossum has resigned

2018-07-12 Thread 12345swordy via Digitalmars-d
On Thursday, 12 July 2018 at 21:16:02 UTC, Walter Bright wrote: as Python's BDFL. https://mail.python.org/pipermail/python-committers/2018-July/005664.html There is controversy surrounding his opinions? I am out of the loop here. -Alex

Re: Copy Constructor DIP

2018-07-12 Thread Manu via Digitalmars-d
On Thu, 12 Jul 2018 at 06:50, Andrei Alexandrescu via Digitalmars-d wrote: > > On 07/11/2018 11:11 AM, Atila Neves wrote: > > On Wednesday, 11 July 2018 at 07:40:32 UTC, RazvanN wrote: > >>> But there's a super explicit `@implicit` thing written right there... > >>> so should we expect that an

[Issue 19065] Struct invariant violated in @safe with T.init

2018-07-12 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19065 Ali Ak changed: What|Removed |Added CC||ali.akhtarz...@gmail.com --- Comment #4 from Ali

Re: Copy Constructor DIP

2018-07-12 Thread Manu via Digitalmars-d
On Thu, 12 Jul 2018 at 06:45, Andrei Alexandrescu via Digitalmars-d wrote: > > On 07/10/2018 06:50 PM, Manu wrote: > > On Tue, 10 Jul 2018 at 15:23, Jonathan M Davis via Digitalmars-d > > wrote: > >> > >> On Tuesday, 10 July 2018 14:58:09 MDT Manu via Digitalmars-d wrote: > >>> 2. It looks like

Re: Guido van Rossum has resigned

2018-07-12 Thread Walter Bright via Digitalmars-d
On 7/12/2018 2:22 PM, Luís Marques wrote: On Thursday, 12 July 2018 at 21:16:02 UTC, Walter Bright wrote: as Python's BDFL. Don't get any ideas! I have no plans to resign until they carry me out in a box.

Re: REPL semantics

2018-07-12 Thread Luís Marques via Digitalmars-d
On Thursday, 12 July 2018 at 22:04:39 UTC, jmh530 wrote: I think the mental model of someone coming from a dynamic language would be as if bar is dynamically re-compiled when the foo(int x) is entered. Right. Hopefully there aren't too many weird cases once that is generalized to other

Re: REPL semantics

2018-07-12 Thread Luís Marques via Digitalmars-d
On Thursday, 12 July 2018 at 21:51:18 UTC, aliak wrote: Cool, is there on going work to sprucing up the D repl in the dlang-community repo or is this a new attempt? Either way if something is happening here then awesome! Ah, that explains why my clone of drepl didn't compile: it was the

Re: REPL semantics

2018-07-12 Thread jmh530 via Digitalmars-d
On Thursday, 12 July 2018 at 21:15:46 UTC, Luís Marques wrote: On Thursday, 12 July 2018 at 20:33:04 UTC, jmh530 wrote: On Thursday, 12 July 2018 at 19:07:15 UTC, Luís Marques wrote: Most REPLs I've used are for languages with dynamic typing. Perhaps take a look at a C REPL and see what it

Re: REPL semantics

2018-07-12 Thread aliak via Digitalmars-d
On Thursday, 12 July 2018 at 21:15:46 UTC, Luís Marques wrote: On Thursday, 12 July 2018 at 20:33:04 UTC, jmh530 wrote: On Thursday, 12 July 2018 at 19:07:15 UTC, Luís Marques wrote: Most REPLs I've used are for languages with dynamic typing. Perhaps take a look at a C REPL and see what it

Re: Safe Memory Management and Ownership.

2018-07-12 Thread xray via Digitalmars-d
On Thursday, 12 July 2018 at 14:13:25 UTC, Chris M. wrote: On Wednesday, 11 July 2018 at 22:59:50 UTC, xray wrote: The message above is repost of : https://forum.dlang.org/post/pfjotkcazuiuhlvzi...@forum.dlang.org So I can reply to Chris M. here.

Re: Guido van Rossum has resigned

2018-07-12 Thread Luís Marques via Digitalmars-d
On Thursday, 12 July 2018 at 21:16:02 UTC, Walter Bright wrote: as Python's BDFL. Don't get any ideas!

Guido van Rossum has resigned

2018-07-12 Thread Walter Bright via Digitalmars-d
as Python's BDFL. https://mail.python.org/pipermail/python-committers/2018-July/005664.html

Re: REPL semantics

2018-07-12 Thread Luís Marques via Digitalmars-d
On Thursday, 12 July 2018 at 20:33:04 UTC, jmh530 wrote: On Thursday, 12 July 2018 at 19:07:15 UTC, Luís Marques wrote: Most REPLs I've used are for languages with dynamic typing. Perhaps take a look at a C REPL and see what it does? Well, cling calls the original function: [cling]$ #import

Orange not working?

2018-07-12 Thread JN via Digitalmars-d-learn
I am trying to make use of the Orange package, I added the latest version from dub to my project: "orange": "~>1.0.0" and copy pasted the "simple usage" code from https://github.com/jacob-carlborg/orange , but I am getting a long list of errors:

Re: REPL semantics

2018-07-12 Thread jmh530 via Digitalmars-d
On Thursday, 12 July 2018 at 19:07:15 UTC, Luís Marques wrote: Consider a D REPL session like this: void bar(long x) { writeln(x); } void foo() { bar(42); } 42 void bar(int) {} Assuming implementation complexity is not an issue, what do you feel is the more natural semantics for a

Re: Copy Constructor DIP

2018-07-12 Thread Manu via Digitalmars-d
On Wed, 11 Jul 2018 at 23:55, RazvanN via Digitalmars-d wrote: > > > What's wrong with: > > struct S { > > this(ref S copyFrom); > > } > > > > That looks like a perfectly good copy constructor declaration > > ;) I'm just saying, the DIP needs to explain this. > > That is actually a valid

Re: Blogpost about the T.init problem

2018-07-12 Thread Timothee Cour via Digitalmars-d-announce
the following seems like a easy enough workaround: just add ` if(this is typeof(this).init) return;` at 1st line of your invariant: ```d import std.typecons; import std.range; struct MyDomainData { string username; this(string username) @safe in(!username.empty) do {

Re: How to define syscall() in freebsd?

2018-07-12 Thread Brian via Digitalmars-d
On Thursday, 12 July 2018 at 15:45:41 UTC, Joakim wrote: On Thursday, 12 July 2018 at 13:55:58 UTC, Brian wrote: the code is error: extern (C) nothrow @nogc size_t syscall(size_t ident); extern (C) nothrow @nogc size_t syscall(size_t ident, size_t arg0); extern (C) nothrow @nogc size_t

Re: REPL semantics

2018-07-12 Thread Luís Marques via Digitalmars-d
On Thursday, 12 July 2018 at 19:07:15 UTC, Luís Marques wrote: Assuming implementation complexity is not an issue, what do you feel is the more natural semantics for a REPL? Should foo now call bar(int), or should it still call bar(long)? (feel free to generalize the issue) BTW, this

REPL semantics

2018-07-12 Thread Luís Marques via Digitalmars-d
Consider a D REPL session like this: void bar(long x) { writeln(x); } void foo() { bar(42); } 42 void bar(int) {} Assuming implementation complexity is not an issue, what do you feel is the more natural semantics for a REPL? Should foo now call bar(int), or should it still call

[Issue 18955] extern(C++) default struct mangling is overridden when interacting with a `cppmangle = class` tamplate

2018-07-12 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18955 --- Comment #3 from Manu --- I'm sorry. I think I must have cut fail-ed. Remove the `Alloc` arg: --- extern (C++, std) { struct char_traits(Char) { } extern (C++, class) struct

Re: Copy Constructor DIP

2018-07-12 Thread ag0aep6g via Digitalmars-d
On 07/12/2018 03:40 PM, Andrei Alexandrescu wrote: On 07/10/2018 04:58 PM, Manu wrote: [...] 1. Explain the need and reasoning behind `@implicit`. Razvan: I think it would help to explain that the attribute is necessary to avoid changing semantics of existing code. Thanks. You're still

Re: Copy Constructor DIP

2018-07-12 Thread Johannes Pfau via Digitalmars-d
Am Thu, 12 Jul 2018 17:32:06 + schrieb Johannes Pfau: > Am Thu, 12 Jul 2018 09:48:37 -0400 schrieb Andrei Alexandrescu: > >>> I agree that the current syntax is lacking. This was Andrei's >>> proposition and I was initially against it, but he said to put it in >>> the DIP so that we can

Re: Copy Constructor DIP

2018-07-12 Thread Johannes Pfau via Digitalmars-d
Am Thu, 12 Jul 2018 09:48:37 -0400 schrieb Andrei Alexandrescu: >> I agree that the current syntax is lacking. This was Andrei's >> proposition and I was initially against it, but he said to put it in >> the DIP so that we can discuss it as a community. Maybe this syntax is >> better: >> >>

[Issue 19081] Can't declare enum with UDA at statement level

2018-07-12 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19081 --- Comment #2 from Yuxuan Shui --- This is because, at statement level, enum is also a storage class: enum X = 10; I wonder why declaring enum without a UDA works at statement level. I smell terrible hacks. --

[Issue 19081] Can't declare enum with UDA at statement level

2018-07-12 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19081 Yuxuan Shui changed: What|Removed |Added Summary|Can't declare enum with UDA |Can't declare enum with UDA

Re: Copy Constructor DIP

2018-07-12 Thread Andrei Alexandrescu via Digitalmars-d
On 7/12/18 11:42 AM, Luís Marques wrote: On Thursday, 12 July 2018 at 15:33:03 UTC, Andrei Alexandrescu wrote: Again: not the charter of this DIP, so you should ask yourself, not us, this question. Look, I understand it can be frustrating to have a concrete design proposal derailed by a

Re: Blogpost about the T.init problem

2018-07-12 Thread Luís Marques via Digitalmars-d-announce
On Wednesday, 11 July 2018 at 03:00:48 UTC, Ali wrote: Somehow, this is the type of problem, i thought point 1 in the vision document is aimed to solve https://wiki.dlang.org/Vision/2018H1 "1. Lock down the language definition: D is a powerful language but its definition is not precise

Re: How to define syscall() in freebsd?

2018-07-12 Thread Joakim via Digitalmars-d
On Thursday, 12 July 2018 at 13:55:58 UTC, Brian wrote: the code is error: extern (C) nothrow @nogc size_t syscall(size_t ident); extern (C) nothrow @nogc size_t syscall(size_t ident, size_t arg0); extern (C) nothrow @nogc size_t syscall(size_t ident, long* arg0); long tid;

Re: Copy Constructor DIP

2018-07-12 Thread jmh530 via Digitalmars-d
On Thursday, 12 July 2018 at 15:42:29 UTC, Luís Marques wrote: On Thursday, 12 July 2018 at 15:33:03 UTC, Andrei Alexandrescu wrote: Again: not the charter of this DIP, so you should ask yourself, not us, this question. Look, I understand it can be frustrating to have a concrete design

Re: Copy Constructor DIP

2018-07-12 Thread Luís Marques via Digitalmars-d
On Thursday, 12 July 2018 at 15:33:03 UTC, Andrei Alexandrescu wrote: Again: not the charter of this DIP, so you should ask yourself, not us, this question. Look, I understand it can be frustrating to have a concrete design proposal derailed by a myriad of speculative questions. But if we

[Issue 19070] Invalid octal literals `01` through `07` allowed

2018-07-12 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19070 --- Comment #1 from Hiroki Noda --- Attemptive PR : https://github.com/dlang/dmd/pull/8490 --

Re: Copy Constructor DIP

2018-07-12 Thread Luís Marques via Digitalmars-d
On Thursday, 12 July 2018 at 15:34:25 UTC, Andrei Alexandrescu wrote: The DIP mentions the interaction of @implicit with alias this. Not the interaction I was asking about, although admittedly it was speculative.

Re: Copy Constructor DIP

2018-07-12 Thread Andrei Alexandrescu via Digitalmars-d
On 07/12/2018 11:14 AM, Luís Marques wrote: On Thursday, 12 July 2018 at 14:56:33 UTC, Luís Marques wrote: When designing D libraries than lean towards DSL style, I've frequently felt impaired by the lack of implicit conversions in D. In my experience, it's not that all types need to be

Re: Copy Constructor DIP

2018-07-12 Thread Andrei Alexandrescu via Digitalmars-d
On 07/12/2018 11:29 AM, Luís Marques wrote: On Thursday, 12 July 2018 at 15:25:10 UTC, Luís Marques wrote: On Thursday, 12 July 2018 at 15:14:19 UTC, Luís Marques wrote: BTW: Multiple alias this is still planned for inclusion in D, right? If so, what would be the (pratical?) difference between

Re: Copy Constructor DIP

2018-07-12 Thread Andrei Alexandrescu via Digitalmars-d
On 07/12/2018 11:25 AM, Luís Marques wrote: On Thursday, 12 July 2018 at 15:14:19 UTC, Luís Marques wrote: More details. The DIP says: "The structName type needs to be identical to typeof(this); an error is issued otherwise. This requirement may be relaxed in the future in order to

Re: Copy Constructor DIP

2018-07-12 Thread Andrei Alexandrescu via Digitalmars-d
On 07/12/2018 11:22 AM, Timon Gehr wrote: On 12.07.2018 15:29, Andrei Alexandrescu wrote: On 07/11/2018 05:55 AM, Nick Treleaven wrote: ... Removing `static` works. Otherwise I tried changing `ref` to `alias`: Error: variable src cannot be read at compile time But this shorter code seems to

Re: Copy Constructor DIP

2018-07-12 Thread Andrei Alexandrescu via Digitalmars-d
On 07/12/2018 10:54 AM, Jonathan M Davis wrote: On Thursday, 12 July 2018 07:45:30 MDT Andrei Alexandrescu via Digitalmars-d wrote: I also very much dislike the syntax - it makes no sense to me at all. I commented on the PR itself asking why it differs so much from C++ - specifically, what's

Re: Copy Constructor DIP

2018-07-12 Thread Timon Gehr via Digitalmars-d
On 12.07.2018 17:22, Timon Gehr wrote: alias field0 = s.tupleof[0]; t.tupleof[0] = field0; alias field1 = s.tupleof[1]; t.tupleof[1] = field1; alias field2 = s.tupleof[2]; t.tupleof[2] = field2; Error: alias `a` cannot alias an expression `tuple(s.a, s.b, s.c)[0]` Error: alias `b` cannot alias

Re: Copy Constructor DIP

2018-07-12 Thread Luís Marques via Digitalmars-d
On Thursday, 12 July 2018 at 15:25:10 UTC, Luís Marques wrote: On Thursday, 12 July 2018 at 15:14:19 UTC, Luís Marques wrote: BTW: Multiple alias this is still planned for inclusion in D, right? If so, what would be the (pratical?) difference between having copy ctors with such a relaxed type

Re: Copy Constructor DIP

2018-07-12 Thread Luís Marques via Digitalmars-d
On Thursday, 12 July 2018 at 15:14:19 UTC, Luís Marques wrote: More details. The DIP says: "The structName type needs to be identical to typeof(this); an error is issued otherwise. This requirement may be relaxed in the future in order to accomodate copying from objects of a different type"

Re: Copy Constructor DIP

2018-07-12 Thread Timon Gehr via Digitalmars-d
On 12.07.2018 15:29, Andrei Alexandrescu wrote: On 07/11/2018 05:55 AM, Nick Treleaven wrote: ... Removing `static` works. Otherwise I tried changing `ref` to `alias`: Error: variable src cannot be read at compile time But this shorter code seems to work fine: this.tupleof = src.tupleof;

[Issue 19081] New: Can't declare enum with UDA in unittest blocks

2018-07-12 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19081 Issue ID: 19081 Summary: Can't declare enum with UDA in unittest blocks Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: enhancement

Re: Copy Constructor DIP

2018-07-12 Thread Luís Marques via Digitalmars-d
On Thursday, 12 July 2018 at 14:56:33 UTC, Luís Marques wrote: When designing D libraries than lean towards DSL style, I've frequently felt impaired by the lack of implicit conversions in D. In my experience, it's not that all types need to be implicitly convertible to other types. Just being

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-12 Thread Seb via Digitalmars-d-learn
On Wednesday, 11 July 2018 at 20:38:13 UTC, Dukc wrote: On Wednesday, 11 July 2018 at 19:41:37 UTC, Jordi Gutiérrez Hermoso wrote: Just getting it into -betterC territory seems like a very daunting task. You do not need -betterC anymore. At least the LDC frontend will only add linking hooks

[Issue 3567] std.traits: Unqual strips qualifiers on structs with references that would break const/immutable.

2018-07-12 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3567 --- Comment #9 from Steven Schveighoffer --- I think a trait "ForceUnqual" may be needed in some cases, but "Unqual" I have always expected to behave the way it does (except in the case of structs containing references, for which it should not strip

[Issue 3567] std.traits: Unqual strips qualifiers on structs with references that would break const/immutable.

2018-07-12 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3567 --- Comment #8 from Timoses --- (In reply to Steven Schveighoffer from comment #6) > Note, the bug here in FeepingCreature's case is that it strips more than it > should. It is supposed to be safe to use Unqual. > > So the expectation that Unqual

Re: Copy Constructor DIP

2018-07-12 Thread Luís Marques via Digitalmars-d
On Tuesday, 10 July 2018 at 10:47:04 UTC, RazvanN wrote: I managed to put together a first draft of the DIP for adding the copy constructor to the language [1]. If anyone is interested, please take a look. Suggestions and comments about technical aspects and wording are all welcome. When

Re: Copy Constructor DIP

2018-07-12 Thread Jonathan M Davis via Digitalmars-d
On Thursday, 12 July 2018 07:45:30 MDT Andrei Alexandrescu via Digitalmars-d wrote: > > I also very much dislike the syntax - it makes no sense to me at all. I > > commented on the PR itself asking why it differs so much from C++ - > > specifically, what's bad about the C++ way of doing things

Re: I have a plan.. I really DO

2018-07-12 Thread bachmeier via Digitalmars-d-announce
On Thursday, 12 July 2018 at 11:36:15 UTC, RhyS wrote: Its the same with the donations. I stated before that D as a organisation with its financing feels very mysterious. You do not see where the money goes I've raised this issue elsewhere. I think there would be more incentive to donate if

Seoul D Meetup - Aug 9 - BlockchainOS & Learn Teach Code Seoul

2018-07-12 Thread Mike Parker via Digitalmars-d-announce
I'm very happy to announce the next Seoul D meetup on August 9 at 7:00 pm. We're partnering with local company BlockchainOS and the Meetup group 'Learn Teach Code Seoul' for an interactive 'Introduction to D' presentation/tutorial followed by an hour of coding challenges. BlockchainOS is

[Issue 3567] std.traits: Unqual strips qualifiers on structs with references that would break const/immutable.

2018-07-12 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3567 --- Comment #7 from Timoses --- (In reply to Steven Schveighoffer from comment #6) > I'm changing the title accordingly. Perhaps we should actually close this > bug and open another, as the whole issue has really been flipped around? Perhaps you're

[Issue 19059] Invalid integer literal 08 and 09 allowed

2018-07-12 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19059 --- Comment #8 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/90ab1b325f26d08bd770cd9fd44bed085c775ad9 Fix Issue 19059 - Disallow `08` and `09` in integer literal

Re: Troubles creating templated inout objects

2018-07-12 Thread Timoses via Digitalmars-d-learn
On Thursday, 12 July 2018 at 12:22:34 UTC, Steven Schveighoffer wrote: On 7/11/18 8:55 AM, Timoses wrote: class TestA(T : T[]) {     Test!T[] arr;     // ERROR: Can't initialize inout variable in a for loop...     this(inout(T[]) arr) inout     {    

Re: Safe Memory Management and Ownership.

2018-07-12 Thread Chris M. via Digitalmars-d
On Wednesday, 11 July 2018 at 22:59:50 UTC, xray wrote: The message above is repost of : https://forum.dlang.org/post/pfjotkcazuiuhlvzi...@forum.dlang.org So I can reply to Chris M. here. -- Yes, Chris, I got inspired by Rust :)

Re: Copy Constructor DIP

2018-07-12 Thread Andrei Alexandrescu via Digitalmars-d
On 07/12/2018 09:49 AM, Atila Neves wrote: On Thursday, 12 July 2018 at 06:54:37 UTC, RazvanN wrote: [...] If by "come in pairs" you mean that you can define them both, then yes, that is the case. Will add a paragraph in the DIP to specify this. You mentioned that it's terrible that the

How to define syscall() in freebsd?

2018-07-12 Thread Brian via Digitalmars-d
the code is error: extern (C) nothrow @nogc size_t syscall(size_t ident); extern (C) nothrow @nogc size_t syscall(size_t ident, size_t arg0); extern (C) nothrow @nogc size_t syscall(size_t ident, long* arg0); long tid; syscall(SYS_thr_self, ); writeln(tid); Error: Function type does not match

Re: Copy Constructor DIP

2018-07-12 Thread Andrei Alexandrescu via Digitalmars-d
On 07/11/2018 12:19 PM, vit wrote: On Wednesday, 11 July 2018 at 07:40:32 UTC, RazvanN wrote: But there's a super explicit `@implicit` thing written right there... so should we expect that an *explicit* call to the copy constructor is not allowed? Or maybe it is allowed and `@implicit` is a

Re: Copy Constructor DIP

2018-07-12 Thread Andrei Alexandrescu via Digitalmars-d
On 07/11/2018 05:28 PM, Manu wrote: What's wrong with: struct S { this(ref S copyFrom); } That looks like a perfectly good copy constructor declaration ;) I'm just saying, the DIP needs to explain this. Thanks, worth a paragraph discussing silent semantics change. Right. This is all

Re: Copy Constructor DIP

2018-07-12 Thread Atila Neves via Digitalmars-d
On Thursday, 12 July 2018 at 06:54:37 UTC, RazvanN wrote: [...] If by "come in pairs" you mean that you can define them both, then yes, that is the case. Will add a paragraph in the DIP to specify this. You mentioned that it's terrible that the assignment operator and the copy constructor

Mixing struct and class subtypes with alias this and inheritance

2018-07-12 Thread Luís Marques via Digitalmars-d
You can define a struct subtype hierarchy by adding alias this declarations to each struct. Like this: S3 <: S2 <: S1 struct S3 { auto toS2() { return S2(); } alias toS2 this; } etc. You can also define a class subtype hierarchy by using class inheritance: C3 <: C2 <: C1

Re: Copy Constructor DIP

2018-07-12 Thread Andrei Alexandrescu via Digitalmars-d
On 07/12/2018 02:54 AM, RazvanN wrote: What's wrong with: struct S {   this(ref S copyFrom); } That looks like a perfectly good copy constructor declaration ;) I'm just saying, the DIP needs to explain this. That is actually a valid constructor, according to today's compiler. There might be

Re: Copy Constructor DIP

2018-07-12 Thread Andrei Alexandrescu via Digitalmars-d
On 07/11/2018 11:11 AM, Atila Neves wrote: On Wednesday, 11 July 2018 at 07:40:32 UTC, RazvanN wrote: But there's a super explicit `@implicit` thing written right there... so should we expect that an *explicit* call to the copy constructor is not allowed? Or maybe it is allowed and `@implicit`

Re: Copy Constructor DIP

2018-07-12 Thread Andrei Alexandrescu via Digitalmars-d
On 07/10/2018 06:50 PM, Manu wrote: On Tue, 10 Jul 2018 at 15:23, Jonathan M Davis via Digitalmars-d wrote: On Tuesday, 10 July 2018 14:58:09 MDT Manu via Digitalmars-d wrote: 2. It looks like copy constructors are used to perform assignments (and not constructions)... but, there is also

Re: Copy Constructor DIP

2018-07-12 Thread Andrei Alexandrescu via Digitalmars-d
On 07/10/2018 04:58 PM, Manu wrote: On Tue, 10 Jul 2018 at 03:50, RazvanN via Digitalmars-d wrote: Hi everyone! I managed to put together a first draft of the DIP for adding the copy constructor to the language [1]. If anyone is interested, please take a look. Suggestions and comments about

Re: Copy Constructor DIP

2018-07-12 Thread Andrei Alexandrescu via Digitalmars-d
On 07/11/2018 05:55 AM, Nick Treleaven wrote: On Tuesday, 10 July 2018 at 10:47:04 UTC, RazvanN wrote: [1] https://github.com/dlang/DIPs/pull/129 Thanks for making the DIP. I can't get this code to compile (my struct has an `int i` field): static foreach (i, ref field; src.tupleof)    

[OT] Dos making a comeback

2018-07-12 Thread Steven Schveighoffer via Digitalmars-d
On 7/10/18 2:37 AM, Walter Bright wrote: On 7/9/2018 6:50 PM, John Carter wrote: Nothing creates flaky and unreliable systems more than allowing them to wobble on past the first point where you already know that things are wrong. Things got so bad with real mode DOS development that I

Re: Sutter's ISO C++ Trip Report - The best compliment is when someone else steals your ideas....

2018-07-12 Thread Steven Schveighoffer via Digitalmars-d
On 7/10/18 6:59 PM, Jonathan M Davis wrote: On Tuesday, 10 July 2018 16:48:41 MDT Steven Schveighoffer via Digitalmars-d wrote: On 7/10/18 6:26 PM, Jonathan M Davis wrote: On Tuesday, 10 July 2018 13:21:28 MDT Timon Gehr via Digitalmars-d wrote: On 03.07.2018 06:54, Walter Bright wrote: ...

Re: Troubles creating templated inout objects

2018-07-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/12/18 4:58 AM, Timoses wrote: On Tuesday, 10 July 2018 at 14:34:55 UTC, Timoses wrote: `Unqual` in this case just turns `inout(int[])` into `inout(int)[]`, which is why it complains. That's a side effect of this example [...] See also: https://issues.dlang.org/show_bug.cgi?id=3567

[Issue 3567] std.traits: Unqual strips qualifiers on structs with references that would break const/immutable.

2018-07-12 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3567 Steven Schveighoffer changed: What|Removed |Added Summary|std.traits: Unqual doesn't |std.traits: Unqual strips

Re: Troubles creating templated inout objects

2018-07-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/11/18 8:55 AM, Timoses wrote: On Tuesday, 10 July 2018 at 18:01:59 UTC, Steven Schveighoffer wrote: You are overthinking :) inout typically is much easier than you expect, until you need to create temporary structs or types with inout members, then it becomes problematic.

Re: Update regarding the Nullable issue

2018-07-12 Thread FeepingCreature via Digitalmars-d-announce
On Thursday, 12 July 2018 at 08:54:17 UTC, Simen Kjærås wrote: Whether that means it's undefined behavior or the compiler should statically disallow it is up for debate, I guess. -- Simen Honestly, half the reason I'm using it so enthusiastically is that I want to emphasize that this is

[Issue 18979] Template constructor bypasses private

2018-07-12 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18979 RazvanN changed: What|Removed |Added CC||razvan.nitu1...@gmail.com --- Comment #1 from

Re: I have a plan.. I really DO

2018-07-12 Thread wjoe via Digitalmars-d-announce
On Tuesday, 10 July 2018 at 17:25:11 UTC, Yuxuan Shui wrote: (Although I don't quite agree with you. Some people DO resist change, that's why some decades old languages are still popular. But look at the popularity of new languages like Go, and Rust, and the ever-change landscape of front-end

  1   2   >