Re: Catching C++ Exceptions in D - Windows and Linux

2017-09-11 Thread Nicholas Wilson via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 03:51:45 UTC, Laeeth Isharc wrote: Hi. I'm here in HK with Ilya, Atila, John Colvin, and Jonathan Davis. I wondered what the current state of D catching C++ exceptions was on Linux and Windows. I know that some work was done on making this possible, and my

Re: Override with function overloads

2017-09-11 Thread jmh530 via Digitalmars-d-learn
On Monday, 11 September 2017 at 20:40:30 UTC, nkm1 wrote: I don't know, maybe don't use alias this :) IMO, it's a really dubious feature... I don't think it's an issue of alias this, per se. I think it's just something to be aware of and use your approach of aliasing as necessary. It's

Catching C++ Exceptions in D - Windows and Linux

2017-09-11 Thread Laeeth Isharc via Digitalmars-d-learn
Hi. I'm here in HK with Ilya, Atila, John Colvin, and Jonathan Davis. I wondered what the current state of D catching C++ exceptions was on Linux and Windows. I know that some work was done on making this possible, and my understanding is that it is, more or less - just wondered what the

Re: Ranges seem awkward to work with

2017-09-11 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 01:13:29 UTC, Hasen Judy wrote: Is this is a common beginner issue? I remember using an earlier version of D some long time ago and I don't remember seeing this concept. Now, a lot of library functions seem to expect ranges as inputs and return ranges as

Re: Ranges seem awkward to work with

2017-09-11 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 01:13:29 UTC, Hasen Judy wrote: Is this is a common beginner issue? I remember using an earlier version of D some long time ago and I don't remember seeing this concept. D's ranges can take getting used to, so if you haven't already, these two articles are

Re: Ranges seem awkward to work with

2017-09-11 Thread Jesse Phillips via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 01:18:21 UTC, Nicholas Wilson wrote: On Tuesday, 12 September 2017 at 01:13:29 UTC, Hasen Judy wrote: Is this is a common beginner issue? if `range.save` works use that, otherwise std.csv does not, IIRC. `range.dup` will duplicate the range That isn't a

Re: Address of data that is static, be it shared or tls or __gshared or immutable on o/s

2017-09-11 Thread Moritz Maxeiner via Digitalmars-d-learn
On Monday, 11 September 2017 at 22:38:21 UTC, Walter Bright wrote: If an address is taken to a TLS object, any relocations and adjustments are made at the time the pointer is generated, not when the pointer is dereferenced. Could you elaborate on that explanation more? The way I thought

Re: Ranges seem awkward to work with

2017-09-11 Thread Nicholas Wilson via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 01:13:29 UTC, Hasen Judy wrote: Is this is a common beginner issue? I remember using an earlier version of D some long time ago and I don't remember seeing this concept. Now, a lot of library functions seem to expect ranges as inputs and return ranges as

Ranges seem awkward to work with

2017-09-11 Thread Hasen Judy via Digitalmars-d-learn
Is this is a common beginner issue? I remember using an earlier version of D some long time ago and I don't remember seeing this concept. Now, a lot of library functions seem to expect ranges as inputs and return ranges as output. Even parsing a csv line returns a range. And the funny thing

Re: Web servers in D

2017-09-11 Thread Hasen Judy via Digitalmars-d-learn
On Saturday, 2 September 2017 at 09:26:27 UTC, Andrew Chapman wrote: [...] Don't use these components :-) [...] Vibe.d does this - just don't use the automatic API generation feature if you don't like it. Note, you can get access to the request/response objects even if you do use the

How to set connect timeout on a blocking socket?

2017-09-11 Thread tony via Digitalmars-d-learn
Help me! How to set connect timeout on a blocking socket?

Re: Address of data that is static, be it shared or tls or __gshared or immutable on o/s

2017-09-11 Thread Ali Çehreli via Digitalmars-d-learn
On 09/11/2017 03:38 PM, Walter Bright wrote: > If an address is taken to a TLS object, any relocations and adjustments > are made at the time the pointer is generated, not when the pointer is > dereferenced. Hence, the pointer may be passed from thread to thread, > and will still point to the

extern(C) and slices

2017-09-11 Thread Nordlöw via Digitalmars-d-learn
If I have a function like `extern(C) void f(void *x, size_t x_sz)` can I instead declare it as `extern(C) void f(void[] x)` ?

Re: Address of data that is static, be it shared or tls or __gshared or immutable on o/s

2017-09-11 Thread Walter Bright via Digitalmars-d-learn
On 9/10/2017 2:38 PM, Cecil Ward wrote: Ali, I have worked on operating systems' development in r+d. My definitions of terms are hopefully the same as yours. If we refer to two threads, if they both belong to the same process, then they share a common address space, by my definition of the

Re: Little app using gtkD, how to make it well?

2017-09-11 Thread Jesse Phillips via Digitalmars-d-learn
On Monday, 11 September 2017 at 20:19:28 UTC, Romain wrote: Hello, I started an application using gtkD and libusb-d. I would love to get some hints about how to make good use of D since I'm a java developper and maybe use too much of it in D code or doing wrong things. The program will

