Re: Is it ok to inherit multiple times same templated interface?

2017-01-15 Thread Ryan via Digitalmars-d-learn
On Sunday, 15 January 2017 at 20:33:30 UTC, Alexandru Ermicioi wrote: Good day, Given following code example, where a templated interface Wr, and an implementation Im is present: interface Wr(T) { T get(); } class Im(T : ubyte) : Wr!ubyte, Wr!ushort, Wr!string { public T t;

Re: MSVC path on windows

2017-01-12 Thread Ryan via Digitalmars-d-learn
On Friday, 13 January 2017 at 03:21:52 UTC, Jeremy DeHaan wrote: I've also thought of parsing the PATH to figure out where dmd is installed and extract the info from the sc.ini file. I have both VS2013 and VS2015 installed. I have to use a project specific sc.ini file to match each project

DMD specify VS version in sc.ini

2016-12-27 Thread Ryan via Digitalmars-d-learn
I have a C library I want to link against that was compiled with VS 2013. I have VS2013 and VS2015 installed. I want DMD to use the 2013 version, since the C-runtime in 2015 is not backwards compatible. Looking at sc.ini I see several entries that relate to the linker, CRT, and SDK. How do I

Re: Catch block not hit in unittest

2016-11-24 Thread Ryan via Digitalmars-d-learn
On Thursday, 24 November 2016 at 13:42:25 UTC, Kagamin wrote: Linux? Probably another bug. Try this: unittest { import core.exception : UnicodeException; void f() { string ret; int i = -1; ret ~= i; } try { f(); }

Re: Why double not? (!!)

2016-11-19 Thread Ryan via Digitalmars-d-learn
It's a more concise way of writing: GetConsoleCP() != 0 You can do this in C/C++ as well (and presumably some other languages). Hmmm... thinking about it, it does make perfect sense. The first ! converts it to bool, the other inverts it back to it's positive/negative state. Wouldn't

Why double not? (!!)

2016-11-18 Thread Ryan via Digitalmars-d-learn
Why do I see double `not` operators sometimes in D code? An example it the last post of this thread. http://forum.dlang.org/thread/ktlpnikvdwgbvfaam...@forum.dlang.org import core.sys.windows.windows : GetConsoleCP; bool hasConsole = !!GetConsoleCP(); Thanks.

Any recent success with SWIG?

2016-10-19 Thread Ryan via Digitalmars-d-learn
I would like to use a library with a c interface from D (gdal actually), but I can't find any bindings. I've looked at htod, but I also see that gdal has project maintained SWIG interfaces and SWIG claims to work with D (both D1 and D2). So I installed the latest SWIG, but I haven't been able

Re: std.paralellism.Task value type problems

2016-10-19 Thread Ryan via Digitalmars-d-learn
On Wednesday, 19 October 2016 at 15:28:25 UTC, Benjamin Thaut wrote: I would like to use std.paralellism.TaskPool to schedule various tasks I create. The problem however is that these tasks don't have a lifetime which is bound to any function scope I have. So I need to create a new task object

Re: Should I brush up on my C before plunging fully into D?

2016-10-15 Thread Ryan via Digitalmars-d-learn
On Saturday, 15 October 2016 at 01:46:52 UTC, Chris Nelson wrote: I'm mainly a scripting language, .NET, and SQL programmer. I've been looking for a good programming language for Linux/BSD other than Python. I've surveyed the options and D appears to be a sane modern choice for me. (Thanks Ali

Really easy optimization with std.experimental.allocator

2016-09-17 Thread Ryan via Digitalmars-d-learn
I've been learning about allocators in D. Much easier than C++, and this little program shows a really easy optimization. Just use the IAllocator interface with the GC. --- import std.datetime; import std.experimental.allocator;

Re: seg fault, now what?

2016-09-17 Thread Ryan via Digitalmars-d-learn
On Saturday, 17 September 2016 at 22:48:49 UTC, ag0aep6g wrote: On 09/17/2016 11:58 PM, Ryan wrote: On Saturday, 17 September 2016 at 21:44:22 UTC, Stefan Koch wrote: [...] Post the program somewhere otherwise we cannot help. [... code ...] Reduced and filed:

Re: seg fault, now what?

2016-09-17 Thread Ryan via Digitalmars-d-learn
On Saturday, 17 September 2016 at 21:44:22 UTC, Stefan Koch wrote: On Saturday, 17 September 2016 at 21:12:08 UTC, Ryan wrote: Is there an alternative to reporting bugs via bugzilla? I tried to open an account, but they recommend not using your main e-mail address because it will be posted to

seg fault, now what?

2016-09-17 Thread Ryan via Digitalmars-d-learn
Is there an alternative to reporting bugs via bugzilla? I tried to open an account, but they recommend not using your main e-mail address because it will be posted to the web for all the spammers to find. But I don't have another e-mail address, and it seems a bit much to create a fake e-mail

Fast matrix struct

2014-12-14 Thread Ryan via Digitalmars-d-learn
I'm writing a Matrix struct that I plan to use for some number crunching, which will be intensive at times. So I want it to be fast. Will I do better by manually managing the memory myself with malloc and free in the constructors/destructor or just using plain D arrays? The manual way I

Re: Learning D

2014-08-27 Thread Ryan via Digitalmars-d-learn
Thanks again for all the responses. I've made tremendous progress understanding the D build process. I'm thinking I will probably create a more in depth GTK+ hello world that attempts to covers some of the current D landscape. For instance I now understand how DMD and RDMD work and how they

Learning D

2014-08-25 Thread Ryan via Digitalmars-d-learn
Me: Software developer for 30 years. So perhaps this is old fashion, but I wanted to start using D by whipping together nice little personal utilities. I tried installing MonoDevelop and Mono-D. I can't even figure out the basics, such as adding references to a project. There are no

Re: Learning D

2014-08-25 Thread Ryan via Digitalmars-d-learn
Thanks for both responses. This is the information I was looking for. I have DMD, GTK# (For MonoDevelop), MonoDevelop, MonoD, dubs, and GTKD installed. I've got some things to compile... So the crux of my issue is that I can't figure out how to link lib files in MonoDevelop. I wonder if

Re: Learning D

2014-08-25 Thread Ryan via Digitalmars-d-learn
Anyone know MonoDevelop? Why is the Edit References context menu item missing. I have it at the top (Project-Edit References...) but when I click it nothing happens. Grrr.

Re: Learning D

2014-08-25 Thread Ryan via Digitalmars-d-learn
On Monday, 25 August 2014 at 18:12:25 UTC, Colin wrote: On Monday, 25 August 2014 at 17:57:54 UTC, Ryan wrote: Anyone know MonoDevelop? Why is the Edit References context menu item missing. I have it at the top (Project-Edit References...) but when I click it nothing happens. Grrr. I