Is there any writeln like functions without GC?

2019-10-30 Thread lili via Digitalmars-d-learn
Hi: why writeln need GC?

Re: Gtkd and libgtksourceview

2019-10-30 Thread bioinfornatics via Digitalmars-d-learn
On Wednesday, 30 October 2019 at 22:26:41 UTC, Mike Wey wrote: On 30-10-2019 20:17, Ron Tarrant wrote: [...] Thanks. [...] The installer could use an update, Sourceview 4 is available for windows. [...] For windows there isn't an easy command to regenerate the source, but running

Re: Gtkd and libgtksourceview

2019-10-30 Thread Mike Wey via Digitalmars-d-learn
On 30-10-2019 20:17, Ron Tarrant wrote: On Wednesday, 30 October 2019 at 18:00:24 UTC, Mike Wey wrote: GtkSourceview was updated to 4.x in GtkD version 3.9.0, so any older version should work with GtkSourceview 3. Welcome back, Mike... Thanks. The latest Windows runtime available on the

Re: Bug or Feature: `this` necessary to call function with template this parameter

2019-10-30 Thread Simen Kjærås via Digitalmars-d-learn
On Wednesday, 30 October 2019 at 20:22:25 UTC, Q. Schroll wrote: struct Example { private void helper(int i, this X)() { } void funcTempl(T, this X)(T value) { this.helper!0(); // ^ Why do I need this? } } void main() { auto ex = Example();

Re: Running unittests of a module with -betterC

2019-10-30 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 30 October 2019 at 18:45:50 UTC, Jacob Carlborg wrote: On 2019-10-30 16:09, jmh530 wrote: I feel like this should be added into the compiler so that it just works. This will only run the unit tests in the current modules. The standard way of running the unit tests will run the

Bug or Feature: `this` necessary to call function with template this parameter

2019-10-30 Thread Q. Schroll via Digitalmars-d-learn
struct Example { private void helper(int i, this X)() { } void funcTempl(T, this X)(T value) { this.helper!0(); // ^ Why do I need this? } } void main() { auto ex = Example(); ex.funcTempl(1); } The question is in the comment in the code. Is that

Array Vararg Template Paremeters

2019-10-30 Thread Q. Schroll via Digitalmars-d-learn
For a function, one can have a vararg parameter at the end like this: int sum(int[] ar ...) { /* code */ } But for templates, such a declaration is an error. Is there a specific reason why? I know I can do it and ensure all the template parameters are values and are convertible to the desired

Re: Good way let low-skill people edit CSV files with predefined row names?

2019-10-30 Thread Dukc via Digitalmars-d-learn
On Friday, 25 October 2019 at 21:58:27 UTC, Laeeth Isharc wrote: Another Symmetry project allows reading Excel files and a third is wrapper and bindings around a C library to write Excel files. We use them in production daily though there may be rough edges for features we don't use. I

Re: Gtkd and libgtksourceview

2019-10-30 Thread Ron Tarrant via Digitalmars-d-learn
On Wednesday, 30 October 2019 at 18:00:24 UTC, Mike Wey wrote: GtkSourceview was updated to 4.x in GtkD version 3.9.0, so any older version should work with GtkSourceview 3. Welcome back, Mike... The latest Windows runtime available on the GtkD downloads page installs

Re: Help playing sounds using arsd.simpleaudio

2019-10-30 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 26 October 2019 at 19:48:33 UTC, Murilo wrote: I play a sound the program never ends, the terminal continues to run the program and I have to end it manually. Any ideas what could be causing this? I am using it just as you had instructed. That happens if you don't call .stop()

Stream-based on-the-fly-download-and-decompress parsing of files

2019-10-30 Thread Per Nordlöw via Digitalmars-d-learn
Has anybody put together a File-compatible web-download API? Mu goal is to do have it do 1. stream-based download (via http or https), 2. compress (with gzip or bzip2) and 3. textual parse of resources available either on the web or locally cached. An extra bonus would be if the API provided

Re: Running unittests of a module with -betterC

2019-10-30 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-10-30 16:09, jmh530 wrote: I feel like this should be added into the compiler so that it just works. This will only run the unit tests in the current modules. The standard way of running the unit tests will run the unit tests in all modules. -- /Jacob Carlborg

Re: Gtkd and libgtksourceview

2019-10-30 Thread Mike Wey via Digitalmars-d-learn
On 30-10-2019 15:48, bioinfornatics wrote: Dear, I tried the latest gtkd release and it try to open dynamically libgtksourceview-4.so.0 however  I have only libgtksourceview-3.so.1 so which version should I used to be compatible with libgtksourceview-3 (I use centos 7) GtkSourceview was

Re: Gtkd and libgtksourceview

2019-10-30 Thread Ron Tarrant via Digitalmars-d-learn
On Wednesday, 30 October 2019 at 14:48:23 UTC, bioinfornatics wrote: so which version should I used to be compatible with libgtksourceview-3 (I use centos 7) When Mike Wey gets back in town (any day now) he should be able to provide a solution that's less of a kludge.

Re: Gtkd and libgtksourceview

2019-10-30 Thread Ron Tarrant via Digitalmars-d-learn
On Wednesday, 30 October 2019 at 14:48:23 UTC, bioinfornatics wrote: I tried the latest gtkd release and it try to open dynamically libgtksourceview-4.so.0 however I have only libgtksourceview-3.so.1 On Windows, I had to change a line in C:\D\dmd2\src\sourceview\gsv\c\functions.d from:

Re: Running unittests of a module with -betterC

2019-10-30 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 30 October 2019 at 15:09:40 UTC, jmh530 wrote: [snip] I feel like this should be added into the compiler so that it just works. Hmm, maybe only when compiled with -main, but I don't think there's a version for that.

Re: Accuracy of floating point calculations

2019-10-30 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Oct 30, 2019 at 09:03:49AM +0100, Robert M. Münch via Digitalmars-d-learn wrote: > On 2019-10-29 17:43:47 +, H. S. Teoh said: > > > On Tue, Oct 29, 2019 at 04:54:23PM +, ixid via Digitalmars-d-learn > > wrote: > > > On Tuesday, 29 October 2019 at 16:11:45 UTC, Daniel Kozak

Re: Running unittests of a module with -betterC

2019-10-30 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 29 October 2019 at 08:45:15 UTC, mipri wrote: [snip] -unittest sets the 'unittest' version identifier. So this works: unittest { assert(0); } version(unittest) { extern(C) void main() { static foreach(u; __traits(getUnitTests, __traits(parent, main)))

Gtkd and libgtksourceview

2019-10-30 Thread bioinfornatics via Digitalmars-d-learn
Dear, I tried the latest gtkd release and it try to open dynamically libgtksourceview-4.so.0 however I have only libgtksourceview-3.so.1 so which version should I used to be compatible with libgtksourceview-3 (I use centos 7) Code: $ ldc2 container_014_10_notebook_basic.d

PyD: Hello World program do not compile.

2019-10-30 Thread Georgios Papanikolaou via Digitalmars-d-learn
Hi, for those who do not know this is the github repository for the PyD I am using: https://github.com/ariovistus/pyd I just stared with PyD and I am trying to make it work. I have downloaded the latest release version and unzipped it in my working directory. Also I copied the two files from

Re: Read Once then reset/init value?

2019-10-30 Thread Simen Kjærås via Digitalmars-d-learn
On Wednesday, 30 October 2019 at 11:53:42 UTC, Jacob Carlborg wrote: On 2019-10-30 00:28, Simen Kjærås wrote: Something like this? T readOnce(T)(ref T value) {     auto tmp = value;     value = T.init;     return tmp; } unittest {     int i = 3;     assert(i.readOnce == 3);     assert(i

Re: Read Once then reset/init value?

2019-10-30 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-10-30 00:28, Simen Kjærås wrote: Something like this? T readOnce(T)(ref T value) {     auto tmp = value;     value = T.init;     return tmp; } unittest {     int i = 3;     assert(i.readOnce == 3);     assert(i == 0); } Perhaps better to encapsulate it in a struct to avoid

Re: Accuracy of floating point calculations

2019-10-30 Thread berni44 via Digitalmars-d-learn
On Tuesday, 29 October 2019 at 20:15:13 UTC, kinke wrote: Note that there's at least one bugzilla for these float/double math overloads already. For a start, one could simply wrap the corresponding C functions. I guess, that this issue: https://issues.dlang.org/show_bug.cgi?id=20206 boils

Re: Accuracy of floating point calculations

2019-10-30 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-10-29 17:43:47 +, H. S. Teoh said: On Tue, Oct 29, 2019 at 04:54:23PM +, ixid via Digitalmars-d-learn wrote: On Tuesday, 29 October 2019 at 16:11:45 UTC, Daniel Kozak wrote: On Tue, Oct 29, 2019 at 5:09 PM Daniel Kozak wrote: AFAIK dmd use real for floating point operations