Re: How to get return type of current method?

2017-04-18 Thread Ali Çehreli via Digitalmars-d-learn
On 04/18/2017 06:40 PM, Meta wrote: > On Wednesday, 19 April 2017 at 00:22:14 UTC, Mike B Johnson wrote: >> On Tuesday, 18 April 2017 at 23:49:35 UTC, ketmar wrote: >>> Mike B Johnson wrote: >>> How can I get the return type of the current method without specifying the name or any

Re: Immovable types

2017-04-18 Thread sarn via Digitalmars-d
On Wednesday, 19 April 2017 at 02:53:18 UTC, Stanislav Blinov wrote: I'd very much like to hear your thoughts on this, good/bad, if it already was proposed, anything. If it's found feasible, I could start a DIP. Destroy, please. I don't have comments about the syntax, but I did want this

Re: hidden passing of __FILE__ and __LINE__ into function

2017-04-18 Thread Dmitry via Digitalmars-d-learn
On Tuesday, 18 April 2017 at 13:48:57 UTC, Stanislav Blinov wrote: There's a much more concise workaround, both in code written and generated ;) import std.stdio; template func(string file = __FILE__, int line = __LINE__) { auto func(T...)(auto ref T args) { writeln("called

Re: Optilink bugs(or DMD)

2017-04-18 Thread Stefan Koch via Digitalmars-d
On Wednesday, 19 April 2017 at 03:52:54 UTC, Nierjerson wrote: Major optilink bugs, blocker. Code is long but demonstrates the issue. Compiles with ldc. [...] There are two instances of void ForegroundColor(cSolidColor rhs)

Re: Optilink bugs(or DMD)

2017-04-18 Thread ketmar via Digitalmars-d
Nierjerson wrote: Major optilink bugs, blocker. not at optlink bug.

Optilink bugs(or DMD)

2017-04-18 Thread Nierjerson via Digitalmars-d
Major optilink bugs, blocker. Code is long but demonstrates the issue. Compiles with ldc. The source is large so I uploaded it https://ufile.io/odaee or https://files.fm/u/frmks29t OPTLINK (R) for Win32 Release 8.00.17 Copyright (C) Digital Mars 1989-2013 All rights reserved.

[Issue 17332] New: optilink or dmd bug

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17332 Issue ID: 17332 Summary: optilink or dmd bug Product: D Version: D2 Hardware: x86_64 OS: Windows Status: NEW Severity: critical Priority: P1

Re: Interpolated strings

2017-04-18 Thread bpr via Digitalmars-d
On Wednesday, 19 April 2017 at 00:30:31 UTC, Walter Bright wrote: I'm not saying you cannot do cool and useful things with AST macros. My position is it encourages absolutely awful code as (usually inexperienced) programmers compete to show how clever their macros are. I'd think that that's

Re: hidden passing of __FILE__ and __LINE__ into function

2017-04-18 Thread Lewis via Digitalmars-d-learn
On Monday, 17 April 2017 at 14:23:50 UTC, Jonathan M Davis wrote: On Monday, April 17, 2017 13:45:18 Dmitry via Digitalmars-d-learn wrote: [...] Every time there's a new template instantiation, it's essentially copy-pasting the entire template. So, if you have the templated function [...]

Immovable types

2017-04-18 Thread Stanislav Blinov via Digitalmars-d
Currently, we have the ability to disable postblit and/or assignments, thus create non-copyable types. But it is always assumed that a value can be moved. Normally, this is great, as we don't have to deal with additional constructors explicitly. There are, however, occasions when move is

[Issue 17331] appender can't be used for initialization twice

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17331 Heromyth changed: What|Removed |Added Summary|appender can't be use for |appender can't be used for

[Issue 17331] New: appender can't be use for initialization

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17331 Issue ID: 17331 Summary: appender can't be use for initialization Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW Severity: normal

Re: Interpolated strings

2017-04-18 Thread Jon Degenhardt via Digitalmars-d
On Saturday, 15 April 2017 at 20:04:13 UTC, Jonas Drewsen wrote: I've been wanting to have support for interpolated strings in D for some time now that will allow you to write e.g.: [...] One place I'd appreciate interpolated strings is as an option when working with heredoc strings. These

