Re: Does betterC work different on windows and linux?

2019-11-14 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Thursday, 14 November 2019 at 16:47:59 UTC, kinke wrote: The -betterC for that app doesn't imply that its dependencies are compiled with -betterC too. So either also specify that flag in your library's dub config, or build the app with `DFLAGS=-betterC dub ...`. Thank you, I added some

Re: Unexpected result with std.conv.to

2019-11-14 Thread Joel via Digitalmars-d-learn
On Friday, 15 November 2019 at 04:26:58 UTC, Jon Degenhardt wrote: On Friday, 15 November 2019 at 03:51:04 UTC, Joel wrote: I made a feature that converts, say, [9:59am] -> [10:00am] to 1 minute. but found '9'.to!int = 57 (not 9). Doesn't seem right... I'm guessing that's standard though,

Re: Unexpected result with std.conv.to

2019-11-14 Thread Jon Degenhardt via Digitalmars-d-learn
On Friday, 15 November 2019 at 03:51:04 UTC, Joel wrote: I made a feature that converts, say, [9:59am] -> [10:00am] to 1 minute. but found '9'.to!int = 57 (not 9). Doesn't seem right... I'm guessing that's standard though, same with ldc. Use a string or char[] array. e.g.

Unexpected result with std.conv.to

2019-11-14 Thread Joel via Digitalmars-d-learn
I made a feature that converts, say, [9:59am] -> [10:00am] to 1 minute. but found '9'.to!int = 57 (not 9). Doesn't seem right... I'm guessing that's standard though, same with ldc.

Re: Translating Java into D

2019-11-14 Thread Heromyth via Digitalmars-d-learn
On Thursday, 14 November 2019 at 19:50:22 UTC, NonNull wrote: Greetings, Java seems to be almost a subset of D in various ways. No, it's not exactly right. Java is more powerful than D as for a language. Many things that Java can do can't be done by D. For example, reflection, full meta info

Re: csvReader & specifying separator problems...

2019-11-14 Thread Jon Degenhardt via Digitalmars-d-learn
On Thursday, 14 November 2019 at 12:25:30 UTC, Robert M. Münch wrote: Just trying a very simple thing and it's pretty hard: "Read a CSV file (raw_data) that has a ; separator so that I can iterate over the lines and access the fields." csv_data = raw_data.byLine.joiner("\n") From the

Re: csvReader & specifying separator problems...

2019-11-14 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-11-14 13:08:10 +, Mike Parker said: Contents, ErrorLevel, Range, and Separator are template (i.e. compile-time) parameters. Input, delimiter, and quote are function (i.e. runtime) parameters. Mike, thanks a lot... I feel like an idiot. As casual D programmer the template-syntax

Translating Java into D

2019-11-14 Thread NonNull via Digitalmars-d-learn
Greetings, Java seems to be almost a subset of D in various ways. Has there been any work done to automatically translate Java source into D?

Re: Dlang + QtE5 + "Qt Designer": How convert .ui to .d Grafic Interface?

2019-11-14 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Thursday, 14 November 2019 at 19:07:56 UTC, Marcone wrote: Hi, I use Dlang with QtE5 to make my programs with GUI. If QT is is not a must, you can go for gtkd + Glade designer. I wrote a small utility to work together with Glade and gtkd. please note that it doesn't convert all fields of

Dlang + QtE5 + "Qt Designer": How convert .ui to .d Grafic Interface?

2019-11-14 Thread Marcone via Digitalmars-d-learn
Hi, I use Dlang with QtE5 to make my programs with GUI. I want to design my program with "Qt Designer" and convert .ui file to .d file for use with Dlang + QtE5. In Python, Ruby, C++ you can designe GUI using "Qt Designer" and convert to respective language using uic.exe. I found this duic

Re: CI: Why Travis & Circle

2019-11-14 Thread jmh530 via Digitalmars-d-learn
On Thursday, 14 November 2019 at 17:06:36 UTC, Andre Pany wrote: [snip] With the public availability of Github Actions I highly recommend it if you have open source project on Github. If is free and works well with D and Dub. Kind regards Andre I'm not that familiar with Github Actions,

Re: CI: Why Travis & Circle

