Re: __gshared as part of alias

2018-01-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, January 17, 2018 07:30:30 Nicholas Wilson via Digitalmars-d- learn wrote: > On Wednesday, 17 January 2018 at 02:37:07 UTC, Steven > > Schveighoffer wrote: > > On 1/11/18 11:25 PM, Nicholas Wilson wrote: > >> Is there a way to make __gshared part of an alias? > > > > No, __gshared is

Re: private selective import + overload = breaks accessibility rules

2018-01-16 Thread Joakim via Digitalmars-d-learn
On Wednesday, 17 January 2018 at 02:23:40 UTC, Seb wrote: On Tuesday, 16 January 2018 at 19:05:51 UTC, rumbu wrote: On Tuesday, 16 January 2018 at 18:32:46 UTC, H. S. Teoh wrote: Which version of the compiler is this? I'm pretty sure the std.math.isNaN imported by module a should not be

Re: __gshared as part of alias

2018-01-16 Thread Nicholas Wilson via Digitalmars-d-learn
On Wednesday, 17 January 2018 at 02:37:07 UTC, Steven Schveighoffer wrote: On 1/11/18 11:25 PM, Nicholas Wilson wrote: Is there a way to make __gshared part of an alias? No, __gshared is a storage class, not a type constructor, so it has no meaning as part of a type: __gshared int x; int

Re: __gshared as part of alias

2018-01-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/11/18 11:25 PM, Nicholas Wilson wrote: Is there a way to make __gshared part of an alias? No, __gshared is a storage class, not a type constructor, so it has no meaning as part of a type: __gshared int x; int y; static assert(is(typeof(x) == typeof(y))); as in enum AddrSpace : uint

Re: private selective import + overload = breaks accessibility rules

2018-01-16 Thread Seb via Digitalmars-d-learn
On Tuesday, 16 January 2018 at 19:05:51 UTC, rumbu wrote: On Tuesday, 16 January 2018 at 18:32:46 UTC, H. S. Teoh wrote: Which version of the compiler is this? I'm pretty sure the std.math.isNaN imported by module a should not be visible in module b. The latest compiler should emit a

Re: Function hijack on selective import

2018-01-16 Thread rumbu via Digitalmars-d-learn
On Tuesday, 16 January 2018 at 20:30:43 UTC, H. S. Teoh wrote: On Tue, Jan 16, 2018 at 07:14:00PM +, rumbu via Even specialized, now I have another problem: std.math: int signbit(X)(X x) { ... } mylibrary: int signbit(D: Decimal!bits, int bits) { ... } = end user: import

Re: Function hijack on selective import

2018-01-16 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Jan 16, 2018 at 07:14:00PM +, rumbu via Digitalmars-d-learn wrote: > On Tuesday, 26 December 2017 at 20:21:11 UTC, Adam D. Ruppe wrote: > > On Tuesday, 26 December 2017 at 19:41:47 UTC, rumbu wrote: > > > "Custom" is a templated struct. I cannot imagine all the > > > instantiations of

Re: Alias to single function of object inside class

2018-01-16 Thread Ali Çehreli via Digitalmars-d-learn
On 01/16/2018 11:00 AM, ARaspiK wrote: I have a class Foo, which has functions a(), b(), and c(). I have a class Bar that has baz, an instance of Foo. How do I link Bar.b() -> baz.b() without also linking Foo.a() and Foo.c()? I know we can do an alias this, but I only want to link over b().

Re: Function hijack on selective import

2018-01-16 Thread rumbu via Digitalmars-d-learn
On Tuesday, 26 December 2017 at 20:21:11 UTC, Adam D. Ruppe wrote: On Tuesday, 26 December 2017 at 19:41:47 UTC, rumbu wrote: "Custom" is a templated struct. I cannot imagine all the instantiations of Custom to write template specialisations for each of them. You can specialize on templated

Re: private selective import + overload = breaks accessibility rules

2018-01-16 Thread rumbu via Digitalmars-d-learn
On Tuesday, 16 January 2018 at 18:32:46 UTC, H. S. Teoh wrote: Which version of the compiler is this? I'm pretty sure the std.math.isNaN imported by module a should not be visible in module b. The latest compiler should emit a deprecation warning for this. 2.078, but also 2.077.

Alias to single function of object inside class

2018-01-16 Thread ARaspiK via Digitalmars-d-learn
I have a class Foo, which has functions a(), b(), and c(). I have a class Bar that has baz, an instance of Foo. How do I link Bar.b() -> baz.b() without also linking Foo.a() and Foo.c()? I know we can do an alias this, but I only want to link over b().

Re: private selective import + overload = breaks accessibility rules

2018-01-16 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Jan 16, 2018 at 06:13:27PM +, rumbu via Digitalmars-d-learn wrote: > module a; > > private import std.math: isNaN; > > //custom overload > public bool isNaN(int i) { return false; } > > > = > > module b; > import a; > > void foo() > { > bool b =

private selective import + overload = breaks accessibility rules

2018-01-16 Thread rumbu via Digitalmars-d-learn
module a; private import std.math: isNaN; //custom overload public bool isNaN(int i) { return false; } = module b; import a; void foo() { bool b = isNaN(float.nan); //compiles successfully calling std.math.isNaN even it should not be visible. } Is this

Re: Using Postgres connection functions

2018-01-16 Thread Boris-Barboris via Digitalmars-d-learn
On Saturday, 13 January 2018 at 17:58:14 UTC, Joe wrote: ...ddb. The latter perhaps has the distinction that it doesn't use libpq, but rather implements the Postgres FE/BE protocol. That's a bit *too* native for my taste. It means the library maintainer has to keep up with changes to the

Re: Web Browser

2018-01-16 Thread DanielG via Digitalmars-d-learn
It looks like there are some unmaintained D bindings for sciter: https://github.com/sciter-sdk/Sciter-Dport

Re: need help with vibe.d receive()

2018-01-16 Thread crimaniak via Digitalmars-d-learn
On Tuesday, 16 January 2018 at 08:54:58 UTC, Sönke Ludwig wrote: ... The problem is with the `immutable struct StopEvent {}` Thanks! ... So, removing the `immutable` from the declaration solved the issue for me, but if possible I'd rather remove the `cast(shared Unqual!EventType)` from

Web Browser

2018-01-16 Thread Marc via Digitalmars-d-learn
I'm used to use Qt's QWebView when I need an application to show a HTML page and change some elements on it. This time, if possible, I'd like to use D instead. Are there any web browsers ports in D?

Re: class initialization

2018-01-16 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 16 January 2018 at 03:23:20 UTC, Marc wrote: But can't figure out if D does have that for classes. I believe there's no such thing for classes, you're supposed to use constructors. Class objects are in many aspects more abstract things than POD structs: instead of accessing

Re: Vibe-d issue with timer in separate thread on debug builds

2018-01-16 Thread Sönke Ludwig via Digitalmars-d-learn
Am 10.01.2018 um 15:40 schrieb Andres Clari: Hi, I have an app that uses vibe tasks, fibers and timers extensively, and I found an issue only for debug builds, when canceling a timer. However the code in question works just fine in the release build. But having this here makes testing certain

Re: need help with vibe.d receive()

2018-01-16 Thread Sönke Ludwig via Digitalmars-d-learn
Am 10.01.2018 um 15:39 schrieb crimaniak: Hi! I make multi-task event bus, but there is a problem with the task stops. Please see end of file https://github.com/crimaniak/d-vision/blob/master/src/vision/eventbus.d Expected behavior: After sending the StopEvent message in line 244 it is must