Re: Enough D to Make a Living?

2017-02-22 Thread Shachar Shemesh via Digitalmars-d
On 22/02/17 13:26, Ola Fosheim Grøstad wrote: On Wednesday, 22 February 2017 at 09:09:45 UTC, Russel Winder wrote: Learning C++, then D, then Rust for example will have benefit because there are new things there even though the core computational model is effectively the same – they have

[Issue 17188] `core.stdc.stdlib.qsort()` is broken

2017-02-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17188 Walter Bright changed: What|Removed |Added Keywords||safe

[Issue 17164] [REG 2.072.0] undefined identifier '__va_argsave'

2017-02-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17164 Walter Bright changed: What|Removed |Added Status|NEW |RESOLVED

Re: simple static if / traits question...

2017-02-22 Thread WhatMeForget via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 22:37:25 UTC, Profile Anaysis wrote: On Wednesday, 22 February 2017 at 21:27:47 UTC, WhatMeWorry wrote: I'm doing conditional compilation using static ifs like so: enum bool audio = true; // if audio flag is present and set to true, add to code

Re: Threads not garbage collected ?

2017-02-22 Thread Chris Wright via Digitalmars-d
The thread you created holds a reference to the `class A` object, so that object can't be collected. This is what you probably want. As soon as the object is collected, its memory can be reused. But the thread still has a reference to it, so it can modify and read that memory. And whoever the

Re: Updates to the tsv-utils toolkit

2017-02-22 Thread Joakim via Digitalmars-d-announce
On Wednesday, 22 February 2017 at 18:12:50 UTC, Jon Degenhardt wrote: It's not quite a year since the open-sourcing of eBay's tsv utilities. Since then there have been a number of additions and updates, and the tools form a more complete package. The tools assist with manipulation of tabular

Re: nginx reverse proxy for vibe tutorial

2017-02-22 Thread zjh via Digitalmars-d
谢谢!

Re: cost of calling class function

2017-02-22 Thread Jonathan M Davis via Digitalmars-d
On Thursday, February 23, 2017 02:17:02 Jeremy DeHaan via Digitalmars-d wrote: > On Thursday, 23 February 2017 at 01:48:40 UTC, Seb wrote: > > AFAICT though it was approved, the switch to final by default > > has never happened. > > I believe Andrei made an executive decision to shut down final

Re: cost of calling class function

2017-02-22 Thread Jeremy DeHaan via Digitalmars-d
On Thursday, 23 February 2017 at 01:48:40 UTC, Seb wrote: AFAICT though it was approved, the switch to final by default has never happened. I believe Andrei made an executive decision to shut down final by default.

Re: cost of calling class function

2017-02-22 Thread Seb via Digitalmars-d
On Wednesday, 22 February 2017 at 23:49:43 UTC, Dušan Pavkov wrote: Hello, I have tried to measure how much would some simple task be faster in D than in C#. I ported some simple code from C# to D 1:1 almost without changes and C# code was faster. After eliminating causes one by one I have

Re: Updates to the tsv-utils toolkit

2017-02-22 Thread Jon Degenhardt via Digitalmars-d-announce
On Wednesday, 22 February 2017 at 21:07:43 UTC, bpr wrote: On Wednesday, 22 February 2017 at 18:12:50 UTC, Jon Degenhardt wrote: ...snip... Repository: https://github.com/eBay/tsv-utils-dlang Performance benchmarks: https://github.com/eBay/tsv-utils-dlang/blob/master/docs/Performance.md

cost of calling class function

2017-02-22 Thread Dušan Pavkov via Digitalmars-d
Hello, I have tried to measure how much would some simple task be faster in D than in C#. I ported some simple code from C# to D 1:1 almost without changes and C# code was faster. After eliminating causes one by one I have an example which shows where the problem is. If the function is

[Issue 16824] std.experimental.allocator.dispose leaks memory for arrays of more than 1 dimension

2017-02-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16824 --- Comment #12 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/64a0814ae426749a70decc5382b2fb3365a52a3e Issue 16824: fix experimental makeMultidimensionalArray

Re: Snowflake Strings

2017-02-22 Thread Walter Bright via Digitalmars-d-announce
Thanks, Mike!