Re: How to get return type of current method?

2017-04-18 Thread Meta via Digitalmars-d-learn
On Wednesday, 19 April 2017 at 00:22:14 UTC, Mike B Johnson wrote: On Tuesday, 18 April 2017 at 23:49:35 UTC, ketmar wrote: Mike B Johnson wrote: How can I get the return type of the current method without specifying the name or any complexity? Similar to typeof(this). typeof(return)

Re: fluent-asserts released

2017-04-18 Thread Szabo Bogdan via Digitalmars-d-announce
On Wednesday, 12 April 2017 at 06:22:26 UTC, Ali Çehreli wrote: On 04/11/2017 11:01 PM, Szabo Bogdan wrote: should.not.throwAnyException({ throw new Exception("test"); }); what do you mean, they are not documented? there is a md file fith some examples here:

Re: Interpolated strings

2017-04-18 Thread Walter Bright via Digitalmars-d
On 4/18/2017 4:58 PM, bpr wrote: Here's how it's done in Nim, a statically typed language similar to D, but with Python syntax, and macros. It takes some knowledge to understand, sure, macros are not a beginner tool, but wouldn't say this is extremely complex. I bet a D-with-macros would have a

Re: How to get return type of current method?

2017-04-18 Thread Mike B Johnson via Digitalmars-d-learn
On Tuesday, 18 April 2017 at 23:49:35 UTC, ketmar wrote: Mike B Johnson wrote: How can I get the return type of the current method without specifying the name or any complexity? Similar to typeof(this). typeof(return) Thanks, sweet and simple!

Re: Interpolated strings

2017-04-18 Thread Walter Bright via Digitalmars-d
On 4/18/2017 2:56 PM, Jonathan Marler wrote: Have you thought about supporting format specifiers as well? I looked at the C# version and it looks like they can specify them using a colon like this: $"{a} in hex is {a:x}" There are additional problems, such as: $"{a} in %s {b}" and

Re: Interpolated strings

2017-04-18 Thread bpr via Digitalmars-d
On Tuesday, 18 April 2017 at 08:01:14 UTC, Jacob Carlborg wrote: On 2017-04-18 08:59, Stefan Koch wrote: The corresponding ast-macros would be extremely complex No, it's not that complex. Here's how it's done in Nim, a statically typed language similar to D, but with Python syntax, and

Re: How to get return type of current method?

2017-04-18 Thread ketmar via Digitalmars-d-learn
Mike B Johnson wrote: How can I get the return type of the current method without specifying the name or any complexity? Similar to typeof(this). typeof(return)

How to get return type of current method?

2017-04-18 Thread Mike B Johnson via Digitalmars-d-learn
How can I get the return type of the current method without specifying the name or any complexity? Similar to typeof(this).

Re: Interpolated strings

2017-04-18 Thread Faux Amis via Digitalmars-d
On 2017-04-18 23:56, Jonathan Marler wrote: I've thought about it and decided, I like this idea. I've only used interpolated strings in PHP which left a bad taste, but I realized that interpolating strings makes it impossible for your format string and your arguments to get out of sync. This

Re: Interpolated strings

2017-04-18 Thread H. S. Teoh via Digitalmars-d
On Tue, Apr 18, 2017 at 09:56:28PM +, Jonathan Marler via Digitalmars-d wrote: [...] > I've thought about it and decided, I like this idea. I've only used > interpolated strings in PHP which left a bad taste, but I realized > that interpolating strings makes it impossible for your format

Re: Interpolated strings

2017-04-18 Thread Jonathan Marler via Digitalmars-d
On Tuesday, 18 April 2017 at 08:50:07 UTC, Walter Bright wrote: On 4/15/2017 4:51 PM, cym13 wrote: Removing imports is a good point, the first concrete one to be mentionned. I'm not sure it matters that much though as I think those imports are generic enough that I believe they would be

Re: Out of data wiki

2017-04-18 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, April 18, 2017 19:54:26 Mike B Johnson via Digitalmars-d-learn wrote: > can this be updated to work? > > https://wiki.dlang.org/Timing_Code Wow, that's using some old stuff - stuff older than the wiki. Weird. It was probably ported from somewhere. The best thing to use now is