Re: SIMD under LDC

2017-09-11 Thread Igor via Digitalmars-d-learn
On Monday, 11 September 2017 at 11:55:45 UTC, Igor wrote: In the meantime can anyone tell me how to add an attribute to a function only if something is defined, since this doesn't work: version(USE_SIMD_WITH_LDC) { import ldc.attributes; @target("ssse3") } void funcThatUsesSIMD() { ...

Re: Override with function overloads

2017-09-11 Thread nkm1 via Digitalmars-d-learn
On Monday, 11 September 2017 at 18:15:36 UTC, jmh530 wrote: An interesting example. I'm not sure overriding is the issue so most as what is in the overload set. I think foo(int) is not part of the overload set yet. The compiler is able to cast the long to int and then call the one in class B

Re: Little app using gtkD, how to make it well?

2017-09-11 Thread Romain via Digitalmars-d-learn
On Monday, 11 September 2017 at 20:19:28 UTC, Romain wrote: Hello, I started an application using gtkD and libusb-d. I would love to get some hints about how to make good use of D since I'm a java developper and maybe use too much of it in D code or doing wrong things. The program will

Little app using gtkD, how to make it well?

2017-09-11 Thread Romain via Digitalmars-d-learn
Hello, I started an application using gtkD and libusb-d. I would love to get some hints about how to make good use of D since I'm a java developper and maybe use too much of it in D code or doing wrong things. The program will only work with msi laptop that have a steelseries keyboard, but

Re: Override with function overloads

2017-09-11 Thread jmh530 via Digitalmars-d-learn
On Monday, 11 September 2017 at 17:59:25 UTC, nkm1 wrote: On Monday, 11 September 2017 at 15:13:25 UTC, jmh530 wrote: I suppose my issue is that final should prevent function hijacking because I shouldn't be allowed to override string bar(double d) anyway. It shouldn't be a worry. It has

Re: Override with function overloads

2017-09-11 Thread nkm1 via Digitalmars-d-learn
On Monday, 11 September 2017 at 15:13:25 UTC, jmh530 wrote: I suppose my issue is that final should prevent function hijacking because I shouldn't be allowed to override string bar(double d) anyway. It shouldn't be a worry. It has nothing to do with overriding. Consider: import std.stdio;

Re: Problems with the DLangUI TreeWidget

2017-09-11 Thread pezi_pink via Digitalmars-d-learn
On Monday, 11 September 2017 at 09:00:36 UTC, Vadim Lopatin wrote: On Friday, 8 September 2017 at 15:39:21 UTC, pezi_pink wrote: On Friday, 8 September 2017 at 15:08:27 UTC, Vadim Lopatin wrote: On Friday, 8 September 2017 at 12:10:23 UTC, pezi_pink wrote: [...] It's known issue:

Re: Address of data that is static, be it shared or tls or __gshared or immutable on o/s

2017-09-11 Thread Ali Çehreli via Digitalmars-d-learn
On 09/11/2017 01:51 AM, John Burton wrote: > I wrote this program :- > > import std.stdio; > import std.concurrency; > > int data; > > void display() > { > writeln("Address is ", ); > } > > void main() > { > auto tid1 = spawn(); > auto tid2 = spawn(); > auto tid3 = spawn(); > } >

Re: GtkD mouse latency issues

2017-09-11 Thread Mike Wey via Digitalmars-d-learn
On 11-09-17 06:29, Joseph wrote: I have a GTK paned element and when I click to drag the handler, it does not respond immediately. I have to hold the left mouse button down for about 1 second and not move it before it "catches" and lets me drag, else I does not move. I'm using Glade and the

Re: Deprecation: std.container.array.RangeT(A) is not visible from module Size