DConf 2017 speaking proposals due Feb 28

2017-02-22 Thread Walter Bright via Digitalmars-d-announce
Feb 28 is coming up fast!

Re: Checking, whether string contains only ascii.

2017-02-22 Thread aberba via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 20:01:57 UTC, Adam D. Ruppe wrote: On Wednesday, 22 February 2017 at 19:26:15 UTC, berni wrote: herefore I'd like to make sure that the string the program read is only made up of ascii characters. Easiest: foreach(char ch; postscript) if(ch > 127) throw

Re: simple static if / traits question...

2017-02-22 Thread Profile Anaysis via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 21:27:47 UTC, WhatMeWorry wrote: I'm doing conditional compilation using static ifs like so: enum bool audio = true; // if audio flag is present and set to true, add to code build static if ( (__traits(compiles, audio)) && audio)

Re: Vibe.d: Listening to port 8080 on external device doesn't work

2017-02-22 Thread aberba via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 00:53:53 UTC, krzaq wrote: On Wednesday, 22 February 2017 at 00:38:30 UTC, aberba wrote: Using vibe.d, I bind to port 8080 at 127.0.0.1 but I can't access server on my phone through hotspot using the external IP from ip addr on Linux. But 127.0.0 running

Re: Snowflake Strings

2017-02-22 Thread Ali Çehreli via Digitalmars-d-announce
On 02/22/2017 02:26 PM, Ali Çehreli wrote: > - Assuming they are line numbers, the 2 and 3 below should be 3 and 4: > > (i < 3 || _d_assertp(TMP, 2)) > (j & 1 || _d_assertp(TMP, 3)) Ooh! I take it back. They are correct in the original source... Ali

Re: Snowflake Strings

2017-02-22 Thread Ali Çehreli via Digitalmars-d-announce
On 02/22/2017 05:08 AM, Mike Parker wrote: Walter shares a little bit of compiler knowledge, explaining how DMD stuffs string literals into object files. Blog post: http://dlang.org/blog/2017/02/22/snowflake-strings/ Reddit:

Re: simple static if / traits question...

2017-02-22 Thread Era Scarecrow via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 21:27:47 UTC, WhatMeWorry wrote: I'm doing conditional compilation using static ifs like so: enum bool audio = true; // if audio flag is present and set to true, add to code build static if ( (__traits(compiles, audio)) && audio)

Re: Call for arms: Arch Linux D package maintenance

2017-02-22 Thread Seb via Digitalmars-d-announce
On Thursday, 16 February 2017 at 19:58:47 UTC, Rory McGuire wrote: Hi, I am planning on asking to become TU for the dlang packages in community. I've been building and working with the current packages and making my own packages to make sure I know what I'm getting in to. LDC and GDC are

[Issue 4391] std.functional.curry is not a real curry

2017-02-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4391 Andrei Alexandrescu changed: What|Removed |Added Keywords||bootcamp ---

[Issue 4391] std.functional.curry is not a real curry

2017-02-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4391 Andrei Alexandrescu changed: What|Removed |Added Assignee|and...@erdani.com |nob...@puremagic.com

Re: Checking, whether string contains only ascii.

2017-02-22 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Feb 22, 2017 at 09:16:24PM +, kinke via Digitalmars-d-learn wrote: [...] > One more again as I couldn't believe noone went for 'any' yet: > > --- > import std.algorithm; > return !s.any!"a > 127"; // code-point level > --- You win 1 intarwebs for the shortest solution posted so far.

simple static if / traits question...

2017-02-22 Thread WhatMeWorry via Digitalmars-d-learn
I'm doing conditional compilation using static ifs like so: enum bool audio = true; // if audio flag is present and set to true, add to code build static if ( (__traits(compiles, audio)) && audio) playSound(soundSys, BLEEP ); This works,

Re: Checking, whether string contains only ascii.

