Re: Undefined symbol for, apparently, valid code?

2017-07-05 Thread rikki cattermole via Digitalmars-d-learn
On 06/07/2017 7:28 AM, unleashy wrote: Hello. I am trying to compile this: --- module asd.asd; abstract class Asd { void opCall(Args...)(Args args); } @system unittest { class Foo : Asd { override void opCall(Args...)(Args args) { /* nothing */

Undefined symbol for, apparently, valid code?

2017-07-05 Thread unleashy via Digitalmars-d-learn
Hello. I am trying to compile this: --- module asd.asd; abstract class Asd { void opCall(Args...)(Args args); } @system unittest { class Foo : Asd { override void opCall(Args...)(Args args) { /* nothing */ } } Asd a = new Foo(); a(1,

Check if a variadic argument is numeric?

2017-07-05 Thread Hamborg via Digitalmars-d-learn
I can test for exactly what what the args are with (_arguments[i] == typeid(int)) but if I just want to know if it's numeric and can pull it out as a double what should I do? I don't really want to test for int, uint, byte, float, etc individually.

Re: unittest-cov - results?

2017-07-05 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 19:01:06 UTC, Jonathan M Davis wrote: I ran into a bug in dub not all that long ago where the tests in the module with main in it weren't actually being run even though the other tests were. (which reminds me, I should verify that again and report it). - Jonathan

Re: unittest-cov - results?

2017-07-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, July 05, 2017 19:13:21 Jolly James via Digitalmars-d-learn wrote: > On Wednesday, 5 July 2017 at 19:01:06 UTC, Jonathan M Davis wrote: > > On Wednesday, July 05, 2017 18:50:32 Jolly James via > > > > Digitalmars-d-learn wrote: > >> On Wednesday, 5 July 2017 at 18:46:38 UTC, Jolly Jam

Re: GtkD nothing

2017-07-05 Thread FoxyBrown via Digitalmars-d-learn
Unfortunately, importing that module seems to throw an error for some insane reason. Error 42: Symbol Undefined _D3gtk6All12__ModuleInfoZ (gtk.AllGTK.__ModuleInfo) without importing it in to the project(but directly importing all the other modules works fine, e.g., copying and pasting).

Re: GtkD nothing

2017-07-05 Thread FoxyBrown via Digitalmars-d-learn
The module All in GtkD\generated\Gtkd\gtk will allow importing everything, e.g. import gtk = gtk.All; gtk.MainWindow etc. All.d-- module gtk.All; public import gtk.AboutDialog; public import gtk.AccelGroup; public import gtk.AccelLabel; public import gtk.AccelMap; public import

Re: GtkD nothing

2017-07-05 Thread FoxyBrown via Digitalmars-d-learn
On Thursday, 6 July 2017 at 01:06:38 UTC, FoxyBrown wrote: On Thursday, 6 July 2017 at 01:03:11 UTC, FoxyBrown wrote: On Thursday, 6 July 2017 at 00:51:40 UTC, FoxyBrown wrote: [...] Running it from the command line showed it wasn't finding the gtk dll. The path variable is set up correctly.

Re: GtkD nothing

2017-07-05 Thread FoxyBrown via Digitalmars-d-learn
On Thursday, 6 July 2017 at 01:03:11 UTC, FoxyBrown wrote: On Thursday, 6 July 2017 at 00:51:40 UTC, FoxyBrown wrote: [...] Running it from the command line showed it wasn't finding the gtk dll. The path variable is set up correctly. I copied the bin dir to the exe and it ran and worked exce

Re: GtkD nothing

2017-07-05 Thread FoxyBrown via Digitalmars-d-learn
On Thursday, 6 July 2017 at 00:51:40 UTC, FoxyBrown wrote: import gtk.MainWindow; import gtk.Label; import gtk.Main; import std.stdio; pragma(lib, "C:\\DLang\\GtkD\\x86\\gtkd.lib"); void main(string[] args) { Main.init(args); MainWindow win = new MainWindow("Hello World");

GtkD nothing

2017-07-05 Thread FoxyBrown via Digitalmars-d-learn
import gtk.MainWindow; import gtk.Label; import gtk.Main; import std.stdio; pragma(lib, "C:\\DLang\\GtkD\\x86\\gtkd.lib"); void main(string[] args) { Main.init(args); MainWindow win = new MainWindow("Hello World"); win.setDefaultSize(200, 100); win.add(new Label("Hello

rdmd issues

2017-07-05 Thread FoxyBrown via Digitalmars-d-learn
rdmd -m64 Build.d Error: can't run 'C:\Program Files\VS\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64', check PATH The path exists, but since it doesn't tell me what it is trying to run, I have no clue. The path contains link.exe.

Re: [BEGINNER] reccurence! and sequence!

2017-07-05 Thread Ali Çehreli via Digitalmars-d-learn
On 07/05/2017 04:38 PM, helxi wrote: >> >> sequence!((a, n) => a[0] + 1)(1).take(10).writeln; >> // [2, 2, 2, 2, 2, 2, 2, 2, 2, 2] >> // because a[0] is always 1 >> >> recurrence!((a, n) => a[0] + 1)(1).take(10).writeln; >> // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] >> // because a[0

Re: dub + local dependencies

2017-07-05 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 6 July 2017 at 00:09:46 UTC, Mike Parker wrote: You have a few options: * Use a path dependency: "dependencies": { "xyz": { "path": "path/to/xyz" } } * Use add-local with a version on the command line: dub add-local path/to/xyz 0.0.1 * Use add-local or add-

Re: dub + local dependencies

2017-07-05 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 15:34:36 UTC, Jolly James wrote: WARNING: A deprecated branch based version specification is used for the dependency xyz. Please use numbered versions instead. Also note that you can still use the dub.selections.json file to override a certain dependency to use a br

Re: [BEGINNER] reccurence! and sequence!

2017-07-05 Thread helxi via Digitalmars-d-learn
On Monday, 26 June 2017 at 10:34:22 UTC, ag0aep6g wrote: On 06/26/2017 11:51 AM, helxi wrote: [...] `a` is a tuple of the run-time arguments you pass to `sequence`. In this example, no arguments are passed (empty parens at the end of the call), so `a` is empty. [...] a[0] = 1 a[1] = 2

Re: Question on @nothrow

2017-07-05 Thread Ali Çehreli via Digitalmars-d-learn
On 06/02/2017 12:35 AM, Vasileios Anagnostopoulos wrote: > On Friday, 2 June 2017 at 07:33:05 UTC, Vasileios Anagnostopoulos wrote: >> But still I believe that @nothrow should be mandatory if there is no >> possibility for a function to throw something. I understand that in >> the DLL/LIB level t

Re: Question on @nothrow

2017-07-05 Thread Yuxuan Shui via Digitalmars-d-learn
On Wednesday, 31 May 2017 at 09:31:48 UTC, Jonathan M Davis wrote: On Wednesday, May 31, 2017 08:18:07 Vasileios Anagnostopoulos via Digitalmars-d-learn wrote: [...] Well, if you're not doing checked exceptions, the interesting question is really what _doesn't_ throw rather than what throws,

Re: Question on @nothrow

2017-07-05 Thread Yuxuan Shui via Digitalmars-d-learn
On Wednesday, 31 May 2017 at 08:18:07 UTC, Vasileios Anagnostopoulos wrote: Hi, after reading various articles bout the "supposed" drawbacks of checked exceptions I started to have questions on @nothrow. Why there exists and not a @throws annotation enforced by the compiler? I understand that

Re: unittest-cov - results?

2017-07-05 Thread Jolly James via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 19:01:06 UTC, Jonathan M Davis wrote: On Wednesday, July 05, 2017 18:50:32 Jolly James via Digitalmars-d-learn wrote: On Wednesday, 5 July 2017 at 18:46:38 UTC, Jolly James wrote: > On Wednesday, 5 July 2017 at 18:09:46 UTC, Seb wrote: >> [...] > > where would I find

Re: unittest-cov - results?

2017-07-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, July 05, 2017 18:50:32 Jolly James via Digitalmars-d-learn wrote: > On Wednesday, 5 July 2017 at 18:46:38 UTC, Jolly James wrote: > > On Wednesday, 5 July 2017 at 18:09:46 UTC, Seb wrote: > >> On Wednesday, 5 July 2017 at 17:46:01 UTC, Jolly James wrote: > >>> [...] > >> > >> For eve

Re: unittest-cov - results?

2017-07-05 Thread Jolly James via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 18:46:38 UTC, Jolly James wrote: On Wednesday, 5 July 2017 at 18:09:46 UTC, Seb wrote: On Wednesday, 5 July 2017 at 17:46:01 UTC, Jolly James wrote: [...] For every file a `.lst` file is generated (it's the same how `-cov` behaves at DMD). These .lst files contai

Re: unittest-cov - results?

2017-07-05 Thread Jolly James via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 18:09:46 UTC, Seb wrote: On Wednesday, 5 July 2017 at 17:46:01 UTC, Jolly James wrote: [...] For every file a `.lst` file is generated (it's the same how `-cov` behaves at DMD). These .lst files contain the original source code with number of hits of a respective

Re: unittest-cov - results?

2017-07-05 Thread Seb via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 17:46:01 UTC, Jolly James wrote: How does unit testing with dub work? dub build --arch=x86_64 --build=unittest-cov --force --compiler=ldc2 After execution, there is no result output in the command line. For every file a `.lst` file is generated (it's the same h

Re: Remove instance from array

2017-07-05 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Jul 05, 2017 at 05:07:14PM +, Jolly James via Digitalmars-d-learn wrote: > On Wednesday, 5 July 2017 at 16:55:43 UTC, bachmeier wrote: > > On Wednesday, 5 July 2017 at 16:04:16 UTC, Jolly James wrote: > > > > > Here in D everything looks like climbing mount everest. When you > > > ask

unittest-cov - results?

2017-07-05 Thread Jolly James via Digitalmars-d-learn
How does unit testing with dub work? dub build --arch=x86_64 --build=unittest-cov --force --compiler=ldc2 After execution, there is no result output in the command line.

Re: Remove instance from array

2017-07-05 Thread Jolly James via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 16:55:43 UTC, bachmeier wrote: On Wednesday, 5 July 2017 at 16:04:16 UTC, Jolly James wrote: Here in D everything looks like climbing mount everest. When you ask how to use D's containers you are recommended to use dynamic arrays instead. When you look at the docs

Re: Remove instance from array

2017-07-05 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 16:04:16 UTC, Jolly James wrote: Here in D everything looks like climbing mount everest. When you ask how to use D's containers you are recommended to use dynamic arrays instead. When you look at the docs for std.algorithm, e.g. the .remove section, you get bombed

Re: Remove instance from array

2017-07-05 Thread Jolly James via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 16:04:16 UTC, Jolly James wrote: On Wednesday, 5 July 2017 at 15:56:45 UTC, Igor Shirkalin wrote: [...] Thank you! :) But why a containers so complicated in D? [...] Part of CoreCLR's 'List': public bool Remove(T item) { int index

Re: Remove instance from array

2017-07-05 Thread Igor Shirkalin via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 16:04:16 UTC, Jolly James wrote: On Wednesday, 5 July 2017 at 15:56:45 UTC, Igor Shirkalin wrote: On Wednesday, 5 July 2017 at 15:48:14 UTC, Jolly James wrote: On Wednesday, 5 July 2017 at 15:44:47 UTC, Igor Shirkalin wrote: On Wednesday, 5 July 2017 at 15:30:08 UT

mysql-native ResultRange + map

2017-07-05 Thread crimaniak via Digitalmars-d-learn
Hi all! After some hard time with debugging, I found ResultRange returned by query() and Prepared::query() of mysql-native package can't be combined with map() because after map() it becomes empty resultset. Code (conn.queryRows just a wrapper for query(Connections, sql) ): immutabl

Re: Remove instance from array

2017-07-05 Thread Jolly James via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 15:56:45 UTC, Igor Shirkalin wrote: On Wednesday, 5 July 2017 at 15:48:14 UTC, Jolly James wrote: On Wednesday, 5 July 2017 at 15:44:47 UTC, Igor Shirkalin wrote: On Wednesday, 5 July 2017 at 15:30:08 UTC, Jolly James wrote: WhatEver[] q = []; [...] auto i = new

Re: Remove instance from array

2017-07-05 Thread Igor Shirkalin via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 15:48:14 UTC, Jolly James wrote: On Wednesday, 5 July 2017 at 15:44:47 UTC, Igor Shirkalin wrote: On Wednesday, 5 July 2017 at 15:30:08 UTC, Jolly James wrote: WhatEver[] q = []; [...] auto i = new WhatEver(); q[] = i; How does one remove that instance 'i'? W

Re: Remove instance from array

2017-07-05 Thread Jolly James via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 15:44:47 UTC, Igor Shirkalin wrote: On Wednesday, 5 July 2017 at 15:30:08 UTC, Jolly James wrote: WhatEver[] q = []; [...] auto i = new WhatEver(); q[] = i; How does one remove that instance 'i'? What exactly do you want to remove? After a[]=i your array cont

Re: Remove instance from array

2017-07-05 Thread Igor Shirkalin via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 15:30:08 UTC, Jolly James wrote: WhatEver[] q = []; [...] auto i = new WhatEver(); q[] = i; How does one remove that instance 'i'? What exactly do you want to remove? After a[]=i your array contain a lot of references to 'i'.

Re: Remove instance from array

2017-07-05 Thread Andrea Fontana via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 15:30:08 UTC, Jolly James wrote: WhatEver[] q = []; [...] auto i = new WhatEver(); q[] = i; How does one remove that instance 'i'? Maybe: http://dlang.org/phobos/std_algorithm_mutation.html#.remove ?

dub + local dependencies

2017-07-05 Thread Jolly James via Digitalmars-d-learn
WARNING: A deprecated branch based version specification is used for the dependency xyz. Please use numbered versions instead. Also note that you can still use the dub.selections.json file to override a certain dependency to use a branch instead. The problem is: xyz is a local package and the

Re: how to harvest the results of tasks from a taskpool?

2017-07-05 Thread Martin Tschierschke via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 13:55:22 UTC, Martin wrote: Hi, i have a coulpe of different machines with MySQL Servers running on it. Now, i want to execute queries for all Databases at the same time and collect the Result to process it. I am new to the parallelism - so maybe i understand som

Remove instance from array

2017-07-05 Thread Jolly James via Digitalmars-d-learn
WhatEver[] q = []; [...] auto i = new WhatEver(); q[] = i; How does one remove that instance 'i'?

how to harvest the results of tasks from a taskpool?

2017-07-05 Thread Martin via Digitalmars-d-learn
Hi, i have a coulpe of different machines with MySQL Servers running on it. Now, i want to execute queries for all Databases at the same time and collect the Result to process it. I am new to the parallelism - so maybe i understand something totaly wrong. What i tring is something like this

Re: Need simple sound

2017-07-05 Thread Martin Tschierschke via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 10:19:54 UTC, Sebastiaan Koppe wrote: On Wednesday, 5 July 2017 at 09:43:05 UTC, Martin Tschierschke wrote: On Wednesday, 5 July 2017 at 07:21:45 UTC, Sebastiaan Koppe wrote: On Wednesday, 5 July 2017 at 05:34:37 UTC, FoxyBrown wrote: On Tuesday, 4 July 2017 at 20:3

Re: weird error message

2017-07-05 Thread crimaniak via Digitalmars-d-learn
On Sunday, 2 July 2017 at 01:06:29 UTC, Ali Çehreli wrote: On 07/01/2017 04:56 PM, crimaniak wrote: > about very long error messages generated in some > cases. Please submit a bug report. The compiler may be able to abbreviate certain types. For example, in this case most of the error message

Re: Append to 'map' result

2017-07-05 Thread Jean-Louis Leroy via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 01:43:46 UTC, Ali Çehreli wrote: On 07/04/2017 05:52 PM, Jean-Louis Leroy wrote: On Wednesday, 5 July 2017 at 00:28:01 UTC, Ali Çehreli wrote: On 07/04/2017 04:57 PM, Jean-Louis Leroy wrote: [...] No time to dig deeper but this is because the two ranges that chain

Re: Cannot implicitly convert expression (struct this)

2017-07-05 Thread Andre Pany via Digitalmars-d-learn
On Friday, 23 June 2017 at 15:52:10 UTC, Kagamin wrote: On Thursday, 22 June 2017 at 09:57:44 UTC, Andre Pany wrote: This line raises the error: TestStruct s2 = TestStruct(Reason.FU); Error: cannot implicitly convert expression ("Fu") of type Reason to InitialEnum!(Reason) While this line is

Re: About Dub capabilities

2017-07-05 Thread Seb via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 06:06:18 UTC, Dukc wrote: On Tuesday, 4 July 2017 at 21:02:55 UTC, Martin Nowak wrote: preGenerate-/preBuildCommands are your friends to compile C++ code using dub. Hod did I not notice them... but that answers the question, thanks. See https://github.com/dlang-

Re: Need simple sound

2017-07-05 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 09:43:05 UTC, Martin Tschierschke wrote: On Wednesday, 5 July 2017 at 07:21:45 UTC, Sebastiaan Koppe wrote: On Wednesday, 5 July 2017 at 05:34:37 UTC, FoxyBrown wrote: On Tuesday, 4 July 2017 at 20:37:44 UTC, Sebastiaan Koppe wrote: Portaudio is simple as well. And

Re: Need simple sound

2017-07-05 Thread Martin Tschierschke via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 07:21:45 UTC, Sebastiaan Koppe wrote: On Wednesday, 5 July 2017 at 05:34:37 UTC, FoxyBrown wrote: On Tuesday, 4 July 2017 at 20:37:44 UTC, Sebastiaan Koppe wrote: Portaudio is simple as well. And nice cross platform. are there any bindings? Sure, see http://code

Re: Need simple sound

2017-07-05 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 05:34:37 UTC, FoxyBrown wrote: On Tuesday, 4 July 2017 at 20:37:44 UTC, Sebastiaan Koppe wrote: Portaudio is simple as well. And nice cross platform. are there any bindings? Sure, see http://code.dlang.org/packages/portaudio