[Issue 18854] New: std.allocator: StatsCollector counts failed deallocations

2018-05-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18854 Issue ID: 18854 Summary: std.allocator: StatsCollector counts failed deallocations Product: D Version: D2 Hardware: All OS: All Status: NEW

Re: Sealed classes - would you want them in D?

2018-05-11 Thread KingJoffrey via Digitalmars-d
On Saturday, 12 May 2018 at 00:39:29 UTC, Mike Parker wrote: Again, they're in the same module. From an encapsulation stand point, what does it matter that private members are within or without any specific set of curly braces? It only matters if you want to adhere to a purely conceptual

Re: Sealed classes - would you want them in D?

2018-05-11 Thread Neia Neutuladh via Digitalmars-d
On Friday, 11 May 2018 at 14:05:25 UTC, KingJoffrey wrote: private is not private at all in D, and because of this, classes are fundamentally broken in D (by design apparently). I find this amusing because D does things exactly like Java. In Java, two sibling nested classes can call private

Re: Sealed classes - would you want them in D?

2018-05-11 Thread rikki cattermole via Digitalmars-d
On 12/05/2018 3:02 PM, KingJoffrey wrote: On Saturday, 12 May 2018 at 00:39:29 UTC, Mike Parker wrote: Again, they're in the same module. From an encapsulation stand point, what does it matter that private members are within or without any specific set of curly braces? It only matters if you

Re: Simple web server benchmark - vibe.d is slower than node.js and Go?

2018-05-11 Thread Joakim via Digitalmars-d
On Friday, 11 May 2018 at 23:24:32 UTC, Arun Chandrasekaran wrote: On Friday, 11 May 2018 at 07:56:04 UTC, Daniel Kozak wrote: [...] siege makes a difference. Earlier I had two chrome windows open and I just tried a simple GET from each, with a considerable delay and I saw the same thread

Re: Sealed classes - would you want them in D?

2018-05-11 Thread KingJoffrey via Digitalmars-d
On Friday, 11 May 2018 at 19:30:51 UTC, bauss wrote: It's a problem to you, but not to me and I'm sure many others in the D community can agree that private being module level has a lot of benefits over private being "class-level". These are the benefit I can see: - it encourages more

Re: Simple web server benchmark - vibe.d is slower than node.js and Go?