Re: Cap'n Proto for D v0.1.2

2017-04-18 Thread Dmitry Olshansky via Digitalmars-d-announce
On 4/18/17 9:14 PM, Swoorup Joshi wrote: On Tuesday, 18 April 2017 at 18:09:54 UTC, Thomas Brix Larsen wrote: "Cap’n Proto is an insanely fast data interchange format and capability-based RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster." This is the initial

Re: Cap'n Proto for D v0.1.2

2017-04-18 Thread Paolo Invernizzi via Digitalmars-d-announce
On Tuesday, 18 April 2017 at 18:09:54 UTC, Thomas Brix Larsen wrote: "Cap’n Proto is an insanely fast data interchange format and capability-based RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster." This is the initial public release of my optimized port of the

Out of data wiki

2017-04-18 Thread Mike B Johnson via Digitalmars-d-learn
can this be updated to work? https://wiki.dlang.org/Timing_Code

Re: Cleaning up Dub/Dmd builds

2017-04-18 Thread FreeSlave via Digitalmars-d-learn
On Tuesday, 18 April 2017 at 17:58:32 UTC, WhatMeWorry wrote: On Tuesday, 18 April 2017 at 15:15:47 UTC, Stanislav Blinov wrote: On Tuesday, 18 April 2017 at 15:07:27 UTC, WhatMeWorry wrote: When I try to upload these files to my new repo, GitHub (rightfully so) complains that I have too many

Re: Cap'n Proto for D v0.1.2

2017-04-18 Thread Swoorup Joshi via Digitalmars-d-announce
On Tuesday, 18 April 2017 at 18:09:54 UTC, Thomas Brix Larsen wrote: "Cap’n Proto is an insanely fast data interchange format and capability-based RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster." This is the initial public release of my optimized port of the

[Issue 7102] std.numeric.gcd with BigInts too

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7102 --- Comment #5 from hst...@quickfur.ath.cx --- To make matters worse, std.numeric.gcd has no sig constraints, so once you import std.numeric.gcd, you cannot even define a BigInt specialization of gcd in your own code without causing a conflict in the

Cap'n Proto for D v0.1.2

2017-04-18 Thread Thomas Brix Larsen via Digitalmars-d-announce
"Cap’n Proto is an insanely fast data interchange format and capability-based RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster." This is the initial public release of my optimized port of the Java implementation of Cap'n Proto. State: * Passes Cap'n Proto

Re: Cleaning up Dub/Dmd builds

2017-04-18 Thread WhatMeWorry via Digitalmars-d-learn
On Tuesday, 18 April 2017 at 15:15:47 UTC, Stanislav Blinov wrote: On Tuesday, 18 April 2017 at 15:07:27 UTC, WhatMeWorry wrote: When I try to upload these files to my new repo, GitHub (rightfully so) complains that I have too many files. Since I'm using sdl and not json, can I safely delete

[Issue 7102] std.numeric.gcd with BigInts too

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7102 hst...@quickfur.ath.cx changed: What|Removed |Added CC||hst...@quickfur.ath.cx --

Re: Thoughts from newcommer

2017-04-18 Thread Andrei Alexandrescu via Digitalmars-d
On 04/18/2017 03:00 AM, Shachar Shemesh wrote: D would have the ability to have a nice container that would do RAII (for classes since for structs, __dtors are called automatically) That's just it, though. They are not. Not reliably. Yah, clearly there's a problem with the language

Re: Thoughts from newcommer

2017-04-18 Thread Andrei Alexandrescu via Digitalmars-d
On 04/18/2017 10:55 AM, Russel Winder via Digitalmars-d wrote: On Tue, 2017-04-18 at 09:23 -0400, Andrei Alexandrescu via Digitalmars- d wrote: On 4/18/17 8:48 AM, prdan wrote: Thanks, maybe I will write a blog post about my experiences also. That would be great! Michael Parker may be of

Re: D, SCons, Dub

2017-04-18 Thread H. S. Teoh via Digitalmars-d
On Tue, Apr 18, 2017 at 07:34:34AM +, Alex via Digitalmars-d wrote: [...] > I realise there are no headers, that is the problem. SCons can't tell > whether a change to a module affects the interface, only affects the > implementation or only affects a unit test. This means everything that >