2017-02-22 Thread kinke via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 20:07:34 UTC, Ali Çehreli wrote: One more: bool isAscii(string s) { import std.string : representation; import std.algorithm : canFind; return !s.representation.canFind!(c => c >= 0x80); } unittest { assert(isAscii("hello world"));

Re: Updates to the tsv-utils toolkit

2017-02-22 Thread bpr via Digitalmars-d-announce
On Wednesday, 22 February 2017 at 18:12:50 UTC, Jon Degenhardt wrote: ...snip... Repository: https://github.com/eBay/tsv-utils-dlang Performance benchmarks: https://github.com/eBay/tsv-utils-dlang/blob/master/docs/Performance.md --Jon This is very nice code, and a good result for D. I'll

Re: Serializer class

2017-02-22 Thread houdoux09 via Digitalmars-d-learn
Yes thank you it works.

Re: Threads not garbage collected ?

2017-02-22 Thread Alex via Digitalmars-d
On Wednesday, 22 February 2017 at 15:23:59 UTC, Moritz Maxeiner wrote: It seems undesirable, as the thread can be many layers of encapsulation down, and they all need manual deletes. It's highly desirable to not have the program terminate when there's still work to be done on some critical

Re: Checking, whether string contains only ascii.

2017-02-22 Thread Ali Çehreli via Digitalmars-d-learn
On 02/22/2017 12:02 PM, ag0aep6g wrote: > On Wednesday, 22 February 2017 at 19:26:15 UTC, berni wrote: >> In my program, I read a postscript file. Normal postscript files >> should only be composed of ascii characters, but one never knows what >> users give us. Therefore I'd like to make sure

Re: Checking, whether string contains only ascii.

2017-02-22 Thread ag0aep6g via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 19:26:15 UTC, berni wrote: In my program, I read a postscript file. Normal postscript files should only be composed of ascii characters, but one never knows what users give us. Therefore I'd like to make sure that the string the program read is only made up of

Re: Checking, whether string contains only ascii.

2017-02-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 19:26:15 UTC, berni wrote: herefore I'd like to make sure that the string the program read is only made up of ascii characters. Easiest: foreach(char ch; postscript) if(ch > 127) throw new Exception("non-ascii detected");

Re: how to pass stderr to core.stdc.stdio.fileno

2017-02-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 19:46:28 UTC, berni wrote: As I cannot find any PM-feature in this forum and don't know how to contact you else, I'm hijacking this thread to give you some feedback... You can always email me directly too, destructiona...@gmail.com Maybe you can figure out,

Re: Checking, whether string contains only ascii.

2017-02-22 Thread jklm via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 19:57:22 UTC, jklm wrote: On Wednesday, 22 February 2017 at 19:26:15 UTC, berni wrote: In my program, I read a postscript file. Normal postscript files should only be composed of ascii characters, but one never knows what users give us. Therefore I'd like to

Re: Checking, whether string contains only ascii.

2017-02-22 Thread jklm via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 19:26:15 UTC, berni wrote: In my program, I read a postscript file. Normal postscript files should only be composed of ascii characters, but one never knows what users give us. Therefore I'd like to make sure that the string the program read is only made up of

Re: Checking, whether string contains only ascii.

2017-02-22 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Feb 22, 2017 at 11:43:00AM -0800, H. S. Teoh via Digitalmars-d-learn wrote: [...] > import std.range.primitives; > > bool isAsciiOnly(R)(R input) > if (isInputRange!R && is(ElementType!R : dchar)) > { > import std.algorithm.iteration : fold;

Re: Checking, whether string contains only ascii.

2017-02-22 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Feb 22, 2017 at 07:26:15PM +, berni via Digitalmars-d-learn wrote: > In my program, I read a postscript file. Normal postscript files > should only be composed of ascii characters, but one never knows what > users give us. Therefore I'd like to make sure that the string the > program

Re: how to pass stderr to core.stdc.stdio.fileno

2017-02-22 Thread berni via Digitalmars-d-learn
As I cannot find any PM-feature in this forum and don't know how to contact you else, I'm hijacking this thread to give you some feedback... On Friday, 17 February 2017 at 19:16:44 UTC, Adam D. Ruppe wrote: Yes, that is my documentation fork, it has a search feature if you do

Checking, whether string contains only ascii.

2017-02-22 Thread berni via Digitalmars-d-learn
In my program, I read a postscript file. Normal postscript files should only be composed of ascii characters, but one never knows what users give us. Therefore I'd like to make sure that the string the program read is only made up of ascii characters. This simplifies the code thereafter,

Re: New (page-per-artifact) standard library doc examples are now editable and runnable

2017-02-22 Thread Seb via Digitalmars-d-announce
On Tuesday, 21 February 2017 at 22:58:57 UTC, Seb wrote: Unfortunately it reverts the writeln magic as the false positive rate was too high - at some point we really should come up with something better :/ However the fact that ddoc and ddox emit different, fully built synax-highlighted HTML

Re: Updates to the tsv-utils toolkit

2017-02-22 Thread Jon Degenhardt via Digitalmars-d-announce
On Wednesday, 22 February 2017 at 18:43:57 UTC, Jack Stouffer wrote: On Wednesday, 22 February 2017 at 18:12:50 UTC, Jon Degenhardt wrote: Speed matters when processing large data files, and these tools are fast. I've published new benchmarks comparing the tools to similar tools written in

Re: Serializer class

2017-02-22 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 18:34:26 UTC, houdoux09 wrote: void Read(T)(T value) { foreach(i, mm; value.tupleof) { writeln(__traits(identifier, value.tupleof[i]), " = ", mm); if(isArray!(typeof(mm))) { Read(mm[0]); //Error } } } You need to

Re: tanya library 0.2.0

2017-02-22 Thread Eugene Wissner via Digitalmars-d-announce
On Wednesday, 22 February 2017 at 13:00:19 UTC, Kagamin wrote: On Sunday, 19 February 2017 at 11:41:44 UTC, Eugene Wissner wrote: realloc() can move memory and if an object of type A has references to other objects in the array, the objects will be corrupted. "A" should be a POD-type.

Re: Updates to the tsv-utils toolkit

2017-02-22 Thread Jack Stouffer via Digitalmars-d-announce
On Wednesday, 22 February 2017 at 18:12:50 UTC, Jon Degenhardt wrote: Speed matters when processing large data files, and these tools are fast. I've published new benchmarks comparing the tools to similar tools written in several native compiled programming languages. The tools are the fastest

Re: Snowflake Strings

2017-02-22 Thread Arun Chandrasekaran via Digitalmars-d-announce
On Wednesday, 22 February 2017 at 13:08:13 UTC, Mike Parker wrote: Blog post: http://dlang.org/blog/2017/02/22/snowflake-strings/ Thanks for a wonder article. PS: The blog UI may need to be corrected for browsing from mobiles[1]. [1] http://imgur.com/a/7IPkm

Re: How do I use CTFE to generate an immutable associative array at compile time?

2017-02-22 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Feb 22, 2017 at 06:17:14PM +, Stefan Koch via Digitalmars-d-learn wrote: > On Wednesday, 22 February 2017 at 17:05:17 UTC, H. S. Teoh wrote: > > On Wed, Feb 22, 2017 at 04:08:45PM +, Stefan Koch via > > Digitalmars-d-learn wrote: > > > [...] > > > > I'm not sure it's that simple.

Serializer class

2017-02-22 Thread houdoux09 via Digitalmars-d-learn
Hello, i am new in D and i have a problem. I would like to retrieve the names of the variables and their value. But i can not retrieve the value of the array. class Test { public int a; public Test[] b; this() { a = 1; b = [new Test(), new Test()]; } }

Re: dmd -Wl=comma_separated_linker_flags (cf clang++ -Wl, comma_separated_linker_flags)

2017-02-22 Thread Timothee Cour via Digitalmars-d
> You can pass multiple -L flags: > > dmd -L-lbar -L-Ldir -L--export-dynamic I know, but that's inconvenient. Would make things a lot easier if we had something like what i suggested: `-Wl=comma_separated_linker_flags` advantages: could seemlessly use `comma_separated_linker_flags` with either

Re: D on the Weekends

2017-02-22 Thread Timothee Cour via Digitalmars-d
> Am I reading it correctly that D is the second most popular general purpose > language (let's exclude GLSL form general purpose programming)?? And that the > volume of weekday commits, at least in GitHub, is dominated by niche and > legacy languages, plus Matlab? You're reading it wrong:

Re: How do I use CTFE to generate an immutable associative array at compile time?

2017-02-22 Thread Stefan Koch via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 17:05:17 UTC, H. S. Teoh wrote: On Wed, Feb 22, 2017 at 04:08:45PM +, Stefan Koch via Digitalmars-d-learn wrote: [...] I'm not sure it's that simple. Just because AA's become CTFEable doesn't mean they will automatically be convertible to object code

Updates to the tsv-utils toolkit

2017-02-22 Thread Jon Degenhardt via Digitalmars-d-announce
It's not quite a year since the open-sourcing of eBay's tsv utilities. Since then there have been a number of additions and updates, and the tools form a more complete package. The tools assist with manipulation of tabular data files common in machine learning and data mining environments.

Re: About void[] and asockets

2017-02-22 Thread Jolly James via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 17:57:31 UTC, Adam D. Ruppe wrote: On Wednesday, 22 February 2017 at 17:53:21 UTC, Jolly James wrote: No matter how I try, I am always getting: Error: none of the overloads of '__ctor' are callable using argument types (Data*), candidates are: (my-project) I

Re: About void[] and asockets

2017-02-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 17:53:21 UTC, Jolly James wrote: No matter how I try, I am always getting: Error: none of the overloads of '__ctor' are callable using argument types (Data*), candidates are: (my-project) I don't know the library, so I'd have to see the Data class, but you

Re: About void[] and asockets

2017-02-22 Thread Jolly James via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 17:06:51 UTC, Jolly James wrote: On Wednesday, 22 February 2017 at 17:01:11 UTC, Adam D. Ruppe wrote: On Wednesday, 22 February 2017 at 16:55:03 UTC, Jolly James wrote: Well, what are these void-arrays for real? I mean, they contain data what does not make

Re: How do I use CTFE to generate an immutable associative array at compile time?

2017-02-22 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Feb 22, 2017 at 04:08:45PM +, Stefan Koch via Digitalmars-d-learn wrote: > On Wednesday, 22 February 2017 at 15:27:22 UTC, H. S. Teoh wrote: > > (In fact, now I'm wondering if we could just hack dmd to emit the > > equivalent of this code as a lowering, whenever the user tries to > >

Re: About void[] and asockets

2017-02-22 Thread Jolly James via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 17:01:11 UTC, Adam D. Ruppe wrote: On Wednesday, 22 February 2017 at 16:55:03 UTC, Jolly James wrote: Well, what are these void-arrays for real? I mean, they contain data what does not make them really void, does it? They represent an array of anything; the

Re: About void[] and asockets

2017-02-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 16:55:03 UTC, Jolly James wrote: Well, what are these void-arrays for real? I mean, they contain data what does not make them really void, does it? They represent an array of anything; the user can pass ubyte[] to it, or int[] to it, or char[] to it, or

Re: Class Order Style

2017-02-22 Thread Jolly James via Digitalmars-d-learn
On Tuesday, 21 February 2017 at 23:06:23 UTC, Jonathan M Davis wrote: On Tuesday, February 21, 2017 22:41:40 Lenny Lowood via Digitalmars-d-learn wrote: [...] It's completely a stylistic preference. There are a number of different ways to order your member variables and functions, and there

About void[] and asockets

2017-02-22 Thread Jolly James via Digitalmars-d-learn
For sure, some might know ae. I am trying to use it as TcpServer. I got almost everything working fine concerning connection establishment and disconnecting. But there is one thing that makes it hard for me to understand, how to handle data.

Re: syntax sugar: std.path::buildPath instead of from!"std.path".buildPath

2017-02-22 Thread Andrei Alexandrescu via Digitalmars-d
On 02/22/2017 06:53 AM, Atila Neves wrote: On Thursday, 16 February 2017 at 13:21:04 UTC, Andrei Alexandrescu wrote: On 2/16/17 7:11 AM, Atila Neves wrote: On Wednesday, 15 February 2017 at 17:10:26 UTC, Adam D. Ruppe wrote: On Wednesday, 15 February 2017 at 07:56:00 UTC, Jacob Carlborg

Re: How do I use CTFE to generate an immutable associative array at compile time?

2017-02-22 Thread Stefan Koch via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 15:27:22 UTC, H. S. Teoh wrote: (In fact, now I'm wondering if we could just hack dmd to emit the equivalent of this code as a lowering, whenever the user tries to declare a compile-time initialized AA.) All the problems disappear if the AA's are compiler

[Issue 16453] Missing @nogc annotations

2017-02-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16453 Jack Stouffer changed: What|Removed |Added Status|NEW |RESOLVED

Re: How do I use CTFE to generate an immutable associative array at compile time?

2017-02-22 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Feb 22, 2017 at 09:00:36AM +0100, Jacob Carlborg via Digitalmars-d-learn wrote: [...] > You can use an enum to declare the AA and then assign it to an > immutable variable using "static this". The you would only use to the > immutable variable and never the enum. > > enum aa = [1 : 2]; >

Re: Threads not garbage collected ?

2017-02-22 Thread Moritz Maxeiner via Digitalmars-d
On Wednesday, 22 February 2017 at 05:28:17 UTC, Alex wrote: [...] In both gdc and dmd I need to use manually delete this object or the program is blocked after main. Is by design ? Yes, it's documented here[1] (others have already replied on the GC subject, so I won't go into that). If you

Re: Threads not garbage collected ?

2017-02-22 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 22 February 2017 at 14:51:24 UTC, Guillaume Piolat wrote: https://p0nce.github.io/d-idioms/#The-trouble-with-class-destructors eh, I think this is less a destructor issue and just that the thread is still running and thus not eligible for collection anyway - there's still a

Re: Threads not garbage collected ?

2017-02-22 Thread Guillaume Piolat via Digitalmars-d
On Wednesday, 22 February 2017 at 05:28:17 UTC, Alex wrote: void main() { auto a = new A; delete a; //need this or the program hangs } https://p0nce.github.io/d-idioms/#The-trouble-with-class-destructors

Re: Step into in debugging.

2017-02-22 Thread drug via Digitalmars-d
22.02.2017 17:32, ANtlord пишет: On Wednesday, 22 February 2017 at 14:23:02 UTC, ANtlord wrote: My bad again. It appears I have a smaller knowledge that I think. I'm ended up in typecons because `allocator` is made by template `scoped` returns instance of internal static struct `Scoped` and it

Re: Step into in debugging.

2017-02-22 Thread ANtlord via Digitalmars-d
On Wednesday, 22 February 2017 at 14:23:02 UTC, ANtlord wrote: My bad again. It appears I have a smaller knowledge that I think. I'm ended up in typecons because `allocator` is made by template `scoped` returns instance of internal static struct `Scoped` and it has alias is asigned to method

Re: Step into in debugging.

2017-02-22 Thread ANtlord via Digitalmars-d
On Monday, 20 February 2017 at 13:55:57 UTC, ANtlord wrote: Hello! I care for project DCD. I've wanted to fix some issue in it very long time ago. But when I get a little bit of free time I encounter one big problem for me. I can't debug it using GDB. I can't go through call stack because I

Re: FEM library?

2017-02-22 Thread Nicholas Wilson via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 11:37:41 UTC, XavierAP wrote: @Nicholas yes such a FEM library to be developed would heavily depend on Mir. Ilya Yaroshenko pointed me to it in another thread. I didn't know about DlangScience, thanks. Looks like there is some overlap? I think mir used to be

Snowflake Strings

2017-02-22 Thread Mike Parker via Digitalmars-d-announce
Walter shares a little bit of compiler knowledge, explaining how DMD stuffs string literals into object files. Blog post: http://dlang.org/blog/2017/02/22/snowflake-strings/ Reddit: https://www.reddit.com/r/programming/comments/5viixe/snowflake_strings_walter_bright_on_how_the_dmd_d/

Re: tanya library 0.2.0

2017-02-22 Thread Kagamin via Digitalmars-d-announce
On Sunday, 19 February 2017 at 11:41:44 UTC, Eugene Wissner wrote: realloc() can move memory and if an object of type A has references to other objects in the array, the objects will be corrupted. "A" should be a POD-type. Otherwise you have to allocate new memory, initialize it, copy the

Re: Returning the address of a reference return value in @safe code - 2.072 regression?

2017-02-22 Thread Kagamin via Digitalmars-d-learn
On Monday, 20 February 2017 at 20:49:43 UTC, Johan Engelen wrote: The error is: "cannot take address of ref return of this.foo() in @safe function bar". Maybe a bugfix in safety system? Should it go through deprecation process?

Re: Threads not garbage collected ?

2017-02-22 Thread ketmar via Digitalmars-d
Alex wrote: The thread can then prevent the program from exiting on exception or otherwise. If the garbage collector doesn't kill threads, do I need to break all encapsulation to call some sort of finalise or destroy function on every object in case it has a thread object in it ? It would

Re: syntax sugar: std.path::buildPath instead of from!"std.path".buildPath

2017-02-22 Thread Atila Neves via Digitalmars-d
On Thursday, 16 February 2017 at 13:21:04 UTC, Andrei Alexandrescu wrote: On 2/16/17 7:11 AM, Atila Neves wrote: On Wednesday, 15 February 2017 at 17:10:26 UTC, Adam D. Ruppe wrote: On Wednesday, 15 February 2017 at 07:56:00 UTC, Jacob Carlborg wrote: Your documentation is an improvement but

Re: D on the Weekends

2017-02-22 Thread Ola Fosheim Grøstad via Digitalmars-d
On Wednesday, 22 February 2017 at 11:33:40 UTC, XavierAP wrote: purpose programming)?? And that the volume of weekday commits, at least in GitHub, is dominated by niche and legacy languages, plus Matlab? I believe he tried to build a list of languages that are not used both on weekdays and

Re: FEM library?

2017-02-22 Thread XavierAP via Digitalmars-d-learn
@Nicholas yes such a FEM library to be developed would heavily depend on Mir. Ilya Yaroshenko pointed me to it in another thread. I didn't know about DlangScience, thanks. Looks like there is some overlap? @Dukc thanks! Whenever in the future I'm developing for a library project or

Re: D on the Weekends

2017-02-22 Thread XavierAP via Digitalmars-d
On Sunday, 12 February 2017 at 05:50:09 UTC, Adam Wilson wrote: Somebody did some analytics on what languages get used on the weekends and D made the list. https://medium.com/@hoffa/the-top-weekend-languages-according-to-githubs-code-6022ea2e33e8#.2jmihhgb2 Am I reading it correctly that D

Re: Threads not garbage collected ?

2017-02-22 Thread Alex via Digitalmars-d
On Wednesday, 22 February 2017 at 08:28:48 UTC, ketmar wrote: Alex wrote: import core.thread; class A { Thread mThread; bool mStopped; this() { mThread = new Thread(); mThread.start(); } void run() {

Re: Enough D to Make a Living?

2017-02-22 Thread Ola Fosheim Grøstad via Digitalmars-d
On Wednesday, 22 February 2017 at 09:09:45 UTC, Russel Winder wrote: is also proven. However there is a caveat, that the new language must have a new computational model or at least a significant breaking change in something associated with the computational model. This is probably quite

Re: Threads not garbage collected ?

2017-02-22 Thread Alex via Digitalmars-d
On Wednesday, 22 February 2017 at 05:39:50 UTC, rikki cattermole wrote: On 22/02/2017 6:28 PM, Alex wrote: import core.thread; class A { Thread mThread; bool mStopped; this() { mThread = new Thread(); mThread.start(); } void run() { while

Re: Getting nice print of struct for debugging

2017-02-22 Thread Martin Tschierschke via Digitalmars-d-learn
On Tuesday, 21 February 2017 at 14:02:54 UTC, Jacob Carlborg wrote: [...] Yes, this works, I would say this is the simplest: MyStruct s; foreach (index, name ; FieldNameTuple!MyStruct) writefln("%s: %s", name, s.tupleof[index]); If you want something more close to "send" in Ruby, you

Re: Moonshot: a DMD fork that outputs Lua

2017-02-22 Thread Mithun Hunsur via Digitalmars-d-announce
On Tuesday, 21 February 2017 at 21:32:51 UTC, pineapple wrote: On Tuesday, 21 February 2017 at 12:45:47 UTC, Mithun Hunsur wrote: Hi all, I've been working on a little project over the last month and a half, inspired by Adam's dtojs (https://github.com/adamdruppe/dtojs). I've always wanted a

Re: Hello, folks! Newbie to D, have some questions!

2017-02-22 Thread timmyjose via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 07:48:42 UTC, Steve Biedermann wrote: On Tuesday, 21 February 2017 at 17:13:30 UTC, timmyjose wrote: I would upvote you if I could! :-) ... that's not only an interesting read, but also fodder for mini-projects of my own! If you need more details about a

Re: Vibe.d: Listening to port 8080 on external device doesn't work

2017-02-22 Thread Suliman via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 00:38:30 UTC, aberba wrote: Using vibe.d, I bind to port 8080 at 127.0.0.1 but I can't access server on my phone through hotspot using the external IP from ip addr on Linux. But 127.0.0 running Apache server works. Don't if its vibe.d or OS (ubuntu 14.04)

Re: Enough D to Make a Living?

2017-02-22 Thread Russel Winder via Digitalmars-d
On Tue, 2017-02-21 at 13:32 -0500, Nick Sabalausky (Abscissa) via Digitalmars-d wrote: > On 02/21/2017 10:34 AM, Paul wrote: > > 3) Is there much value in taking programming classes that don't > > deal > > with D? > > Although HR folk never understand this, programming skills are > highly  >

Re: How do I use CTFE to generate an immutable associative array at compile time?

2017-02-22 Thread Daniel Kozak via Digitalmars-d-learn
Yes this is how I mean it. Dne 22. 2. 2017 9:05 napsal uživatel "Jacob Carlborg via Digitalmars-d-learn" : > On 2017-02-21 23:49, H. S. Teoh via Digitalmars-d-learn wrote: > > That may appear to work, but I would *strongly* recommend against it, >> because what

Re: Threads not garbage collected ?

2017-02-22 Thread David Nadlinger via Digitalmars-d
On Wednesday, 22 February 2017 at 08:20:41 UTC, Jonathan M Davis wrote: Well, the OP's code wrapped the Thread object in another class and joined the thread in its finalizer, so you would think that the Thread would be joined before its finalizer was called, but thinking further on it, IIRC,

Re: Threads not garbage collected ?

2017-02-22 Thread ketmar via Digitalmars-d
Alex wrote: import core.thread; class A { Thread mThread; bool mStopped; this() { mThread = new Thread(); mThread.start(); } void run() { while (!mStopped) {

Re: Threads not garbage collected ?

2017-02-22 Thread Jonathan M Davis via Digitalmars-d
On Wednesday, February 22, 2017 07:58:45 David Nadlinger via Digitalmars-d wrote: > On Wednesday, 22 February 2017 at 07:14:27 UTC, Jonathan M Davis > > wrote: > > In this particular case, the program would probably exit if you > > did > > > > void main() > > { > > > > { > > > > auto

Re: dmd -Wl=comma_separated_linker_flags (cf clang++ -Wl, comma_separated_linker_flags)

2017-02-22 Thread Jacob Carlborg via Digitalmars-d
On 2017-02-21 03:53, Timothee Cour via Digitalmars-d wrote: relying on the shell (especially involving arrays) seems like a bad idea: not portable, easy to mess up: `dmd -L{-lbar,-Ldir,--export-dynamic}` works but what if it's stored in $lflags: lflags="-lbar,-Ldir,--export-dynamic" the

Re: How do I use CTFE to generate an immutable associative array at compile time?

2017-02-22 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-02-21 23:49, H. S. Teoh via Digitalmars-d-learn wrote: That may appear to work, but I would *strongly* recommend against it, because what happens when you use enum with an AA, is that the AA will be created *at runtime*, *every single time* it is referenced. (It is as if you

[Issue 17010] remove std.net.isemail

2017-02-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17010 Jacob Carlborg changed: What|Removed |Added CC||d...@me.com --- Comment #2

Re: Threads not garbage collected ?

2017-02-22 Thread David Nadlinger via Digitalmars-d
On Wednesday, 22 February 2017 at 07:14:27 UTC, Jonathan M Davis wrote: In this particular case, the program would probably exit if you did void main() { { auto a = new A; } import core.memory; GC.collect(); } I very much doubt so. A Thread object isn't just a handle