2017-09-11 Thread Vino.B via Digitalmars-d-learn
On Monday, 11 September 2017 at 08:55:21 UTC, Vino.B wrote: On Sunday, 10 September 2017 at 23:10:20 UTC, Ali Çehreli wrote: On 09/10/2017 09:53 AM, Vino.B wrote: > auto coSizeDirList (string FFs, int SizeDir) { > //alias DirSizeList = typeof(coSizeDirList()); I worked with a version of

Re: Override with function overloads

2017-09-11 Thread jmh530 via Digitalmars-d-learn
On Monday, 11 September 2017 at 04:29:39 UTC, Ali Çehreli wrote: Here, the feature called "name hiding" is in effect. Foo2.bar hides all bars from Foo. This is to avoid "function hijacking"[1]. Ali [1] https://dlang.org/hijack.html I suppose my issue is that final should prevent function

Re: std.algorithm.joiner unexpected behavior

2017-09-11 Thread Sergei Degtiarev via Digitalmars-d-learn
On Friday, 1 September 2017 at 00:09:16 UTC, H. S. Teoh wrote: Consider the case where .front returns a subrange. As you state above, copying this subrange does not have defined behaviour. One reason is the difference in semantics between reference types and value types: the assignment

Re: Passing array as an function argument.

2017-09-11 Thread Vino.B via Digitalmars-d-learn
On Monday, 11 September 2017 at 12:44:00 UTC, wobbles wrote: On Monday, 11 September 2017 at 12:20:08 UTC, Vino.B wrote: On Monday, 11 September 2017 at 12:03:32 UTC, wobbles wrote: On Monday, 11 September 2017 at 11:58:18 UTC, Vino.B wrote: [...] The type returned from Test1() is a

Re: betterC and struct destructors

2017-09-11 Thread Moritz Maxeiner via Digitalmars-d-learn
On Monday, 11 September 2017 at 10:18:41 UTC, Oleg B wrote: Hello. I try using destructor in betterC code and it's work if outer function doesn't return value (void). Code in `scope (exit)` works as same (if func is void all is ok). In documentation I found

Re: Passing array as an function argument.

2017-09-11 Thread wobbles via Digitalmars-d-learn
On Monday, 11 September 2017 at 12:20:08 UTC, Vino.B wrote: On Monday, 11 September 2017 at 12:03:32 UTC, wobbles wrote: On Monday, 11 September 2017 at 11:58:18 UTC, Vino.B wrote: [...] The type returned from Test1() is a `RangeT!(Array!string)`. This is due to the `[]` on the end of

Re: betterC and struct destructors

2017-09-11 Thread Vadim Lopatin via Digitalmars-d-learn
On Monday, 11 September 2017 at 10:18:41 UTC, Oleg B wrote: Hello. I try using destructor in betterC code and it's work if outer function doesn't return value (void). Code in `scope (exit)` works as same (if func is void all is ok). In documentation I found

Re: Passing array as an function argument.

2017-09-11 Thread Vino.B via Digitalmars-d-learn
On Monday, 11 September 2017 at 12:03:32 UTC, wobbles wrote: On Monday, 11 September 2017 at 11:58:18 UTC, Vino.B wrote: Hi All, Can some one help me on how to pass a container array as a function argument , the below code throws an error, Error: Error: function T3.Test2 (Array!string t1)

Re: Passing array as an function argument.

2017-09-11 Thread wobbles via Digitalmars-d-learn
On Monday, 11 September 2017 at 11:58:18 UTC, Vino.B wrote: Hi All, Can some one help me on how to pass a container array as a function argument , the below code throws an error, Error: Error: function T3.Test2 (Array!string t1) is not callable using argument types (RangeT!(Array!string))

Passing array as an function argument.

2017-09-11 Thread Vino.B via Digitalmars-d-learn
Hi All, Can some one help me on how to pass a container array as a function argument , the below code throws an error, Error: Error: function T3.Test2 (Array!string t1) is not callable using argument types (RangeT!(Array!string)) import std.stdio: writeln; import std.container; auto

Re: SIMD under LDC

2017-09-11 Thread Igor via Digitalmars-d-learn
On Thursday, 7 September 2017 at 16:45:40 UTC, Igor wrote: On Thursday, 7 September 2017 at 15:24:13 UTC, Johan Engelen wrote: On Wednesday, 6 September 2017 at 20:43:01 UTC, Igor wrote: I opened a feature request on github. I also tried using the gccbuiltins but I got this error: LLVM

VisualD setup problems

2017-09-11 Thread Igor via Digitalmars-d-learn
I seem to have corrupted something within my installation and I can't find how to fix it. Earlier I was able to setup a breakpoint within some phobos module that I used and step through phobos code but that doesn't work any more. Does anyone know how I can make that work again?

betterC and struct destructors

2017-09-11 Thread Oleg B via Digitalmars-d-learn
Hello. I try using destructor in betterC code and it's work if outer function doesn't return value (void). Code in `scope (exit)` works as same (if func is void all is ok). In documentation I found https://dlang.org/spec/betterc.html#consequences 12 paragraph: Struct deconstructors. Why

Re: Problems with the DLangUI TreeWidget

2017-09-11 Thread Vadim Lopatin via Digitalmars-d-learn
On Friday, 8 September 2017 at 15:39:21 UTC, pezi_pink wrote: On Friday, 8 September 2017 at 15:08:27 UTC, Vadim Lopatin wrote: On Friday, 8 September 2017 at 12:10:23 UTC, pezi_pink wrote: [...] It's known issue: https://github.com/buggins/dlangui/issues/278 Not sure if there is any

Re: Deprecation: std.container.array.RangeT(A) is not visible from module Size

2017-09-11 Thread Vino.B via Digitalmars-d-learn
On Sunday, 10 September 2017 at 23:10:20 UTC, Ali Çehreli wrote: On 09/10/2017 09:53 AM, Vino.B wrote: > auto coSizeDirList (string FFs, int SizeDir) { > //alias DirSizeList = typeof(coSizeDirList()); I worked with a version of coSizeDirList() that did not take any parameters. (Could be from

Re: Address of data that is static, be it shared or tls or __gshared or immutable on o/s

2017-09-11 Thread John Burton via Digitalmars-d-learn
On Sunday, 10 September 2017 at 21:38:03 UTC, Cecil Ward wrote: On Wednesday, 6 September 2017 at 15:55:35 UTC, Ali Çehreli wrote: [...] Ali, I have worked on operating systems' development in r+d. My definitions of terms are hopefully the same as yours. If we refer to two threads, if they