[Issue 17329] File.remove() has problems with long filenames (>128 bytes)

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17329 --- Comment #2 from Rainer Koschnick --- Thanks for the hint, but it doesn't change anything. Error:

Re: Cleaning up Dub/Dmd builds

2017-04-18 Thread Stanislav Blinov via Digitalmars-d-learn
On Tuesday, 18 April 2017 at 15:07:27 UTC, WhatMeWorry wrote: When I try to upload these files to my new repo, GitHub (rightfully so) complains that I have too many files. Since I'm using sdl and not json, can I safely delete all the files that pertain to json? Can I do this some way at the

Cleaning up Dub/Dmd builds

2017-04-18 Thread WhatMeWorry via Digitalmars-d-learn
Just some basic questions regarding Dub projects with GitHub. I'm just getting my toes wet with GitHub so these might be pretty naive questions. I've got about 35 mini dub projects where each project holds an OpenGL tutorial. like so: 01_01_hello_window .dub build

Re: The app hanging after reach 1750MB of RAM

2017-04-18 Thread Suliman via Digitalmars-d-learn
On Tuesday, 18 April 2017 at 14:15:59 UTC, Stanislav Blinov wrote: On Tuesday, 18 April 2017 at 14:09:28 UTC, Stanislav Blinov wrote: foreach(row; result) { arr ~= row.toStruct(cargpspoint); } Sorry, this should be foreach(row; result) {

Re: Thoughts from newcommer

2017-04-18 Thread Russel Winder via Digitalmars-d
On Tue, 2017-04-18 at 09:23 -0400, Andrei Alexandrescu via Digitalmars- d wrote: > On 4/18/17 8:48 AM, prdan wrote: > > Thanks, maybe I will write a blog post about my experiences also. > > That would be great! Michael Parker may be of help if you consider  > publishing in the official D Blog. --

Re: hidden passing of __FILE__ and __LINE__ into function

2017-04-18 Thread Solomon E via Digitalmars-d-learn
On Tuesday, 18 April 2017 at 13:48:57 UTC, Stanislav Blinov wrote: On Tuesday, 18 April 2017 at 13:28:06 UTC, Solomon E wrote: I tried to produce an example of calling a function with variadic template arguments using special tokens __FILE__ and __LINE__. This compiles and runs, producing

Re: The app hanging after reach 1750MB of RAM

2017-04-18 Thread Stanislav Blinov via Digitalmars-d-learn
On Tuesday, 18 April 2017 at 14:09:28 UTC, Stanislav Blinov wrote: foreach(row; result) { arr ~= row.toStruct(cargpspoint); } Sorry, this should be foreach(row; result) { row.toStruct(cargpspoint); arr ~= cargpspoint; }

Re: The app hanging after reach 1750MB of RAM

2017-04-18 Thread Stanislav Blinov via Digitalmars-d-learn
On Tuesday, 18 April 2017 at 13:28:57 UTC, Suliman wrote: Also I can't understand why app take so much memory? I checked array of structures size with this code: auto mymem = cargpspoints.length * typeof(cargpspoints[0]).sizeof; writeln(mymem); And it's print: 16963440 it's about 16MB...

Re: hidden passing of __FILE__ and __LINE__ into function

2017-04-18 Thread Stanislav Blinov via Digitalmars-d-learn
On Tuesday, 18 April 2017 at 13:28:06 UTC, Solomon E wrote: I tried to produce an example of calling a function with variadic template arguments using special tokens __FILE__ and __LINE__. This compiles and runs, producing the output shown, using the default gdc provided by Ubuntu 17.04.

Re: The app hanging after reach 1750MB of RAM

2017-04-18 Thread Suliman via Digitalmars-d-learn
Also I can't understand why app take so much memory? I checked array of structures size with this code: auto mymem = cargpspoints.length * typeof(cargpspoints[0]).sizeof; writeln(mymem); And it's print: 16963440 it's about 16MB... What is takes all other memory?

Re: hidden passing of __FILE__ and __LINE__ into function

2017-04-18 Thread Solomon E via Digitalmars-d-learn
On Tuesday, 18 April 2017 at 10:13:09 UTC, Jonathan M Davis wrote: On Monday, April 17, 2017 07:23:50 Jonathan M Davis via Digitalmars-d-learn wrote: So, if you're okay with explicitly instantiating your variadic function template instead of having the types inferred, then it can work, but

Re: Thoughts from newcommer

2017-04-18 Thread Andrei Alexandrescu via Digitalmars-d
On 4/18/17 8:48 AM, prdan wrote: Thanks, maybe I will write a blog post about my experiences also. That would be great! Michael Parker may be of help if you consider publishing in the official D Blog. -- Andrei

[Issue 17309] [REG 2.073.2] constructor template doesn't infer `pure`

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17309 --- Comment #4 from ag0ae...@gmail.com --- (In reply to Walter Bright from comment #3) > I think that trouble here is that attribute inference is not done until the > template is instantiated. But the compiler does not instantiate a template > until

[Issue 17330] New: [REG 2.072] BigInt's constructor used to be pure

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17330 Issue ID: 17330 Summary: [REG 2.072] BigInt's constructor used to be pure Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: regression

Re: Thoughts from newcommer

2017-04-18 Thread prdan via Digitalmars-d
On Tuesday, 18 April 2017 at 12:22:10 UTC, Andrei Alexandrescu wrote: Cool, thanks for this work! However, a word of caution - experiments ran on different CPUs can't count as comparable. I didn't compare D times to numbers from benchmarks game site. I've ran other languages on the same

Re: Thoughts from newcommer

2017-04-18 Thread rikki cattermole via Digitalmars-d
On 18/04/2017 1:22 PM, Andrei Alexandrescu wrote: On 04/17/2017 10:57 PM, prdan wrote: I've written multi-threaded regex-redux benchmark for D language and made some tests. This is my first program written in D, I didn't know much about D a week ago. Here are the results for other languages:

Re: Thoughts from newcommer

2017-04-18 Thread Andrei Alexandrescu via Digitalmars-d
On 04/17/2017 10:57 PM, prdan wrote: I've written multi-threaded regex-redux benchmark for D language and made some tests. This is my first program written in D, I didn't know much about D a week ago. Here are the results for other languages:

Re: make Pid constructor public

2017-04-18 Thread Domain via Digitalmars-d-learn
On Monday, 17 June 2013 at 22:38:47 UTC, Timothee Cour wrote: inside std.process it says: // Pids are only meant to be constructed inside this module, so we make the constructor private. However, this makes a number of useful functions from std.process useless unless the processes were

Re: Interpolated strings

2017-04-18 Thread Kagamin via Digitalmars-d
On Tuesday, 18 April 2017 at 08:50:07 UTC, Walter Bright wrote: It may not be necessary to have any dependencies on any import. $"{a} times 3 is {a*3}" could be rewritten by the parser to: "%s times 3 is %s", a, a * 3 and that is that. (I.e. just an AST rewrite.) It would be quite a

The app hanging after reach 1750MB of RAM

2017-04-18 Thread Suliman via Digitalmars-d-learn
I am writing app that extract data from DB to array of structures. void getSingleTrackInfo() { foreach(item; getTablesGPSSensorList) { ResultRange result = mysqlconnection.query(sqlquery);

Re: Interpolated strings

2017-04-18 Thread Jacob Carlborg via Digitalmars-d
On 2017-04-18 10:50, Walter Bright wrote: It may not be necessary to have any dependencies on any import. $"{a} times 3 is {a*3}" could be rewritten by the parser to: "%s times 3 is %s", a, a * 3 and that is that. (I.e. just an AST rewrite.) It would be quite a bit simpler than

Re: Thoughts from newcommer

2017-04-18 Thread prdan via Digitalmars-d
On Tuesday, 18 April 2017 at 07:22:29 UTC, thedeemon wrote: Which compiler did you use for D? I've used newest LDC. In benchmarks where some fixed amount of work should be done as fast as possible low CPU usage is not a good sign, it just means some cores were idle when they could really

Re: Thoughts from newcommer

2017-04-18 Thread Guillaume Piolat via Digitalmars-d
On Tuesday, 18 April 2017 at 07:22:29 UTC, thedeemon wrote: In benchmarks where some fixed amount of work should be done as fast as possible low CPU usage is not a good sign, it just means some cores were idle when they could really be working. Minor note: sometimes high CPU usage isn't good

Re: hidden passing of __FILE__ and __LINE__ into function

2017-04-18 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, April 17, 2017 07:23:50 Jonathan M Davis via Digitalmars-d-learn wrote: > So, if you're okay with explicitly instantiating your variadic function > template instead of having the types inferred, then it can work, but > otherwise, no. Making it work would require a language enhancement

[Issue 8687] Variadic templates do not work properly with default arguments

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8687 Jonathan M Davis changed: What|Removed |Added CC|

[Issue 17309] [REG 2.073.2] constructor template doesn't infer `pure`

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17309 Walter Bright changed: What|Removed |Added Resolution|FIXED |WONTFIX --

[Issue 17309] [REG 2.073.2] constructor template doesn't infer `pure`

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

[Issue 17309] [REG 2.073.2] constructor template doesn't infer `pure`

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17309 --- Comment #2 from Walter Bright --- (In reply to Walter Bright from comment #1) > It also compiles with dmd 2.070, didn't check other versions. I don't know what I did there. I can't get it to compile with any dmd

[Issue 12115] Segfault in FormatSpec.fillUp

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12115 Daniel Čejchan changed: What|Removed |Added CC||czda...@gmail.com --

[Issue 17321] Example code for std.stdio.File fails to compile

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

[Issue 17326] 2.072 gc changes broke 32 bit Windows DLLs

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17326 --- Comment #3 from Walter Bright --- The problem is I cannot get the DLL test cases into the autotester test suite, which is why DLL support regularly breaks. --

Re: Yu(玉) - 0.0.3 : A Dlang's Toolkit in My Used

2017-04-18 Thread Dsby via Digitalmars-d-announce
On Tuesday, 18 April 2017 at 09:24:39 UTC, Dsby wrote: [...] In github : https://github.com/dushibaiyu/yu In dub : http://code.dlang.org/packages/yu

Yu(玉) - 0.0.3 : A Dlang's Toolkit in My Used

2017-04-18 Thread Dsby via Digitalmars-d-announce
algorithm snowflkeId.d : Twitter's Snowflke ID generate algorithm.to generate only ID container : the container base std.experimental.allocator cirularqueue : Cirular Queue Struct Template. vector : Like as C++'s std::vector eventloop : the io(Net) event

Re: if auto and method call

2017-04-18 Thread Andrea Fontana via Digitalmars-d-learn
On Tuesday, 18 April 2017 at 09:05:10 UTC, Andrea Fontana wrote: On Tuesday, 18 April 2017 at 00:48:05 UTC, Jethro wrote: How to combine the need to localize a result for an if statement and have to call a method to get proper comparison: [...] which should simplify to if ((auto x =

Re: if auto and method call

2017-04-18 Thread Andrea Fontana via Digitalmars-d-learn
On Tuesday, 18 April 2017 at 00:48:05 UTC, Jethro wrote: How to combine the need to localize a result for an if statement and have to call a method to get proper comparison: [...] which should simplify to if ((auto x = foo()).valid()) { } but this code does not work. [...] for(auto x =

Re: Interpolated strings

2017-04-18 Thread Walter Bright via Digitalmars-d
On 4/15/2017 4:51 PM, cym13 wrote: Removing imports is a good point, the first concrete one to be mentionned. I'm not sure it matters that much though as I think those imports are generic enough that I believe they would be imported anyway, but it's a real point. It may not be necessary to

Re: Interpolated strings

2017-04-18 Thread Walter Bright via Digitalmars-d
On 4/15/2017 1:04 PM, Jonas Drewsen wrote: [...] Thanks for doing the work to make a sample implementation, too. I don't know if this will make it into D, but Jonas is a fine example of a champion.

Re: Interpolated strings

2017-04-18 Thread Jacob Carlborg via Digitalmars-d
On 2017-04-18 08:59, Stefan Koch wrote: The corresponding ast-macros would be extremely complex No, it's not that complex. , slow and worst of all not checkable. What do you mean "not checkable"? -- /Jacob Carlborg

Re: D, SCons, Dub

2017-04-18 Thread Russel Winder via Digitalmars-d
On Tue, 2017-04-18 at 07:34 +, Alex via Digitalmars-d wrote: > […] > I know, I have been using your work in SCons to build in this  > mode since it was first available. Excellent. :-) […] > > > > I realise there are no headers, that is the problem. SCons can't  > tell whether a change to a

Re: D, SCons, Dub

2017-04-18 Thread Alex via Digitalmars-d
On Tuesday, 18 April 2017 at 06:51:51 UTC, Russel Winder wrote: I have been trying to do the opposite with scons - incremental builds. In c++ the .h and .cpp files allowed the compilation from many edits to be limited to one translation unit. Per module compilation then linking is the default

Re: Thoughts from newcommer

2017-04-18 Thread thedeemon via Digitalmars-d
On Tuesday, 18 April 2017 at 02:57:59 UTC, prdan wrote: I've written multi-threaded regex-redux benchmark for D language and made some tests. Nice! Rust version 1.16 (newest stable) GCC ver 4.9.2 (newest debian 8 stable) Which compiler did you use for D? C was the fastest (1.32) but used

Re: Empty Result

2017-04-18 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2017-04-17 at 15:10 -0700, Ali Çehreli via Digitalmars-d-learn wrote: > alias RangeType = typeof(return); > return new RangeType(() {}); It appears the answer to my question is: return typeof(return)(); Thanks to Ali and T for setting on the right path. -- Russel.

Re: Stuck with DMD, and Unit-Threaded

2017-04-18 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2017-04-17 at 22:56 +, Atila Neves via Digitalmars-d-learn wrote: > […] > https://github.com/russel/ApproxGC/pull/2 > > Unfortunately the auto generated integration test main file  > doesn't quite work (feel free to file a bug on unit-threaded) so  > in that PR I disabled

Re: Thoughts from newcommer

2017-04-18 Thread Shachar Shemesh via Digitalmars-d
D would have the ability to have a nice container that would do RAII (for classes since for structs, __dtors are called automatically) That's just it, though. They are not. Not reliably. Shachar

Re: Interpolated strings

2017-04-18 Thread Stefan Koch via Digitalmars-d
On Tuesday, 18 April 2017 at 06:54:11 UTC, Jacob Carlborg wrote: On 2017-04-17 21:28, Jonas Drewsen wrote: The page could also list pre-approved language changes such as async functions (which Walter wants afaik). Another feature that can be implemented with AST macros. This is starting to

Re: D, SCons, Dub

2017-04-18 Thread Russel Winder via Digitalmars-d
On Mon, 2017-04-17 at 18:53 +, Nordlöw via Digitalmars-d wrote: > […] > Nice. I'm using SCons in my everyday development. I'll give your  > feature a try. My pull request is currently being reviewed and some updates are needed. These will appear immediately in the SCons_D_Experiment. I'll

Re: Interpolated strings

2017-04-18 Thread Jacob Carlborg via Digitalmars-d
On 2017-04-17 21:28, Jonas Drewsen wrote: The page could also list pre-approved language changes such as async functions (which Walter wants afaik). Another feature that can be implemented with AST macros. This is starting to get ridicules. So many features have been added and are talked

Re: D, SCons, Dub

2017-04-18 Thread Russel Winder via Digitalmars-d
On Mon, 2017-04-17 at 22:59 +, Atila Neves via Digitalmars-d wrote: > […] > In D, this is nearly always slower (I measured). Compiling per  > package, however, is a lot faster. I have only ever needed file-by-file or whole source compilation, I have never needed package-oriented compilation.

Re: D, SCons, Dub

2017-04-18 Thread Russel Winder via Digitalmars-d
On Mon, 2017-04-17 at 20:56 +, Alex via Digitalmars-d wrote: > On Monday, 17 April 2017 at 17:51:33 UTC, Russel Winder wrote: > > Just in case anyone gives a : > > > > I have submitted a pull request that adds ProgramAllAtOnce > > I have been trying to do the opposite with scons -