problems with swig generated code

2019-08-28 Thread Martin DeMello via Digitalmars-d-learn
I'm trying to add a D binding to a C++ project that already has a swig definition file; you can see my attempt here: https://github.com/martindemello/quackle/tree/d/bindings but trying to run dmd over the generated file errors with: $ dmd quackle.d quackle.d(105): Error: undefined identifier S

Re: Question about generation of template functions

2019-08-28 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, August 28, 2019 2:56:25 PM MDT Machine Code via Digitalmars-d- learn wrote: > I was writing a recursive function that uses template, I thought > it would generate the proper template function on the fly to > match the type in the parameter but it seems to not so so and try > > to use

Question about generation of template functions

2019-08-28 Thread Machine Code via Digitalmars-d-learn
I was writing a recursive function that uses template, I thought it would generate the proper template function on the fly to match the type in the parameter but it seems to not so so and try to use the called function, resulting in the error: Error: function foo.serialize!(B).serialize(ref B

Re: Deactivate windows MessageBox dialog on exception

2019-08-28 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 28 August 2019 at 13:15:14 UTC, a11e99z wrote: On Wednesday, 28 August 2019 at 12:19:54 UTC, Andre Pany wrote: Hi, I call another process using function pipeShell and Redirect.all. import std; void main() { auto p = pipeShell("a.exe", Redirect.all); p.stdin.writeln("

Re: Use std.string.lineSplitter with std.array.Appender!string

2019-08-28 Thread NonNull via Digitalmars-d-learn
On Wednesday, 28 August 2019 at 15:56:55 UTC, Anonymouse wrote: On Wednesday, 28 August 2019 at 15:52:18 UTC, NonNull wrote: Disambiguate how ? ``` import std.string, std.array; auto s = appender!string; // ... auto a = s.lineSplitter; ``` auto a = s.data.lineSplitter; O

Re: Use std.string.lineSplitter with std.array.Appender!string

2019-08-28 Thread Anonymouse via Digitalmars-d-learn
On Wednesday, 28 August 2019 at 15:52:18 UTC, NonNull wrote: Disambiguate how ? ``` import std.string, std.array; auto s = appender!string; // ... auto a = s.lineSplitter; ``` auto a = s.data.lineSplitter; On mobile, can't test.

Use std.string.lineSplitter with std.array.Appender!string

2019-08-28 Thread NonNull via Digitalmars-d-learn
Disambiguate how ? ``` import std.string, std.array; auto s = appender!string; // ... auto a = s.lineSplitter; ``` Error: template std.string.lineSplitter cannot deduce function from argument types !()(Appender!string), candidates are: std.string.lineSplitter(Flag keepTe

Re: Deactivate windows MessageBox dialog on exception

2019-08-28 Thread Gregor Mückl via Digitalmars-d-learn
On Wednesday, 28 August 2019 at 13:15:14 UTC, a11e99z wrote: On Wednesday, 28 August 2019 at 12:19:54 UTC, Andre Pany wrote: Hi, I call another process using function pipeShell and Redirect.all. import std; void main() { auto p = pipeShell("a.exe", Redirect.all); p.stdin.writeln("

Re: Deactivate windows MessageBox dialog on exception

2019-08-28 Thread a11e99z via Digitalmars-d-learn
On Wednesday, 28 August 2019 at 12:19:54 UTC, Andre Pany wrote: Hi, I call another process using function pipeShell and Redirect.all. import std; void main() { auto p = pipeShell("a.exe", Redirect.all); p.stdin.writeln("e1"); p.stdin.writeln("10"); p.stdin.writeln("e2");

Re: Input/Output multiple values from function

2019-08-28 Thread Jabari Zakiya via Digitalmars-d-learn
On Wednesday, 28 August 2019 at 10:10:08 UTC, Simen Kjærås wrote: On Wednesday, 28 August 2019 at 05:17:28 UTC, Jabari Zakiya wrote: Inside func2 I create an input value for func1 and then assign func1's 4 outputs to named variable. That's where the problems arise. func1 does some math based on

Re: Deactivate windows MessageBox dialog on exception

2019-08-28 Thread Gregor Mückl via Digitalmars-d-learn
On Wednesday, 28 August 2019 at 12:19:54 UTC, Andre Pany wrote: Hi, I call another process using function pipeShell and Redirect.all. In case the child process(also D application) throws an exception (str to int conversion exception), the child process shows a message box on windows. I fo

Re: Deactivate windows MessageBox dialog on exception

2019-08-28 Thread a11e99z via Digitalmars-d-learn
On Wednesday, 28 August 2019 at 12:19:54 UTC, Andre Pany wrote: and try to use https://docs.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-seterrormode SEM_FAILCRITICALERRORS for mother process and child process will inherit it

Re: Deactivate windows MessageBox dialog on exception

2019-08-28 Thread a11e99z via Digitalmars-d-learn
On Wednesday, 28 August 2019 at 12:19:54 UTC, Andre Pany wrote: Hi, I call another process using function pipeShell and Redirect.all. In case the child process(also D application) throws an exception (str to int conversion exception), the child process shows a message box on windows. 1)

Re: How to learn Phobos,Phbos hard to used for me.

2019-08-28 Thread lili via Digitalmars-d-learn
On Wednesday, 28 August 2019 at 12:32:59 UTC, Andre Pany wrote: On Wednesday, 28 August 2019 at 11:34:27 UTC, lili wrote: Hi: Masters who can write a book for Phbos, the dlang doc not friendly to beginner. There are 2 articles which I really like: http://nomad.uk.net/articles/hidden-trea

Re: Dub importPath and sourcePath variables

2019-08-28 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 28 August 2019 at 00:26:24 UTC, Max wrote: Hello, I am having a problem working with custom build types in Dub. For my project, when I perform a regular build, all of my source code is contained in ./source or ~/.dub/packages/. However, I want to specify a custom build type (cal

Re: How to learn Phobos,Phbos hard to used for me.

2019-08-28 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 28 August 2019 at 11:34:27 UTC, lili wrote: Hi: Masters who can write a book for Phbos, the dlang doc not friendly to beginner. There are 2 articles which I really like: http://nomad.uk.net/articles/hidden-treasure-in-the-d-standard-library.html http://nomad.uk.net/articles

Re: Pro programmer

2019-08-28 Thread Russel Winder via Digitalmars-d-learn
On Wed, 2019-08-28 at 04:46 +, Jani Hur via Digitalmars-d-learn wrote: > […] > For Lisp, Clojure (https://clojure.org/) is a strong candidate: > > https://blog.cleancoder.com/uncle-bob/2019/08/22/WhyClojure.html Common Lisp implementations may still have car, cdr, etc. for backward compatibi

Deactivate windows MessageBox dialog on exception

2019-08-28 Thread Andre Pany via Digitalmars-d-learn
Hi, I call another process using function pipeShell and Redirect.all. In case the child process(also D application) throws an exception (str to int conversion exception), the child process shows a message box on windows. I found the source code within DRuntime but I do not see a way to hide

How to learn Phobos,Phbos hard to used for me.

2019-08-28 Thread lili via Digitalmars-d-learn
Hi: Masters who can write a book for Phbos, the dlang doc not friendly to beginner.

Re: Java to D

2019-08-28 Thread GreatSam4sure via Digitalmars-d-learn
On Wednesday, 28 August 2019 at 09:35:55 UTC, Jacob Carlborg wrote: On 2019-08-28 10:14, GreatSam4sure wrote: [...] DWT is ported manually from Java. Here's a very short guide [1]. That guide is probably written for D1. [...] I'm working on a tool do be able to automatically convert Java

Re: Input/Output multiple values from function

2019-08-28 Thread Simen Kjærås via Digitalmars-d-learn
On Wednesday, 28 August 2019 at 05:17:28 UTC, Jabari Zakiya wrote: Inside func2 I create an input value for func1 and then assign func1's 4 outputs to named variable. That's where the problems arise. func1 does some math based on the input and generates 4 outputs. I can't do (a, b, c,d) = fun

Re: Java to D

2019-08-28 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-08-28 10:14, GreatSam4sure wrote: Good day everyone. DWT is a library for creating cross-platform GUI applications. It's a port of the SWT Java library from Eclipse. Currently supported platforms are Windows, using Win32 and Linux, using GTK. What are the tools and step involved in c

Java to D

2019-08-28 Thread GreatSam4sure via Digitalmars-d-learn
Good day everyone. DWT is a library for creating cross-platform GUI applications. It's a port of the SWT Java library from Eclipse. Currently supported platforms are Windows, using Win32 and Linux, using GTK. What are the tools and step involved in converting a java GUI toolkit to D2? Is it

Re: Sort Associative Array by Key

2019-08-28 Thread a11e99z via Digitalmars-d-learn
On Tuesday, 27 August 2019 at 20:35:16 UTC, bachmeier wrote: On Tuesday, 27 August 2019 at 20:14:21 UTC, Machine Code wrote: It isn't really hard: It really is hard. foo.byPair.array.sort!((a, b) => a.key < b.key).map!(a => a.value); is a lot to digest for someone learning the language. The

Re: Sort Associative Array by Key

2019-08-28 Thread berni via Digitalmars-d-learn
On Tuesday, 27 August 2019 at 16:25:00 UTC, Samir wrote: As I've mentioned on the list before, I really struggle to understand how some of the std.algorithm functions such as `map` work when combined with things like `array`, `sort` and especially `zip` but really appreciate the support I find

Re: Input/Output multiple values from function

2019-08-28 Thread a11e99z via Digitalmars-d-learn
On Wednesday, 28 August 2019 at 05:17:28 UTC, Jabari Zakiya wrote: On Wednesday, 28 August 2019 at 04:39:23 UTC, Mike Parker wrote: On Wednesday, 28 August 2019 at 04:19:49 UTC, Jabari Zakiya wrote: I have a function (say func1) that takes 1 input value (an integer number) and outputs 4 values