Re: Serialization/deserialization of templated class

2017-06-27 Thread Dmitry Solomennikov via Digitalmars-d
On Wednesday, 28 June 2017 at 05:01:17 UTC, Eugene Wissner wrote: On Wednesday, 28 June 2017 at 04:41:25 UTC, Dmitry Solomennikov wrote: Probably if you have serialized data, you convert strings to other types, so it may be possible to perfom if-checks: if (myDataIsStringAndDouble(data)) {

[Issue 14256] Poor IO performance on 64-bit dmd 2.066 (OS X)

2017-06-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14256 Jon Degenhardt changed: What|Removed |Added CC|

Re: Serialization/deserialization of templated class

2017-06-27 Thread Eugene Wissner via Digitalmars-d
On Wednesday, 28 June 2017 at 04:41:25 UTC, Dmitry Solomennikov wrote: Hi, guys! I have templated classes like this: class Some(T1) { T1 value; this(T1 _value){ value = _value; } } class Pair(T1, T2) { T1 first; T2 second; this(T1 _first, T2 _second){ first = _first;

Serialization/deserialization of templated class

2017-06-27 Thread Dmitry Solomennikov via Digitalmars-d
Hi, guys! I have templated classes like this: class Some(T1) { T1 value; this(T1 _value){ value = _value; } } class Pair(T1, T2) { T1 first; T2 second; this(T1 _first, T2 _second){ first = _first; second = _second; } } and a lot of serialised data, which I have to

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-27 Thread Moritz Maxeiner via Digitalmars-d-learn
On Wednesday, 28 June 2017 at 02:13:10 UTC, Jonathan M Davis wrote: On Wednesday, June 28, 2017 01:11:35 Moritz Maxeiner via Digitalmars-d-learn wrote: Not every class can't be finalized, so it might make sense for finalization to remain an available option. There are definitely cases where

Re: Checked vs unchecked exceptions

2017-06-27 Thread Moritz Maxeiner via Digitalmars-d
On Wednesday, 28 June 2017 at 02:09:40 UTC, Moritz Maxeiner wrote: --- static assert (throwsExactly!(foo, AException, BException)); void foo() { ... } --- One could even go a bit farther and implement a mixin template using `typeof(this)` and do: --- void foo() { mixin

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-27 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, June 28, 2017 01:11:35 Moritz Maxeiner via Digitalmars-d-learn wrote: > On Wednesday, 28 June 2017 at 00:05:20 UTC, Guillaume Piolat > > wrote: > > On Tuesday, 27 June 2017 at 23:54:50 UTC, Moritz Maxeiner wrote: > >> - Replace calls by the GC to `~this` with calls to `finalize` >

Re: Checked vs unchecked exceptions

2017-06-27 Thread Moritz Maxeiner via Digitalmars-d
On Wednesday, 28 June 2017 at 01:35:32 UTC, mckoder wrote: On Tuesday, 27 June 2017 at 22:56:47 UTC, Moritz Maxeiner wrote: You mean the very first time you want to call it and you don't know the exception set yourself by looking at its signature? Put the call in a nothrow scope and compile

Re: Checked vs unchecked exceptions

2017-06-27 Thread mckoder via Digitalmars-d
On Tuesday, 27 June 2017 at 22:56:47 UTC, Moritz Maxeiner wrote: You mean the very first time you want to call it and you don't know the exception set yourself by looking at its signature? Put the call in a nothrow scope and compile the module (which is fast in D), the compiler will then

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-27 Thread MysticZach via Digitalmars-d
On Wednesday, 28 June 2017 at 01:23:18 UTC, MysticZach wrote: On Tuesday, 27 June 2017 at 09:18:11 UTC, Olivier FAURE wrote: A bit late to the party, but I would recommend the following syntax: out (void; myTest) for argument-less tests. A casual reader would be less likely to see this

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-27 Thread MysticZach via Digitalmars-d
On Tuesday, 27 June 2017 at 09:18:11 UTC, Olivier FAURE wrote: A bit late to the party, but I would recommend the following syntax: out (void; myTest) for argument-less tests. A casual reader would be less likely to see this in code and think it's some sort of typo; it would be easier

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-27 Thread Moritz Maxeiner via Digitalmars-d-learn
On Wednesday, 28 June 2017 at 00:05:20 UTC, Guillaume Piolat wrote: On Tuesday, 27 June 2017 at 23:54:50 UTC, Moritz Maxeiner wrote: - Replace calls by the GC to `~this` with calls to `finalize` (or invent some cool other shortened name for the latter) My point is that in such a "finalize()"

Re: C++ Metaclasses proposal

2017-06-27 Thread Nicholas Wilson via Digitalmars-d
On Tuesday, 27 June 2017 at 15:57:01 UTC, Enamex wrote: PDF: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0707r0.pdf Reddit: https://www.reddit.com/r/programming/comments/6js4uv/metaclasses_in_c/ I thought a bit on possible patterns in D to accomplish the same without string

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Walter Bright via Digitalmars-d
On 6/27/2017 7:32 AM, Vladimir Panteleev wrote: As has been announced, DMD now has colorized syntax highlighting in error messages: http://forum.dlang.org/post/of9oao$230j$1...@digitalmars.com With 2.075's release near, now would be a good time to decide on a nice color palette that looks

Re: Relative lflag paths in dub on Windows

2017-06-27 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 28 June 2017 at 00:16:23 UTC, Mike Parker wrote: On Tuesday, 27 June 2017 at 19:07:49 UTC, You have to specify the appropriate linker option, e.g. -L-option. For gcc, that happens to -L, so you get -L-L. For optlink it's +something and for the MS linker it's /something. I'm on

Re: Relative lflag paths in dub on Windows

2017-06-27 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 27 June 2017 at 19:07:49 UTC, jmh530 wrote: Is it possible to set relative -L paths on dub for Windows? Absolute paths work fine, just can't get relative paths working. I was looking at the thread here https://forum.dlang.org/post/dkwqrwzwqbrnaamlv...@forum.dlang.org and came up

Re: Phobos PR in need of review/merge

2017-06-27 Thread Walter Bright via Digitalmars-d
On 6/27/2017 10:21 AM, Mike Wey wrote: On 27-06-17 08:49, Walter Bright wrote: You can also specifically request a review from one of Team Phobos: https://github.com/orgs/dlang/teams/team-phobos/members Just click on the [Reviwers] link. Is that page private? I get an 404 error, and i can't

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-27 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 27 June 2017 at 23:54:50 UTC, Moritz Maxeiner wrote: Do you mean destructors? Yes. - Replace calls by the GC to `~this` with calls to `finalize` (or invent some cool other shortened name for the latter) My point is that in such a "finalize()" function the only sane things to

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-27 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 27 June 2017 at 23:42:38 UTC, Guillaume Piolat wrote: On Tuesday, 27 June 2017 at 18:04:36 UTC, Moritz Maxeiner wrote: Well, technically speaking the `~this` for D classes *is* a finalizer that you may optionally manually call (e.g. via destroy). It would be nice, though, to

[Issue 17563] gc_inFinalizer should be public

2017-06-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17563 ponce changed: What|Removed |Added CC||alil...@gmail.com --- Comment #1

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-27 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 27 June 2017 at 18:04:36 UTC, Moritz Maxeiner wrote: Well, technically speaking the `~this` for D classes *is* a finalizer that you may optionally manually call (e.g. via destroy). It would be nice, though, to change class `~this` into a destructor and move the finalization into

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-27 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 27 June 2017 at 15:24:00 UTC, Steven Schveighoffer wrote: The GC still needs to call something to clean up non-memory resources, Well, I'd much prefer if the GC would simply not call destructors. Yes, destructor can work for _some_ resources, but because of ordering it also

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Sönke Ludwig via Digitalmars-d
Am 28.06.2017 um 01:24 schrieb Vladimir Panteleev: On Tuesday, 27 June 2017 at 23:18:18 UTC, Sönke Ludwig wrote: I mean if, by switching to more colors, we rule out few people, but are able to provide a much better value for the (presumed) majority of people with differently colored, but

[Issue 14758] TypeInfo causes excessive binary bloat

2017-06-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14758 --- Comment #17 from Mike --- GDC appears to have solved this problem by wrapping `TypeInfo.name` in a static variable. See https://github.com/D-Programming-GDC/GDC/pull/505#event-1141470083 I tested it on ARM Cortex-M and it

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Moritz Maxeiner via Digitalmars-d
On Tuesday, 27 June 2017 at 23:24:42 UTC, Vladimir Panteleev wrote: On Tuesday, 27 June 2017 at 23:18:18 UTC, Sönke Ludwig wrote: I mean if, by switching to more colors, we rule out few people, but are able to provide a much better value for the (presumed) majority of people with differently

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Moritz Maxeiner via Digitalmars-d
On Tuesday, 27 June 2017 at 23:18:18 UTC, Sönke Ludwig wrote: I mean if, by switching to more colors, we rule out few people, but are able to provide a much better value for the (presumed) majority of people with differently colored, but 256-color capable terminals, then it may still be worth

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Vladimir Panteleev via Digitalmars-d
On Tuesday, 27 June 2017 at 23:18:18 UTC, Sönke Ludwig wrote: I mean if, by switching to more colors, we rule out few people, but are able to provide a much better value for the (presumed) majority of people with differently colored, but 256-color capable terminals, then it may still be worth

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread deadalnix via Digitalmars-d
On Tuesday, 27 June 2017 at 19:43:03 UTC, Vladimir Panteleev wrote: On Tuesday, 27 June 2017 at 19:39:25 UTC, deadalnix wrote: Please, please, please, just do the same as clang. I don't think clang has this feature, so doing the same as clang would be a regression. We're in uncharted waters!

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Sönke Ludwig via Digitalmars-d
Am 28.06.2017 um 00:44 schrieb Vladimir Panteleev: On Tuesday, 27 June 2017 at 22:34:39 UTC, Sönke Ludwig wrote: I was specifically trying to steer away from a random propose-and-comment approach, because I think we can do a lot better if we first reduce the size of the design space using

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-27 Thread Moritz Maxeiner via Digitalmars-d
On Tuesday, 27 June 2017 at 22:45:17 UTC, Mark wrote: On Tuesday, 20 June 2017 at 11:57:55 UTC, Mike Parker wrote: DIP 1009 is titled "Improve Contract Usability". [...] Veering a bit off topic,the compiler doesn't treat contracts any different from other code, does it? For instance,

Re: Checked vs unchecked exceptions

2017-06-27 Thread Moritz Maxeiner via Digitalmars-d
On Tuesday, 27 June 2017 at 21:47:49 UTC, jag wrote: On Tuesday, 27 June 2017 at 19:37:24 UTC, Moritz Maxeiner wrote: As I have pointed out, your example occurs on the *caller* side, not the *callee* side. The proper solution is not for the callee to specify which exceptions it may throw,

Re: Checked vs unchecked exceptions

2017-06-27 Thread Jesse Phillips via Digitalmars-d
On Tuesday, 27 June 2017 at 06:10:52 UTC, Tobias Müller wrote: I honestly don't understand how people that care a great deal about expressive type systems can be so opposed to checked exceptions. After all they wouldn't use 'object' for everything either. Tobi I think there is a threshold.

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-27 Thread Mark via Digitalmars-d
On Tuesday, 20 June 2017 at 11:57:55 UTC, Mike Parker wrote: DIP 1009 is titled "Improve Contract Usability". [...] Veering a bit off topic,the compiler doesn't treat contracts any different from other code, does it? For instance, consider: int foo() out(result; result>0) { // whatever }

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Vladimir Panteleev via Digitalmars-d
On Tuesday, 27 June 2017 at 22:34:39 UTC, Sönke Ludwig wrote: I was specifically trying to steer away from a random propose-and-comment approach, because I think we can do a lot better if we first reduce the size of the design space using objective measures. If we can agree to some extent that

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Sönke Ludwig via Digitalmars-d
Am 28.06.2017 um 00:19 schrieb Vladimir Panteleev: On Tuesday, 27 June 2017 at 22:12:42 UTC, Sönke Ludwig wrote: [...] (snip - as it boils down to needing a concrete proposal) I was specifically trying to steer away from a random propose-and-comment approach, because I think we can do a

Re: Go 1.9

2017-06-27 Thread bachmeier via Digitalmars-d
On Tuesday, 27 June 2017 at 02:40:37 UTC, jmh530 wrote: On Tuesday, 27 June 2017 at 02:38:31 UTC, bachmeier wrote: I'll post here after updating and testing the embedr package. Great. I'll give it a go again when it's ready. You can try this: https://bitbucket.org/bachmeil/embedrwin It's

[Issue 17322] Add Magikcraft to organizations using D

2017-06-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17322 --- Comment #3 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dlang.org https://github.com/dlang/dlang.org/commit/994de8bf4535b9e61fa12ac20e65617db6d20083 Fix Issue 17322 - Add Magikcraft to organizations

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Vladimir Panteleev via Digitalmars-d
On Tuesday, 27 June 2017 at 22:12:42 UTC, Sönke Ludwig wrote: [...] (snip - as it boils down to needing a concrete proposal) But it seems like the solution for that is to use saturated colors for everything. There are also some examples that clearly don't work on a white background, such as

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Sönke Ludwig via Digitalmars-d
Am 27.06.2017 um 23:45 schrieb Vladimir Panteleev: On Tuesday, 27 June 2017 at 21:10:37 UTC, Sönke Ludwig wrote: Intended to be more of the latter, especially as a consequence of the readability concern. The typical colorful syntax highlighting that is often used (lets say like the Monokai

[Issue 6227] Comparison of different enums

2017-06-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6227 --- Comment #5 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dlang.org https://github.com/dlang/dlang.org/commit/a89e677820f4ce16d4645a153884b824870e4820 Deprecation: Issue 6227 - Comparison of different

Re: Using templates with interfaces

2017-06-27 Thread Andrew Chapman via Digitalmars-d-learn
On Sunday, 25 June 2017 at 17:30:58 UTC, Petar Kirov [ZombineDev] wrote: On Sunday, 25 June 2017 at 13:32:57 UTC, Andrew Chapman wrote: I think you've answered the question with "You cannot have unimplemented templates in interfaces". Thanks for the answer. I'll rethink the way I'm doing

[Issue 17560] Enhancement: view and copy full code example for offline compile/play

2017-06-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17560 greensunn...@gmail.com changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|INVALID

Re: Checked vs unchecked exceptions

2017-06-27 Thread jag via Digitalmars-d
On Tuesday, 27 June 2017 at 19:37:24 UTC, Moritz Maxeiner wrote: As I have pointed out, your example occurs on the *caller* side, not the *callee* side. The proper solution is not for the callee to specify which exceptions it may throw, but for the caller to specify which exceptions it

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Vladimir Panteleev via Digitalmars-d
On Tuesday, 27 June 2017 at 21:10:37 UTC, Sönke Ludwig wrote: Intended to be more of the latter, especially as a consequence of the readability concern. The typical colorful syntax highlighting that is often used (lets say like the Monokai theme), starts to break down when it isn't used within

Re: Phobos PR in need of review/merge

2017-06-27 Thread Dukc via Digitalmars-d
On Tuesday, 27 June 2017 at 19:40:52 UTC, Brad Roberts wrote: There's a very good reason to leave requests open: a closed request is gone, never to be seen again. Well explained. So I quess that next time I should just leave a post there that I'm abandoning it. After many pings and a

[Issue 17562] Tangent function returns NaN for abs(input) >= 2^63

2017-06-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17562 --- Comment #1 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/0fb66f092b897b55318509c6582008b3f912311a Fix issue 17562 - tan returning -nan for inputs where

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Sönke Ludwig via Digitalmars-d
Am 27.06.2017 um 22:35 schrieb Vladimir Panteleev: On Tuesday, 27 June 2017 at 20:19:14 UTC, Sönke Ludwig wrote: I would argue pretty strongly that this should be toned down as much as possible. From the perspective of a personal preference, or an objective analysis? It sounds like the former

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Vladimir Panteleev via Digitalmars-d
On Tuesday, 27 June 2017 at 20:19:14 UTC, Sönke Ludwig wrote: I would argue pretty strongly that this should be toned down as much as possible. From the perspective of a personal preference, or an objective analysis? It sounds like the former but isn't worded as one. All example schemes in

Re: Deprecated std.c.*.socket and missing replacement

2017-06-27 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Tuesday, 27 June 2017 at 19:22:02 UTC, Steven Schveighoffer wrote: Just delete the duplicate symbol, and add public imports of the other module symbols. e.g.: public import core.sys.posix.netinet.in_: IP_ADD_MEMBERSHIP; -Steve Great. Will do.

Re: Phobos PR in need of review/merge

2017-06-27 Thread Steven Schveighoffer via Digitalmars-d
On 6/27/17 3:54 PM, Seb wrote: On Tuesday, 27 June 2017 at 19:15:46 UTC, Steven Schveighoffer wrote: It's actually hard to figure out how github looks from a non-member account when you are a member, because you need a separate github login. Private/In-cognito tab? github doesn't always

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Sönke Ludwig via Digitalmars-d
Am 27.06.2017 um 16:32 schrieb Vladimir Panteleev: As has been announced, DMD now has colorized syntax highlighting in error messages: http://forum.dlang.org/post/of9oao$230j$1...@digitalmars.com With 2.075's release near, now would be a good time to decide on a nice color palette that looks

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 27 June 2017 at 17:11:32 UTC, H. S. Teoh wrote: The cardinal rule of color selection: NEVER only set the foreground color or the background color alone. Fun fact: this is why terminal.d's api is `color(fg, bg)` instead of foregroundColor and backgroundColor independently. But, I

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 27 June 2017 at 17:41:35 UTC, qznc wrote: I'm one of the rare people who use a light background in my terminal (like 99% of websites). It seems only dark backgrounds are considered, which is understandable. I also use light backgrounds... so I'm advocating for the light bg

Re: Phobos PR in need of review/merge

2017-06-27 Thread Seb via Digitalmars-d
On Tuesday, 27 June 2017 at 19:15:46 UTC, Steven Schveighoffer wrote: On 6/27/17 1:21 PM, Mike Wey wrote: On 27-06-17 08:49, Walter Bright wrote: You can also specifically request a review from one of Team Phobos: https://github.com/orgs/dlang/teams/team-phobos/members Just click on the

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-27 Thread bauss via Digitalmars-d-learn
On Tuesday, 27 June 2017 at 10:14:16 UTC, Jonathan M Davis wrote: On Tuesday, June 27, 2017 09:54:19 John Burton via Digitalmars-d-learn wrote: [...] Arguably, std.socket should have used structs instead of classes for sockets for precisely this reason (though there are some advantages in

Re: What are the unused but useful feature you know in D?

2017-06-27 Thread Moritz Maxeiner via Digitalmars-d
On Tuesday, 27 June 2017 at 19:06:19 UTC, Random D user wrote: On Monday, 26 June 2017 at 22:17:00 UTC, Moritz Maxeiner wrote: Except Rust is in exactly the same boat as D, because the same issues that apply to `@trusted` apply to `unsafe`, as well. Hmmm, I guess that's true. I don't really

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Vladimir Panteleev via Digitalmars-d
On Tuesday, 27 June 2017 at 19:39:25 UTC, deadalnix wrote: Please, please, please, just do the same as clang. I don't think clang has this feature, so doing the same as clang would be a regression. We're in uncharted waters!

Re: Phobos PR in need of review/merge

2017-06-27 Thread Brad Roberts via Digitalmars-d
On 6/27/17 11:09 AM, Dukc via Digitalmars-d wrote: But there is just no reason I see to keep a request in "alive" state if I don't check it actively anymore. The closed pr can be opened later if I or someone else wishes to push for it again. There's a very good reason to leave requests open:

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread deadalnix via Digitalmars-d
On Tuesday, 27 June 2017 at 14:32:28 UTC, Vladimir Panteleev wrote: As has been announced, DMD now has colorized syntax highlighting in error messages: http://forum.dlang.org/post/of9oao$230j$1...@digitalmars.com With 2.075's release near, now would be a good time to decide on a nice color

Re: Checked vs unchecked exceptions

2017-06-27 Thread Moritz Maxeiner via Digitalmars-d
On Tuesday, 27 June 2017 at 18:14:47 UTC, jag wrote: As Tobias mentioned, there are safety implications to "auto" behavior. In the example below I am using C# and its "var" feature: [...] Your example uses variable type inference, which happens on the *caller* side, *not* the *callee*

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Random D user via Digitalmars-d
On Tuesday, 27 June 2017 at 18:42:45 UTC, Vladimir Panteleev wrote: On Tuesday, 27 June 2017 at 18:41:00 UTC, Random D user wrote: What ever you do, please don't use extreme high intensity colors like red(255,0,0), green (0,255,0) or blue (0,0,255). That's up to the terminal (or your

Re: Deprecated std.c.*.socket and missing replacement

2017-06-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/27/17 2:12 PM, Sebastiaan Koppe wrote: On Tuesday, 27 June 2017 at 17:58:29 UTC, Jonathan M Davis wrote: Why would you need to remove anything from Phobos? The enum in question is in a deprecated module. All that should need to happen is that the enum be added to the appropriate module in

Re: Phobos PR in need of review/merge

2017-06-27 Thread Steven Schveighoffer via Digitalmars-d
On 6/27/17 1:21 PM, Mike Wey wrote: On 27-06-17 08:49, Walter Bright wrote: You can also specifically request a review from one of Team Phobos: https://github.com/orgs/dlang/teams/team-phobos/members Just click on the [Reviwers] link. Is that page private? I get an 404 error, and i can't

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/27/17 2:04 PM, Moritz Maxeiner wrote: On Tuesday, 27 June 2017 at 15:24:00 UTC, Steven Schveighoffer wrote: On 6/27/17 9:25 AM, Guillaume Piolat wrote: On Tuesday, 27 June 2017 at 13:11:10 UTC, Steven Schveighoffer wrote: But I would use a close method, and not destroy(obj). The reason is

Re: Phobos PR in need of review/merge

2017-06-27 Thread Meta via Digitalmars-d
On Tuesday, 27 June 2017 at 18:09:01 UTC, Dukc wrote: I think the issue here is that I don't remind often enough that I'm still waiting, or I do it at wrong place. What is the convention here? The convention is to spend a lot of time waiting and pinging people until it finally gets merged. I

Re: What are the unused but useful feature you know in D?

2017-06-27 Thread Random D user via Digitalmars-d
On Monday, 26 June 2017 at 22:17:00 UTC, Moritz Maxeiner wrote: On Monday, 26 June 2017 at 18:47:18 UTC, Random D user wrote: Anyway, I think we could just have a compile time switch for defaults. Imagine having n libraries with pairwise different required defaults used in your application.

Relative lflag paths in dub on Windows

2017-06-27 Thread jmh530 via Digitalmars-d-learn
Is it possible to set relative -L paths on dub for Windows? Absolute paths work fine, just can't get relative paths working. I was looking at the thread here https://forum.dlang.org/post/dkwqrwzwqbrnaamlv...@forum.dlang.org and came up with something like { ... "lflags":

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Vladimir Panteleev via Digitalmars-d
On Tuesday, 27 June 2017 at 18:41:00 UTC, Random D user wrote: What ever you do, please don't use extreme high intensity colors like red(255,0,0), green (0,255,0) or blue (0,0,255). That's up to the terminal (or your configuration of it). Without making many assumptions, console applications

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Random D user via Digitalmars-d
On Tuesday, 27 June 2017 at 14:32:28 UTC, Vladimir Panteleev wrote: With 2.075's release near, now would be a good time to decide on a nice color palette that looks fine on most terminals. So, please vote: What ever you do, please don't use extreme high intensity colors like red(255,0,0),

Re: Checked vs unchecked exceptions

2017-06-27 Thread jag via Digitalmars-d
As Tobias mentioned, there are safety implications to "auto" behavior. In the example below I am using C# and its "var" feature: class A { public static Employee getFoo() { return getPoorPerformingEmployee(); } } This is your code, in which you are calling A which was written by

Re: Phobos PR in need of review/merge

2017-06-27 Thread Dukc via Digitalmars-d
On Tuesday, 27 June 2017 at 07:07:02 UTC, Seb wrote: Recently [1] I deployed the first iteration of a daily cronjob for the Dlang-Bot Good idea, definitely worth trying.

Re: Deprecated std.c.*.socket and missing replacement

2017-06-27 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Tuesday, 27 June 2017 at 17:58:29 UTC, Jonathan M Davis wrote: Why would you need to remove anything from Phobos? The enum in question is in a deprecated module. All that should need to happen is that the enum be added to the appropriate module in druntime, and then any code that uses it

[Issue 6880] Heisenbug: deferred crash when writing to stdout on Windows without console.

2017-06-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6880 --- Comment #8 from Vladimir Panteleev --- As I understand, what happens here is: 1. The program starts, and writes data to stdout / stderr 2. The data goes into the C FILE* buffer 3. When the buffer fills up, the

Re: Phobos PR in need of review/merge

2017-06-27 Thread Dukc via Digitalmars-d
On Tuesday, 27 June 2017 at 01:35:31 UTC, Meta wrote: Recently, a pull request was closed out of frustration by the submitter: https://github.com/dlang/phobos/pull/5309 Topic reporting for duty :) I have no hard feelings about this... I just want to collect my garbage when my requests stall.

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-27 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 27 June 2017 at 15:24:00 UTC, Steven Schveighoffer wrote: On 6/27/17 9:25 AM, Guillaume Piolat wrote: On Tuesday, 27 June 2017 at 13:11:10 UTC, Steven Schveighoffer wrote: But I would use a close method, and not destroy(obj). The reason is because often times, you have wrapper

Re: Deprecated std.c.*.socket and missing replacement

2017-06-27 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, June 27, 2017 3:46:39 PM MDT Sebastiaan Koppe via Digitalmars-d- learn wrote: > On Tuesday, 27 June 2017 at 11:16:17 UTC, Jonathan M Davis wrote: > > Create a PR to add it to druntime and/or define it in your own > > code. > > > > - Jonathan M Davis > > Creating a PR sounds reasonable.

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Vladimir Panteleev via Digitalmars-d
On Tuesday, 27 June 2017 at 17:41:35 UTC, qznc wrote: Is there a way to do this globally? For example, a config file or an environment variable? I believe you can add -color=off to DFLAGS in sc.ini / dmd.conf. It seems only dark backgrounds are considered, which is understandable. Not

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Vladimir Panteleev via Digitalmars-d
On Tuesday, 27 June 2017 at 17:28:42 UTC, H. S. Teoh wrote: I've seen complaints from people who have black-on-white terminals (or vice versa) finding some programs producing unreadable text because the program set the foreground color to black without also setting the background. Of course,

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread qznc via Digitalmars-d
On Tuesday, 27 June 2017 at 14:32:28 UTC, Vladimir Panteleev wrote: - Yes, not everyone likes colors. You can turn all colors off with a command-line switch. Is there a way to do this globally? For example, a config file or an environment variable? I'm one of the rare people who use a light

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread H. S. Teoh via Digitalmars-d
On Tue, Jun 27, 2017 at 05:24:46PM +, Vladimir Panteleev via Digitalmars-d wrote: > On Tuesday, 27 June 2017 at 17:11:32 UTC, H. S. Teoh wrote: > > The cardinal rule of color selection: NEVER only set the foreground > > color or the background color alone. ALWAYS set both, otherwise you > >

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Vladimir Panteleev via Digitalmars-d
On Tuesday, 27 June 2017 at 17:32:23 UTC, FoxyBrown wrote: This will be a nightmare if you do not allow it to be configurable! Hard coding anything is very bad when others are will use it. Make a default color scheme that works for the majority as you are, but then allow it to be easily

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread FoxyBrown via Digitalmars-d
On Tuesday, 27 June 2017 at 14:32:28 UTC, Vladimir Panteleev wrote: As has been announced, DMD now has colorized syntax highlighting in error messages: http://forum.dlang.org/post/of9oao$230j$1...@digitalmars.com With 2.075's release near, now would be a good time to decide on a nice color

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread Vladimir Panteleev via Digitalmars-d
On Tuesday, 27 June 2017 at 17:11:32 UTC, H. S. Teoh wrote: The cardinal rule of color selection: NEVER only set the foreground color or the background color alone. ALWAYS set both, otherwise you will get invisible text (or barely-visible text, like yellow on white) on somebody's terminal, and

Re: Phobos PR in need of review/merge

2017-06-27 Thread Mike Wey via Digitalmars-d
On 27-06-17 08:49, Walter Bright wrote: You can also specifically request a review from one of Team Phobos: https://github.com/orgs/dlang/teams/team-phobos/members Just click on the [Reviwers] link. Is that page private? I get an 404 error, and i can't find the page on github. -- Mike Wey

Re: Checked vs unchecked exceptions

2017-06-27 Thread Moritz Maxeiner via Digitalmars-d
On Tuesday, 27 June 2017 at 16:01:37 UTC, mckoder wrote: On Tuesday, 27 June 2017 at 11:40:02 UTC, Moritz Maxeiner wrote: It's not at all bad code to write things down that the compiler could infer, quite the opposite. Of course it is bad, because the compiler can do it better (no chance

Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread H. S. Teoh via Digitalmars-d
On Tue, Jun 27, 2017 at 02:32:28PM +, Vladimir Panteleev via Digitalmars-d wrote: > As has been announced, DMD now has colorized syntax highlighting in > error messages: > > http://forum.dlang.org/post/of9oao$230j$1...@digitalmars.com > > With 2.075's release near, now would be a good time

Re: Checked vs unchecked exceptions

2017-06-27 Thread Sebastien Alaiwan via Digitalmars-d
On Tuesday, 27 June 2017 at 10:18:04 UTC, mckoder wrote: "I think that the belief that everything needs strong static (compile-time) checking is an illusion; it seems like it will buy you more than it actually does. But this is a hard thing to see if you are coming from a statically-typed

[Issue 15082] Output of process is not captured on Win64

2017-06-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15082 Vladimir Panteleev changed: What|Removed |Added Status|NEW

[Issue 17562] Tangent function returns NaN for abs(input) >= 2^63

2017-06-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17562 Vladimir Panteleev changed: What|Removed |Added Keywords||pull

[Issue 15982] std.array.array treats dynamic arrays as input ranges and allocates new memory

2017-06-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15982 Vladimir Panteleev changed: What|Removed |Added Status|NEW

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/27/17 12:16 PM, Steven Schveighoffer wrote: On 6/27/17 11:24 AM, Steven Schveighoffer wrote: On 6/27/17 9:25 AM, Guillaume Piolat wrote: That's how the GC-proof resource class came to existence, after many destruction bugs, and it let's you use the GC as a detector for

[Issue 17563] New: gc_inFinalizer should be public

2017-06-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17563 Issue ID: 17563 Summary: gc_inFinalizer should be public Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/27/17 11:24 AM, Steven Schveighoffer wrote: On 6/27/17 9:25 AM, Guillaume Piolat wrote: That's how the GC-proof resource class came to existence, after many destruction bugs, and it let's you use the GC as a detector for non-deterministic destruction. I miss it in @nogc :)

Re: Checked vs unchecked exceptions

2017-06-27 Thread mckoder via Digitalmars-d
On Tuesday, 27 June 2017 at 11:40:02 UTC, Moritz Maxeiner wrote: It's not at all bad code to write things down that the compiler could infer, quite the opposite. Of course it is bad, because the compiler can do it better (no chance for a wrong exception set sans compiler bugs) and faster

C++ Metaclasses proposal

2017-06-27 Thread Enamex via Digitalmars-d
PDF: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0707r0.pdf Reddit: https://www.reddit.com/r/programming/comments/6js4uv/metaclasses_in_c/ I thought a bit on possible patterns in D to accomplish the same without string mixins. For example, defining the prototype `Foo_` then

Re: D error messages for function call mismatches

2017-06-27 Thread FoxyBrown via Digitalmars-d
On Tuesday, 27 June 2017 at 15:01:41 UTC, Adam D. Ruppe wrote: On Tuesday, 27 June 2017 at 14:29:05 UTC, FoxyBrown wrote: D's error messaging is terrible in some ways. I am trying to get some code to work and this is the error: I agree, that error message is terrible, and that's why I have a

Re: Deprecated std.c.*.socket and missing replacement

2017-06-27 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Tuesday, 27 June 2017 at 11:16:17 UTC, Jonathan M Davis wrote: Create a PR to add it to druntime and/or define it in your own code. - Jonathan M Davis Creating a PR sounds reasonable. But I would have to create one PR to remove them from phobos and one PR to add them to druntime, right?

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/27/17 9:25 AM, Guillaume Piolat wrote: On Tuesday, 27 June 2017 at 13:11:10 UTC, Steven Schveighoffer wrote: But I would use a close method, and not destroy(obj). The reason is because often times, you have wrapper types around your socket type, and just one extra level of indirection

Re: Clean Executable

2017-06-27 Thread bauss via Digitalmars-d-learn
On Tuesday, 27 June 2017 at 14:21:50 UTC, FoxyBrown wrote: How can we clean an exe from the junk library functions that are not actually used by an app. e.g., a hello world program shouldn't be 500+kb. I release there are necessary extras like the GC, but hell, in a hello world program is it

Re: Clean Executable

2017-06-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 27 June 2017 at 14:21:50 UTC, FoxyBrown wrote: Does Writeln even use the GC to display a single string? Not if all goes well, but a good chunk of the library is loaded to handle various situations. It might call a GC function if there's no stdout. Take a look at this:

  1   2   >