2018-05-11 Thread Arun Chandrasekaran via Digitalmars-d
On Friday, 11 May 2018 at 07:56:04 UTC, Daniel Kozak wrote: On Wednesday, 9 May 2018 at 22:37:22 UTC, Arun Chandrasekaran wrote: [...] I have change my example a little: case "/": res.writeBody("Hello World " ~ to!string(thisThreadID), "text/plain"); And I get this (siege -p -c15 0b -t

Re: Sealed classes - would you want them in D?

2018-05-11 Thread H. S. Teoh via Digitalmars-d
On Fri, May 11, 2018 at 04:14:43PM -0700, Walter Bright via Digitalmars-d wrote: > On 5/10/2018 6:22 AM, Piotr Mitana wrote: > > For those who never coded Scala and don't know sealed classes: a > > sealed class is a class which can be only extended in the same > > source file. > > > >     sealed

Re: Sealed classes - would you want them in D?

2018-05-11 Thread Jonathan M Davis via Digitalmars-d
On Friday, May 11, 2018 16:14:43 Walter Bright via Digitalmars-d wrote: > On 5/10/2018 6:22 AM, Piotr Mitana wrote: > > For those who never coded Scala and don't know sealed classes: a sealed > > class is a class which can be only extended in the same source file. > > > > sealed class MyClass

Re: iopipe v0.0.4 - RingBuffers!

2018-05-11 Thread Dmitry Olshansky via Digitalmars-d-announce
On Friday, 11 May 2018 at 13:28:58 UTC, Steven Schveighoffer wrote: On 5/11/18 1:30 AM, Dmitry Olshansky wrote: On Thursday, 10 May 2018 at 23:22:02 UTC, Steven Schveighoffer wrote: OK, so at dconf I spoke with a few very smart guys about how I can use mmap to make a zero-copy buffer. And I

Re: Sealed classes - would you want them in D?

2018-05-11 Thread H. S. Teoh via Digitalmars-d
On Fri, May 11, 2018 at 05:28:48PM -0600, Jonathan M Davis via Digitalmars-d wrote: > [...] what the OP wants is to have the class be publicly available > while restricting who's allowed to derive from it, with the idea that > a particular class hierarchy would have a well-defined set of classes

Re: iopipe v0.0.4 - RingBuffers!

2018-05-11 Thread Uknown via Digitalmars-d-announce
On Friday, 11 May 2018 at 23:46:16 UTC, Dmitry Olshansky wrote: On Friday, 11 May 2018 at 13:28:58 UTC, Steven Schveighoffer wrote: On 5/11/18 1:30 AM, Dmitry Olshansky wrote: On Thursday, 10 May 2018 at 23:22:02 UTC, Steven Schveighoffer wrote: grep on Mac is a piece of sheat, sadly and I

Re: Sealed classes - would you want them in D?

2018-05-11 Thread ketmar via Digitalmars-d
H. S. Teoh wrote: On Fri, May 11, 2018 at 05:28:48PM -0600, Jonathan M Davis via Digitalmars-d wrote: [...] what the OP wants is to have the class be publicly available while restricting who's allowed to derive from it, with the idea that a particular class hierarchy would have a well-defined

Re: Sealed classes - would you want them in D?

2018-05-11 Thread ketmar via Digitalmars-d
H. S. Teoh wrote: p.s. and struct with `alias this` will allow us to extend it with fields too. not without using some other tricks, of course, but as there is a documented and ligitimate way to workaround any "sealing", i myself see a little sense in such feature. the only thing it will be

Re: Sealed classes - would you want them in D?

2018-05-11 Thread Mike Parker via Digitalmars-d
On Friday, 11 May 2018 at 19:45:10 UTC, rumbu wrote: The first example is unit testing. Having access to the private members of a class inside the same module is a mistake because it breaks the idea of encapsulation. Unit testing must be done exclusively on public members of a class. If you

Re: Sealed classes - would you want them in D?

2018-05-11 Thread Tony via Digitalmars-d
On Friday, 11 May 2018 at 03:32:25 UTC, Uknown wrote: Also, classes are pretty inconvenient because they are hard to use without the GC. I find it surprising that a language that had Garbage Collection as one of its' key features, now has that feature looked at as an inconvenience. Was it a

Re: Sealed classes - would you want them in D?

2018-05-11 Thread Piotr Mitana via Digitalmars-d
On Thursday, 10 May 2018 at 14:48:23 UTC, rikki cattermole wrote: module foo; class A { } final class B : A {    } in one module, he wants to be able to create a new final class C : B {    } and keep class B as final so that no one else can extend it in another module. Not entirely.

Re: Simple web server benchmark - vibe.d is slower than node.js and Go?

2018-05-11 Thread Daniel Kozak via Digitalmars-d
On Wednesday, 9 May 2018 at 22:37:22 UTC, Arun Chandrasekaran wrote: That could be the reason for slowness. Ubuntu 17.10 64 bit, DMD v2.079.1, E7-4860, 8 core 32 GB RAM. With slight modifcaition to capture the timestamp of the request on the server: import std.datetime.systime : Clock;

Re: Sealed classes - would you want them in D?

2018-05-11 Thread rikki cattermole via Digitalmars-d
On 11/05/2018 8:00 PM, Tony wrote: On Friday, 11 May 2018 at 03:32:25 UTC, Uknown wrote: Also, classes are pretty inconvenient because they are hard to use without the GC. I find it surprising that a language that had Garbage Collection as one of its' key features, now has that feature

errno is not nothrow

2018-05-11 Thread Shachar Shemesh via Digitalmars-d
At least under Linux, you cannot get or set the value of errno from a nothrow function. Is this on purpose, or is this a bug? Shachar

[Issue 18829] pragma msg of int incoherent

2018-05-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18829 --- Comment #1 from Oliver Rümpelein --- Here is an example, with the problematic line 14 commented out: https://run.dlang.io/is/xzgt0E This fails with all primitive types. I would expect the last line to just print "int", or give a

[Issue 18853] New: std.allocator: AllocatorList fails to allocate after a deallocation

2018-05-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18853 Issue ID: 18853 Summary: std.allocator: AllocatorList fails to allocate after a deallocation Product: D Version: D2 Hardware: All OS: All Status: NEW

[Issue 15246] Destructor inheritance doesn't inherit attributes properly

2018-05-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15246 --- Comment #18 from ponce --- Hopefully fixed in ProtoObject! ;) --

Re: iopipe v0.0.4 - RingBuffers!

2018-05-11 Thread Kagamin via Digitalmars-d-announce
On Thursday, 10 May 2018 at 23:22:02 UTC, Steven Schveighoffer wrote: However, I am struggling to find a use case for this that showcases why you would want to use it. While it does work, and works beautifully, it doesn't show any measurable difference vs. the array allocated buffer that

Re: Sealed classes - would you want them in D?

2018-05-11 Thread KingJoffrey via Digitalmars-d
On Friday, 11 May 2018 at 09:47:39 UTC, Dukc wrote: On Friday, 11 May 2018 at 04:43:09 UTC, KingJoffrey wrote: On Friday, 11 May 2018 at 03:32:25 UTC, Uknown wrote: `private` is for outside the module. Within the module, private is not applied because D wanted to avoid C++'s `friend`

Re: Sealed classes - would you want them in D?

2018-05-11 Thread KingJoffrey via Digitalmars-d
On Friday, 11 May 2018 at 10:43:19 UTC, rikki cattermole wrote: Classes are expensive, not everybody wants to pay for what it gives in all situations. Mmm...that claim is so broad is to be meaningless. Good memory allocation algorithms, intelligent optimising compilers/runtimes, prudent use

Re: Building dmd/druntime on windows issue

2018-05-11 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 10 May 2018 at 22:01:25 UTC, Seb wrote: On Thursday, 10 May 2018 at 18:38:30 UTC, Andre Pany wrote: Hi, I follow the instructions from the wiki to build dmd/druntime from source on windows. https://wiki.dlang.org/Building_under_Windows [...] Which DMD/druntime do you try to

Re: Simple web server benchmark - vibe.d is slower than node.js and Go?

2018-05-11 Thread Daniel Kozak via Digitalmars-d
On Friday, 11 May 2018 at 07:56:04 UTC, Daniel Kozak wrote: On Wednesday, 9 May 2018 at 22:37:22 UTC, Arun Chandrasekaran wrote: [...] I have change my example a little: case "/": res.writeBody("Hello World " ~ to!string(thisThreadID), "text/plain"); And I get this (siege -p -c15 0b -t

Re: Sealed classes - would you want them in D?

2018-05-11 Thread Dukc via Digitalmars-d
On Friday, 11 May 2018 at 04:43:09 UTC, KingJoffrey wrote: On Friday, 11 May 2018 at 03:32:25 UTC, Uknown wrote: `private` is for outside the module. Within the module, private is not applied because D wanted to avoid C++'s `friend` functions. 'private' is "meant" to be part of the

Re: iopipe v0.0.4 - RingBuffers!

2018-05-11 Thread Dmitry Olshansky via Digitalmars-d-announce
On Friday, 11 May 2018 at 09:55:10 UTC, Kagamin wrote: On Thursday, 10 May 2018 at 23:22:02 UTC, Steven Schveighoffer wrote: However, I am struggling to find a use case for this that showcases why you would want to use it. While it does work, and works beautifully, it doesn't show any

Re: Extra .tupleof field in structs with disabled postblit blocks non-GC-allocation trait

2018-05-11 Thread Johan Engelen via Digitalmars-d-learn
On Thursday, 10 May 2018 at 19:14:39 UTC, Meta wrote: So it looks like disabling a struct's postblit actually counts as having a __postblit and __xpostblit function (don't ask me why), in addition to a construction and opAssign... no idea why, and maybe this is a bug, but I bet there's a

Re: Sealed classes - would you want them in D?

2018-05-11 Thread rikki cattermole via Digitalmars-d
On 11/05/2018 11:25 PM, KingJoffrey wrote: On Friday, 11 May 2018 at 10:43:19 UTC, rikki cattermole wrote: Classes are expensive, not everybody wants to pay for what it gives in all situations. Mmm...that claim is so broad is to be meaningless. Good memory allocation algorithms, intelligent

Re: errno is not nothrow

2018-05-11 Thread Uknown via Digitalmars-d
On Friday, 11 May 2018 at 09:10:48 UTC, Cym13 wrote: On Friday, 11 May 2018 at 07:05:12 UTC, Shachar Shemesh wrote: At least under Linux, you cannot get or set the value of errno from a nothrow function. Is this on purpose, or is this a bug? Shachar It seems I can't reproduce with

Re: Extend the call site default argument expansion mechanism?

2018-05-11 Thread Dukc via Digitalmars-d
On Thursday, 10 May 2018 at 14:15:18 UTC, Yuxuan Shui wrote: ... // constructor of DataStructure this(Allocator alloc=__ALLOC__) {...} ... auto alloc = new SomeAllocator(); define __ALLOC__ = alloc; // And we don't need to pass alloc everytime ... Is this a good idea? Doesn't this basically

Re: Sealed classes - would you want them in D?

2018-05-11 Thread rikki cattermole via Digitalmars-d
On 11/05/2018 10:32 PM, KingJoffrey wrote: When I can contain the class abstraction within the class, then I will begin to take D more seriously. Perhaps this is why some say 'idiomatic' D does not really use classes (cause they haven't been implemented correctly anyway, so why bother using

Re: ! No allerts ! code.dlang.org

2018-05-11 Thread Sönke Ludwig via Digitalmars-d
Am 07.05.2018 um 16:57 schrieb Martin Tschierschke: I just want to send a big thank you to Martin Nowak and Sönke Ludwig and every one else running the infrastructure of DUB behind the scene! This is the list of Weekly Reports from pingdom.com for code.dlang.org: Pingdom Weekly Reports

Re: errno is not nothrow

2018-05-11 Thread Cym13 via Digitalmars-d
On Friday, 11 May 2018 at 07:05:12 UTC, Shachar Shemesh wrote: At least under Linux, you cannot get or set the value of errno from a nothrow function. Is this on purpose, or is this a bug? Shachar It seems I can't reproduce with core.stdc.errno, could you please share some code?

Re: iopipe v0.0.4 - RingBuffers!

2018-05-11 Thread Jonathan M Davis via Digitalmars-d-announce
On Friday, May 11, 2018 11:44:04 Steven Schveighoffer via Digitalmars-d- announce wrote: > Shameful note: Macos grep is BSD grep, and is not NEARLY as fast as GNU > grep, which has much better performance (and is 2x as fast as > iopipe_search on my Linux VM, even when printing line numbers).

Re: Extend the call site default argument expansion mechanism?

2018-05-11 Thread Uknown via Digitalmars-d
On Friday, 11 May 2018 at 14:26:21 UTC, Jonathan M Davis wrote: On Thursday, May 10, 2018 14:15:18 Yuxuan Shui via Digitalmars-d wrote: So in D I can use default argument like this: [...] Is this a good idea? It seems like really risky move, honestly, because it means that the function is

Re: Sealed classes - would you want them in D?

2018-05-11 Thread jmh530 via Digitalmars-d
On Friday, 11 May 2018 at 14:05:25 UTC, KingJoffrey wrote: [snip] Actually, it is completely on topic. (although I understand that many on this forum are very eager to shut down any discussion about fixing class encapsulation in D, for some reason). i.e, to be more specific.. so you can

Re: Sealed classes - would you want them in D?

2018-05-11 Thread Piotr Mitana via Digitalmars-d
On Friday, 11 May 2018 at 15:02:08 UTC, jmh530 wrote: But a new keyword will not get added without a DIP. Yes, I know it definitely needs a DIP - I've opened a discussion in order to gather community members' opinions on sealed and decide whether to write this DIP at all and possibly track

Re: iopipe v0.0.4 - RingBuffers!

2018-05-11 Thread Steven Schveighoffer via Digitalmars-d-announce
On 5/10/18 7:22 PM, Steven Schveighoffer wrote: However, this example *does* show the power of iopipe -- it handles all flavors of unicode with one template function, is quite straightforward (though I want to abstract the line tracking code, that stuff is really tricky to get right). Oh, and

Re: pointer to object resolution

2018-05-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/11/18 8:53 AM, Alex wrote: This behaves differently, w.r.t. to an arbitrary method, like "operator". Why? Is there any workaround? operators don't follow pointers. Imagine if you had a struct that overloads "+" and then you wanted to use pointer arithmetic, but instead it called

Re: Sealed classes - would you want them in D?

2018-05-11 Thread Jonathan M Davis via Digitalmars-d
On Friday, May 11, 2018 15:02:08 jmh530 via Digitalmars-d wrote: > I think the last point in the conversation was "write a DIP". > Nothing is going to change unless someone does that. > > Personally, I don't agree with the idiomatic D doesn't use > classes much argument. If that's the case, then

Re: iopipe v0.0.4 - RingBuffers!

2018-05-11 Thread Steven Schveighoffer via Digitalmars-d-announce
On 5/11/18 11:44 AM, Steven Schveighoffer wrote: On 5/10/18 7:22 PM, Steven Schveighoffer wrote: However, this example *does* show the power of iopipe -- it handles all flavors of unicode with one template function, is quite straightforward (though I want to abstract the line tracking code,

msgpack link failure - non-transitive pragma(lib)?

2018-05-11 Thread TED_996 via Digitalmars-d-learn
I've been trying to debug this for a long time now. I am trying to build one of the msgpack examples (examples/upacker_foreach.d) and the linking failed. I have since succeeded and I'm trying to find out if this is intended behavior or a bug in D (not msgpack, I think). TL;DR: it seems to me

pointer to object resolution

2018-05-11 Thread Alex via Digitalmars-d-learn
Hi all, I'm sure, I didn't find something obvious, but: Given this: ´´´ void main() { auto s = S(); s.operator; assert(s.myOp(42)); assert(42 in s); auto sptr = new S(); sptr.operator; assert(sptr.myOp(42)); //assert(42 in sptr);

Re: autowrap v0.0.1 - Automatically wrap existing D code for use in Python and Excel

2018-05-11 Thread Atila Neves via Digitalmars-d-announce
On Thursday, 10 May 2018 at 19:50:40 UTC, Nikos wrote: In my dub.sdl file I have configuration "python35" { subConfiguration "autowrap" "python35" } and I run dub build --config=python35 which still tries to find python36. Why doesn't it look for 3.5? Copy + paste error, sorry. Fixed

Re: Sealed classes - would you want them in D?

2018-05-11 Thread KingJoffrey via Digitalmars-d
On Friday, 11 May 2018 at 11:37:17 UTC, rikki cattermole wrote: Well then, since you don't like how it is now, lets see the DIP. it deserves to treated as a 'bug', not an DIP.

Re: msgpack link failure - non-transitive pragma(lib)?

2018-05-11 Thread TED_996 via Digitalmars-d-learn
On Friday, 11 May 2018 at 12:53:08 UTC, Basile B. wrote: On Friday, 11 May 2018 at 12:35:52 UTC, TED_996 wrote: [...] Yeah, right guess in the title ;) you have to put the "pragma lib" again. Take the use of "pragma lib" in the binding as an information saying "you have to do this too".

Re: Extend the call site default argument expansion mechanism?

2018-05-11 Thread Meta via Digitalmars-d
On Friday, 11 May 2018 at 11:42:07 UTC, Dukc wrote: On Thursday, 10 May 2018 at 14:15:18 UTC, Yuxuan Shui wrote: ... // constructor of DataStructure this(Allocator alloc=__ALLOC__) {...} ... auto alloc = new SomeAllocator(); define __ALLOC__ = alloc; // And we don't need to pass alloc everytime

Re: Extend the call site default argument expansion mechanism?

2018-05-11 Thread Timon Gehr via Digitalmars-d
On 10.05.2018 16:22, rikki cattermole wrote: On 11/05/2018 2:20 AM, Yuxuan Shui wrote: On Thursday, 10 May 2018 at 14:17:50 UTC, rikki cattermole wrote: On 11/05/2018 2:15 AM, Yuxuan Shui wrote: [...] Bad idea, too much magic. This magic is already there in D. I just want to use it in a

Re: Sealed classes - would you want them in D?

2018-05-11 Thread KingJoffrey via Digitalmars-d
On Friday, 11 May 2018 at 12:59:21 UTC, Piotr Mitana wrote: Might I suggest going back to the sealed classes topic? I don't think the discussion in this thread should go in the direction about the sense of using classes, proper encapsulation and the memory related stuff. Actually, it is

Re: iopipe v0.0.4 - RingBuffers!

2018-05-11 Thread Steven Schveighoffer via Digitalmars-d-announce
On 5/11/18 1:30 AM, Dmitry Olshansky wrote: On Thursday, 10 May 2018 at 23:22:02 UTC, Steven Schveighoffer wrote: OK, so at dconf I spoke with a few very smart guys about how I can use mmap to make a zero-copy buffer. And I implemented this on the plane ride home. However, I am struggling to

Re: iopipe v0.0.4 - RingBuffers!

2018-05-11 Thread Ali Çehreli via Digitalmars-d-announce
On 05/11/2018 06:28 AM, Steven Schveighoffer wrote: > 1. Ring buffers are really cool (I still love how it works) and perform > as well as normal buffers > 2. The use cases are much smaller than I thought There is the LMAX Disruptor, which was open sourced a few year ago along with a large

Why are deprecated aliases considered equal for resolution?

2018-05-11 Thread Nicholas Wilson via Digitalmars-d-learn
- module a; struct foo {} deprecated alias bar = foo; -- module b; struct bar {}; --- module c; import a; import b; void baz(bar b) {} Error: `a.bar` at source/a.d(5,1) conflicts with `b.bar` at .b.d(2,1) I would have thought the undeprecated alias would have

Re: iopipe v0.0.4 - RingBuffers!

2018-05-11 Thread Uknown via Digitalmars-d-announce
On Friday, 11 May 2018 at 13:28:58 UTC, Steven Schveighoffer wrote: [...] I do get the point of having to go outside the cache. I'll look and see if maybe specifying a 1000 line context helps ;) Update: nope, still pretty much the same. I'm sure someone will find some good show off

Re: Extend the call site default argument expansion mechanism?

2018-05-11 Thread Jonathan M Davis via Digitalmars-d
On Thursday, May 10, 2018 14:15:18 Yuxuan Shui via Digitalmars-d wrote: > So in D I can use default argument like this: > > int f(int line=__LINE__) {} > > And because default argument is expanded at call site, f() will > be called with the line number of the call site. > > This is a really clever

Re: Sealed classes - would you want them in D?

2018-05-11 Thread rikki cattermole via Digitalmars-d
On 12/05/2018 12:23 AM, KingJoffrey wrote: On Friday, 11 May 2018 at 11:37:17 UTC, rikki cattermole wrote: Well then, since you don't like how it is now, lets see the DIP. it deserves to treated as a 'bug', not an DIP. It works as designed. There is no bug here. Make a DIP please.

Re: msgpack link failure - non-transitive pragma(lib)?

2018-05-11 Thread TED_996 via Digitalmars-d-learn
On Friday, 11 May 2018 at 12:53:08 UTC, Basile B. wrote: On Friday, 11 May 2018 at 12:35:52 UTC, TED_996 wrote: [...] Yeah, right guess in the title ;) you have to put the "pragma lib" again. Take the use of "pragma lib" in the binding as an information saying "you have to do this too".

Re: iopipe v0.0.4 - RingBuffers!

2018-05-11 Thread Steven Schveighoffer via Digitalmars-d-announce
On 5/11/18 5:55 AM, Kagamin wrote: On Thursday, 10 May 2018 at 23:22:02 UTC, Steven Schveighoffer wrote: However, I am struggling to find a use case for this that showcases why you would want to use it. While it does work, and works beautifully, it doesn't show any measurable difference vs.

Re: Why are deprecated aliases considered equal for resolution?

2018-05-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, May 11, 2018 14:02:22 Nicholas Wilson via Digitalmars-d-learn wrote: > - > module a; > > struct foo {} > > deprecated alias bar = foo; > > -- > module b; > struct bar {}; > > > --- > module c; > > import a; > import b; > > void baz(bar b) {} > > Error: `a.bar`

Re: msgpack link failure - non-transitive pragma(lib)?

2018-05-11 Thread Basile B. via Digitalmars-d-learn
On Friday, 11 May 2018 at 12:35:52 UTC, TED_996 wrote: I've been trying to debug this for a long time now. I am trying to build one of the msgpack examples (examples/upacker_foreach.d) and the linking failed. I have since succeeded and I'm trying to find out if this is intended behavior or a

Re: Sealed classes - would you want them in D?

2018-05-11 Thread Piotr Mitana via Digitalmars-d
Might I suggest going back to the sealed classes topic? I don't think the discussion in this thread should go in the direction about the sense of using classes, proper encapsulation and the memory related stuff.

Re: getOpt with shared

2018-05-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, May 11, 2018 17:25:44 Danny Arends via Digitalmars-d-learn wrote: > Hey all, > > I have been working on creating a multi-threaded application, so > I have a shared configuration object which hold several command > line parameters (which I fill using getopt). > > The problem is that I

Re: errno is not nothrow

2018-05-11 Thread H. S. Teoh via Digitalmars-d
On Fri, May 11, 2018 at 12:42:01PM -0600, Jonathan M Davis via Digitalmars-d wrote: [...] > In the case of errno, it's coming from core.stdc.errno, and it looks > like on pretty much every system, it's declared as an alias for an > extern(C) function - e.g. > > ref int __error(); > > and none

Re: auto: useful, annoying or bad practice?

2018-05-11 Thread H. S. Teoh via Digitalmars-d
On Fri, May 11, 2018 at 06:56:13PM +, Chris M. via Digitalmars-d wrote: > On Friday, 11 May 2018 at 18:44:25 UTC, H. S. Teoh wrote: > > On Fri, May 11, 2018 at 04:57:05PM +, Mark via Digitalmars-d wrote: > > > [...] > > > > This makes me wonder if it might be useful to have return-type >

Re: getOpt with shared

2018-05-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, May 11, 2018 18:01:18 Danny Arends via Digitalmars-d-learn wrote: > On Friday, 11 May 2018 at 17:49:17 UTC, Jonathan M Davis wrote: > > On Friday, May 11, 2018 17:25:44 Danny Arends via > > > > Digitalmars-d-learn wrote: > >> [...] > > > > getopt is designed to be single-threaded. The

Re: getOpt with shared

2018-05-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/11/18 1:25 PM, Danny Arends wrote: Hey all, I have been working on creating a multi-threaded application, so I have a shared configuration object which hold several command line parameters (which I fill using getopt). The problem is that I get deprecation warnings when trying to set

Re: errno is not nothrow

2018-05-11 Thread Jonathan M Davis via Digitalmars-d
On Friday, May 11, 2018 10:05:12 Shachar Shemesh via Digitalmars-d wrote: > At least under Linux, you cannot get or set the value of errno from a > nothrow function. > > Is this on purpose, or is this a bug? In general, the C bindings in druntime haven't ended up with much in the way of

Re: Extend the call site default argument expansion mechanism?

2018-05-11 Thread Meta via Digitalmars-d
On Friday, 11 May 2018 at 15:03:41 UTC, Uknown wrote: I see what you're saying and I agree with you. I think a better way would be to try and extend the `with` syntax to work with arbitrary functions, rather than only objects. That would make it more useful. So something like: --- void

Re: getOpt with shared

2018-05-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/11/18 2:49 PM, Jonathan M Davis wrote: On Friday, May 11, 2018 14:31:17 Steven Schveighoffer via Digitalmars-d- learn wrote: On 5/11/18 1:25 PM, Danny Arends wrote: Hey all, I have been working on creating a multi-threaded application, so I have a shared configuration object which hold

Re: auto: useful, annoying or bad practice?

2018-05-11 Thread Chris M. via Digitalmars-d
On Friday, 11 May 2018 at 18:44:25 UTC, H. S. Teoh wrote: On Fri, May 11, 2018 at 04:57:05PM +, Mark via Digitalmars-d wrote: [...] This makes me wonder if it might be useful to have return-type constraints. A kind of static out-contract? Something that's part of the function

Re: getOpt with shared

2018-05-11 Thread Danny Arends via Digitalmars-d-learn
On Friday, 11 May 2018 at 17:49:17 UTC, Jonathan M Davis wrote: On Friday, May 11, 2018 17:25:44 Danny Arends via Digitalmars-d-learn wrote: [...] getopt is designed to be single-threaded. The keyword shared is not used a single type in that module. If you want to use shared with anything

Re: auto: useful, annoying or bad practice?

2018-05-11 Thread H. S. Teoh via Digitalmars-d
On Fri, May 11, 2018 at 04:57:05PM +, Mark via Digitalmars-d wrote: > On Wednesday, 9 May 2018 at 15:06:55 UTC, Jonathan M Davis wrote: > > Ultimately, the key is that the user of the function needs to be > > able to know how to use the return type. In some cases, that means > > returning a

Re: getOpt with shared

2018-05-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, May 11, 2018 14:31:17 Steven Schveighoffer via Digitalmars-d- learn wrote: > On 5/11/18 1:25 PM, Danny Arends wrote: > > Hey all, > > > > I have been working on creating a multi-threaded application, so I have > > a shared configuration object which hold several command line parameters

Re: Sealed classes - would you want them in D?

2018-05-11 Thread Nicholas Wilson via Digitalmars-d
On Friday, 11 May 2018 at 16:51:30 UTC, Mike Parker wrote: I don't see how putting the function outside or inside the class declaration makes any difference. Being inside the class takes up a vtable slot and is inheritable. In terms of encapsulation there is no difference.

Re: Funding for code-d/serve-d

2018-05-11 Thread Mike Parker via Digitalmars-d-announce
On Sunday, 6 May 2018 at 16:31:02 UTC, Meta wrote: I'm a little unclear how OpenCollective works. Do you have to specifically donate to this goal, or does every donation made just go to that? Furthermore, I don't really want to create an OpenCollective account just to donate; I'd prefer to do

Re: Sealed classes - would you want them in D?

2018-05-11 Thread Mike Parker via Digitalmars-d
On Friday, 11 May 2018 at 14:05:25 UTC, KingJoffrey wrote: private is not private at all in D, and because of this, classes are fundamentally broken in D (by design apparently). Now.. I really do have better ways to spend my time. I've made my point. Nobody who uses D seems to think in a

Re: iopipe v0.0.4 - RingBuffers!

2018-05-11 Thread Jon Degenhardt via Digitalmars-d-announce
On Friday, 11 May 2018 at 15:44:04 UTC, Steven Schveighoffer wrote: On 5/10/18 7:22 PM, Steven Schveighoffer wrote: Shameful note: Macos grep is BSD grep, and is not NEARLY as fast as GNU grep, which has much better performance (and is 2x as fast as iopipe_search on my Linux VM, even when

getOpt with shared

2018-05-11 Thread Danny Arends via Digitalmars-d-learn
Hey all, I have been working on creating a multi-threaded application, so I have a shared configuration object which hold several command line parameters (which I fill using getopt). The problem is that I get deprecation warnings when trying to set numerical values:

Re: auto: useful, annoying or bad practice?

2018-05-11 Thread Mark via Digitalmars-d
On Wednesday, 9 May 2018 at 15:06:55 UTC, Jonathan M Davis wrote: Ultimately, the key is that the user of the function needs to be able to know how to use the return type. In some cases, that means returning a specific type, whereas in others, it means using auto and being clear in the

Re: getOpt with shared

2018-05-11 Thread Danny Arends via Digitalmars-d-learn
On Friday, 11 May 2018 at 17:25:44 UTC, Danny Arends wrote: Hey all, I have been working on creating a multi-threaded application, so I have a shared configuration object which hold several command line parameters (which I fill using getopt). The problem is that I get deprecation warnings

Re: [DUB][DLS] building package dls doesn't finish

2018-05-11 Thread Kamil Koczurek via Digitalmars-d
On Friday, 11 May 2018 at 01:00:31 UTC, Rubn wrote: On Thursday, 10 May 2018 at 09:32:38 UTC, Kamil Koczurek wrote: Hello, I installed an atom extension for D support, but it requires dls package to be installed and built. When I fetch and attempt to build it (with --build=release) it just

Re: Sealed classes - would you want them in D?

2018-05-11 Thread Walter Bright via Digitalmars-d
On 5/10/2018 6:22 AM, Piotr Mitana wrote: For those who never coded Scala and don't know sealed classes: a sealed class is a class which can be only extended in the same source file.     sealed class MyClass {} Translating to D, a sealed class would could only be extended in the same

Re: Two really good looking GUI libraries that can work for D

2018-05-11 Thread Rubn via Digitalmars-d
On Friday, 11 May 2018 at 21:43:24 UTC, aberba wrote: General Usage: Nuklear is a minimal state immediate mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any

Re: Sealed classes - would you want them in D?

2018-05-11 Thread Jonathan M Davis via Digitalmars-d
On Friday, May 11, 2018 19:45:10 rumbu via Digitalmars-d wrote: > On Friday, 11 May 2018 at 16:51:30 UTC, Mike Parker wrote: > > On Friday, 11 May 2018 at 14:05:25 UTC, KingJoffrey wrote: > >> private is not private at all in D, and because of this, > >> classes are fundamentally broken in D (by

Re: errno is not nothrow

2018-05-11 Thread Steven Schveighoffer via Digitalmars-d
On 5/11/18 3:58 PM, Jonathan M Davis wrote: I don't know why it wouldn't be working for you on Linux, and I don't have a Linux system to test with at the moment. void main() nothrow @safe @nogc { import core.stdc.errno; errno = 1; } works just fine on FreeBSD. I think we need to

Re: Sealed classes - would you want them in D?

2018-05-11 Thread bauss via Digitalmars-d
On Friday, 11 May 2018 at 05:26:36 UTC, Apocalypto wrote: On Friday, 11 May 2018 at 05:10:08 UTC, Uknown wrote: On Friday, 11 May 2018 at 04:43:09 UTC, KingJoffrey wrote: On Friday, 11 May 2018 at 03:32:25 UTC, Uknown wrote: Whereas D makes it part of the implementation of 'the module' (

Re: Sealed classes - would you want them in D?

2018-05-11 Thread rumbu via Digitalmars-d
On Friday, 11 May 2018 at 16:51:30 UTC, Mike Parker wrote: On Friday, 11 May 2018 at 14:05:25 UTC, KingJoffrey wrote: private is not private at all in D, and because of this, classes are fundamentally broken in D (by design apparently). Now.. I really do have better ways to spend my time.

Re: Sealed classes - would you want them in D?

2018-05-11 Thread H. S. Teoh via Digitalmars-d
On Fri, May 11, 2018 at 02:04:34PM -0600, Jonathan M Davis via Digitalmars-d wrote: > On Friday, May 11, 2018 19:45:10 rumbu via Digitalmars-d wrote: [...] > > The first example is unit testing. Having access to the private > > members of a class inside the same module is a mistake because it > >

Re: errno is not nothrow

2018-05-11 Thread Jonathan M Davis via Digitalmars-d
On Friday, May 11, 2018 12:01:05 H. S. Teoh via Digitalmars-d wrote: > On Fri, May 11, 2018 at 12:42:01PM -0600, Jonathan M Davis via > Digitalmars-d wrote: [...] > > > In the case of errno, it's coming from core.stdc.errno, and it looks > > like on pretty much every system, it's declared as an

Re: errno is not nothrow

2018-05-11 Thread Jonathan M Davis via Digitalmars-d
On Friday, May 11, 2018 12:42:01 Jonathan M Davis via Digitalmars-d wrote: > On Friday, May 11, 2018 10:05:12 Shachar Shemesh via Digitalmars-d wrote: > > At least under Linux, you cannot get or set the value of errno from a > > nothrow function. > > > > Is this on purpose, or is this a bug? > >

Re: pointer to object resolution

2018-05-11 Thread Alex via Digitalmars-d-learn
On Friday, 11 May 2018 at 15:24:08 UTC, Steven Schveighoffer wrote: On 5/11/18 8:53 AM, Alex wrote: This behaves differently, w.r.t. to an arbitrary method, like "operator". Why? Is there any workaround? operators don't follow pointers. Imagine if you had a struct that overloads "+" and

Re: iopipe v0.0.4 - RingBuffers!

2018-05-11 Thread Joakim via Digitalmars-d-announce
On Friday, 11 May 2018 at 16:07:26 UTC, Steven Schveighoffer wrote: On 5/11/18 11:44 AM, Steven Schveighoffer wrote: On 5/10/18 7:22 PM, Steven Schveighoffer wrote: [...] Shameful note: Macos grep is BSD grep, and is not NEARLY as fast as GNU grep, which has much better performance (and is

Two really good looking GUI libraries that can work for D

2018-05-11 Thread aberba via Digitalmars-d
This two GUI libs written in C I just found are really good looking and looks production ready. Embedded systems: LittlevGL is a free and open-source graphics library providing everything you need to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low

Re: Extend the call site default argument expansion mechanism?

2018-05-11 Thread Yuxuan Shui via Digitalmars-d
On Thursday, 10 May 2018 at 15:15:03 UTC, Paul Backus wrote: On Thursday, 10 May 2018 at 14:37:00 UTC, rikki cattermole wrote: On 11/05/2018 2:33 AM, Yuxuan Shui wrote: On Thursday, 10 May 2018 at 14:28:39 UTC, JN wrote: But doing it with default argument expansion saves you 1 allocation,

Re: Extend the call site default argument expansion mechanism?

2018-05-11 Thread jmh530 via Digitalmars-d
On Friday, 11 May 2018 at 11:42:07 UTC, Dukc wrote: [snip] Doesn't this basically mean including the implicits Martin Odersky talked about at Dconf in D? I don't know whether it's a good idea all-in-all, but assuming the arguments can be used as compile-time I can already see a big use