2019-11-14 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 14 November 2019 at 13:47:32 UTC, jmh530 wrote: I'm curious what the typical motivation is for using both Travis CI and Circle CI in a project is. Thanks. With the public availability of Github Actions I highly recommend it if you have open source project on Github. If is free

Re: Why same pointer type for GC and manual memory?

2019-11-14 Thread kinke via Digitalmars-d-learn
On Thursday, 14 November 2019 at 01:08:58 UTC, Suleyman wrote: On Wednesday, 13 November 2019 at 16:43:27 UTC, IGotD- wrote: Best example is probably managed C++, an MS extension to C++ which is now deprecated. MS Managed C++ was superseded by C++/CLI[1] which was standardized. They actually

Re: Does betterC work different on windows and linux?

2019-11-14 Thread kinke via Digitalmars-d-learn
On Thursday, 14 November 2019 at 16:34:07 UTC, Ferhat Kurtulmuş wrote: I could also run the code in that way. Probably I have some problems with dub configurations. I get linking errors when I try to import the library in a newly created dub project, although there is "dflags": ["-betterC"] in

Re: Does betterC work different on windows and linux?

2019-11-14 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Thursday, 14 November 2019 at 16:12:19 UTC, kinke wrote: I can't reproduce this with LDC 1.17.0, after changing `unittest` to `extern (C) int main()` and returning 0 at the end; compiled & linked with `ldc2 -betterC stringnogc.d`. I could also run the code in that way. Probably I have some

Re: Does betterC work different on windows and linux?

2019-11-14 Thread kinke via Digitalmars-d-learn
I can't reproduce this with LDC 1.17.0, after changing `unittest` to `extern (C) int main()` and returning 0 at the end; compiled & linked with `ldc2 -betterC stringnogc.d`.

Re: Why same pointer type for GC and manual memory?

2019-11-14 Thread Kagamin via Digitalmars-d-learn
On Wednesday, 13 November 2019 at 16:43:27 UTC, IGotD- wrote: On Wednesday, 13 November 2019 at 15:30:33 UTC, Dukc wrote: I'm not 100% sure what managed pointers mean -Are they so that you can't pass them to unregistered memory? A library solution would likely do -wrap the pointer in a

Does betterC work different on windows and linux?

2019-11-14 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
I was trying to make my stupid writeln2 function (https://github.com/aferust/stringnogc/blob/master/source/stringnogc.d) compatible with betterC. writeln2() calls obParse() function which may contain some code incompatible with betterC. However; while the code in the unittest can be compiled and

CI: Why Travis & Circle

2019-11-14 Thread jmh530 via Digitalmars-d-learn
I'm curious what the typical motivation is for using both Travis CI and Circle CI in a project is. Thanks.

Re: csvReader & specifying separator problems...

2019-11-14 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 14 November 2019 at 12:25:30 UTC, Robert M. Münch wrote: From the docs, which I find extremly hard to understand: auto csvReader(Contents = string, Malformed ErrorLevel = Malformed.throwException, Range, Separator = char)(Range input, Separator delimiter = ',', Separator quote 

csvReader & specifying separator problems...

2019-11-14 Thread Robert M. Münch via Digitalmars-d-learn
Just trying a very simple thing and it's pretty hard: "Read a CSV file (raw_data) that has a ; separator so that I can iterate over the lines and access the fields." csv_data = raw_data.byLine.joiner("\n") From the docs, which I find extremly hard to understand: auto 

Re: Should I stop being interested in D language if I don't like to see template instantiation in my code?

2019-11-14 Thread Simen Kjærås via Digitalmars-d-learn
On Thursday, 14 November 2019 at 09:30:23 UTC, user9876 wrote: A good thing is that in many cases the template instance parameters can be deduced from the arguments used: --- import std; void main() { assert(max(0,1) == 1); // same as assert(max!(int,int)(0,1) == 1); } --- This

Re: Should I stop being interested in D language if I don't like to see template instantiation in my code?

2019-11-14 Thread user9876 via Digitalmars-d-learn
On Wednesday, 13 November 2019 at 14:01:13 UTC, BoQsc wrote: I don't like to see exclamation marks in my code in as weird syntax as these ones: to!ushort(args[1]) s.formattedRead!"%s!%s:%s"(a, b, c); I'm not sure why, but template instantiation syntax is prevalent in the documentation