Re: New __FILE_DIR__ trait?

2016-07-28 Thread Jonathan Marler via Digitalmars-d
On Thursday, 28 July 2016 at 00:42:11 UTC, crimaniak wrote: On Wednesday, 27 July 2016 at 13:59:23 UTC, Jonathan Marler wrote: For others who may see this thread, the __FULL_FILE_PATH__ special trait was added to the dmd compiler with this PR: https://github.com/dlang/dmd/pull/5959 __DIR__

Re: Array of const objects with indirections and std.algorithm.copy

2016-07-28 Thread drug via Digitalmars-d-learn
I see. I'll try to rephrase my question to be clear. We have: ``` struct Foo { int i; float f; } int main() { const(Foo)[] cfoo = [Foo(1, 0.5), Foo(2, 0.75)]; Foo[] foo; cfoo.copy(foo); // it works, constness no matter here because Foo is value type } ``` but

Re: Make D language as Apache foundation project

2016-07-28 Thread Sad panda via Digitalmars-d
On Wednesday, 27 July 2016 at 13:20:50 UTC, lkfsdg wrote: On Wednesday, 27 July 2016 at 13:08:17 UTC, eugene wrote: Hello everyone, why not to make a D language as a project of Apache foundation as it happened to groovy? stupid, D has its own organization. Why the acrid tone. :(

Things that make writing a clean binding system more difficult

2016-07-28 Thread Ethan Watson via Digitalmars-d
As mentioned in the D blog the other day, the binding system as used by Remedy will both be open sourced and effectively completely rewritten from when we shipped Quantum Break. As I'm still deep within that rewrite, a bunch of things are still fresh in my mind that aren't that great when it

Re: Make D language as Apache foundation project

2016-07-28 Thread Jack Applegame via Digitalmars-d
On Wednesday, 27 July 2016 at 15:44:21 UTC, Seb wrote: http://dlang.org/foundation.html Wow. This page details Andrei's full name: Tudor Andrei Cristian Alexandrescu. (o_O)

[OT] Re: Make D language as Apache foundation project

2016-07-28 Thread jdfgjdf via Digitalmars-d
On Thursday, 28 July 2016 at 09:19:03 UTC, Jack Applegame wrote: On Wednesday, 27 July 2016 at 15:44:21 UTC, Seb wrote: http://dlang.org/foundation.html Wow. This page details Andrei's full name: Tudor Andrei Cristian Alexandrescu. (o_O) It's probably to avoid any confusion with the other

Re: Overflows in Phobos

2016-07-28 Thread BLM768 via Digitalmars-d
On Wednesday, 27 July 2016 at 07:59:54 UTC, Walter Bright wrote: "The expression assert(0) is a special case; it signifies code that should be unreachable. If it is reached at runtime, either AssertError is thrown or execution is terminated in an implementation-defined manner. Any code after

Re: @gc attribute for bypassign @nogc

2016-07-28 Thread Lodovico Giaretta via Digitalmars-d
On Thursday, 28 July 2016 at 00:23:57 UTC, bitwise wrote: The point is though, that I WANT to use the GC. I want the memory cleaned up for me, and I don't mind little pauses once in a while. I just don't want careless allocations to happen in certain performance-sensitive contexts, like

[Issue 16323] std.utf.decodeBack

2016-07-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16323 Jonathan M Davis changed: What|Removed |Added CC|

Re: Things that make writing a clean binding system more difficult

2016-07-28 Thread Walter Bright via Digitalmars-d
On 7/28/2016 1:33 AM, Ethan Watson wrote: 1) Declaring a function pointer with a ref return value can't be done without workarounds. Try compiling this: ref int function( int, int ) functionPointer; It won't let you, because only parameters and for loop symbols can be ref types. Despite the

Re: Overflows in Phobos

2016-07-28 Thread qznc via Digitalmars-d
On Thursday, 28 July 2016 at 00:17:16 UTC, Walter Bright wrote: On 7/27/2016 3:47 PM, qznc wrote: On Wednesday, 27 July 2016 at 07:59:54 UTC, Walter Bright wrote: "The expression assert(0) is a special case; it signifies code that should be unreachable. If it is reached at runtime, either

[Issue 16329] New: Function declaration followed by definition does not work

2016-07-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16329 Issue ID: 16329 Summary: Function declaration followed by definition does not work Product: D Version: D2 Hardware: All OS: All Status: NEW

Re: Things that make writing a clean binding system more difficult

2016-07-28 Thread Ethan Watson via Digitalmars-d
On Thursday, 28 July 2016 at 08:49:35 UTC, Walter Bright wrote: Do you mean: void foo(); void foo() { } ? Exactly this. I've been unable to get it to work.

Re: Autodecode in the wild and An Awful Hack to std.regex

2016-07-28 Thread Kagamin via Digitalmars-d-learn
A template parameter is usually needed when it affects the output data, but in case of regex it won't do much, because the output data are slices of the input string, so decoding doesn't affect them, only exceptions.

[Issue 16095] a delegate can mutate immutable data and break shared / non-shared enforcements

2016-07-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16095 ZombineDev changed: What|Removed |Added Keywords||safe

Re: New Diet template engine almost complete, ready for comments

2016-07-28 Thread Sönke Ludwig via Digitalmars-d-announce
Am 26.07.2016 um 07:54 schrieb Sönke Ludwig: However, what should work well is a combination of https://github.com/dlang/dub/pull/446 and https://github.com/rejectedsoftware/vibe.d/pull/1385 - I'll merge the latter one into vibe.d master today. I decided against putting it into vibe.d and

Re: Things that make writing a clean binding system more difficult

2016-07-28 Thread Walter Bright via Digitalmars-d
On 7/28/2016 1:33 AM, Ethan Watson wrote: I also assume "lodge a bug" will be the response to these. Indeed. That's the process. 2) Expansion of code (static foreach, templates) is slow to the point where string mixins are a legitimate compile-time optimisation

[Issue 16330] New: Expansion of code (static foreach, templates) is too slow

2016-07-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16330 Issue ID: 16330 Summary: Expansion of code (static foreach, templates) is too slow Product: D Version: D2 Hardware: All OS: All Status: NEW

Re: Things that make writing a clean binding system more difficult

2016-07-28 Thread Walter Bright via Digitalmars-d
On 7/28/2016 1:54 AM, Ethan Watson wrote: On Thursday, 28 July 2016 at 08:49:35 UTC, Walter Bright wrote: Do you mean: void foo(); void foo() { } ? Exactly this. I've been unable to get it to work. https://issues.dlang.org/show_bug.cgi?id=16329 The reason it's an enhancement request

Re: Autodecode in the wild and An Awful Hack to std.regex

2016-07-28 Thread Kagamin via Digitalmars-d-learn
Create an RFE? Given that regex returns results as slices of the input string, using the replacement character doesn't introduce data corruption.

Re: D-Man culture

2016-07-28 Thread Walter Bright via Digitalmars-d-announce
On 7/28/2016 2:06 AM, Jack Applegame wrote: [...] Past time to drop this topic.

Re: Autodecode in the wild and An Awful Hack to std.regex

2016-07-28 Thread Lodovico Giaretta via Digitalmars-d-learn
On Thursday, 28 July 2016 at 09:10:33 UTC, Kagamin wrote: Create an RFE? Given that regex returns results as slices of the input string, using the replacement character doesn't introduce data corruption. (RFE = Request For Enhancement, right?) Yes, all algorithms that use decode internally

Re: D-Man culture

2016-07-28 Thread Jack Applegame via Digitalmars-d-announce
On Thursday, 28 July 2016 at 01:58:13 UTC, ketmar wrote: On Wednesday, 27 July 2016 at 19:50:13 UTC, Walter Bright wrote: While I appreciate the effort and the offer, it is inappropriate to have a woman with a miniskirt and partially unbuttoned blouse as an official mascot for D. i agree.

Import from github

2016-07-28 Thread eugene via Digitalmars-d
Hello everyone, can i do in D something like this: import "github.com/julienschmidt/httprouter" like in Golang?

Re: Import from github

2016-07-28 Thread Lodovico Giaretta via Digitalmars-d
On Thursday, 28 July 2016 at 13:31:59 UTC, eugene wrote: Hello everyone, can i do in D something like this: import "github.com/julienschmidt/httprouter" like in Golang? No, but many D libraries you find on github are registered on DUB, so you can use it to manage your dependencies (if that

Question about destructor of database and multiple use access

2016-07-28 Thread Suliman via Digitalmars-d-learn
I have for next queston. For example I have class for working with DB (I am using ddbc driver). I put some variables as class fields, and init them in constructor: class GDB { Statement stmt; Config config; MySQLDriver driver; DataSource ds;

Re: Code coverage in Phobos

2016-07-28 Thread Seb via Digitalmars-d
On Sunday, 10 July 2016 at 02:38:07 UTC, Seb wrote: On Wednesday, 25 May 2016 at 02:34:44 UTC, Seb wrote: On Tuesday, 29 March 2016 at 20:50:57 UTC, Seb wrote: Okay I see that for the long run we need a better way to handle the testing infrastructure :/ Actually the idea of achieving "100%

Re: New Diet template engine almost complete, ready for comments

2016-07-28 Thread Chris via Digitalmars-d-announce
On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote: The Diet template language is aimed at providing a way to define procedurally generated HTML/XML pages (or other output formats), with minimal visual noise. Syntax and feature set are heavily inspired by Jade ,

Re: New Diet template engine almost complete, ready for comments

2016-07-28 Thread Rory McGuire via Digitalmars-d-announce
On Thu, Jul 28, 2016 at 3:26 PM, Chris via Digitalmars-d-announce < digitalmars-d-announce@puremagic.com> wrote: > > Great stuff! Very much appreciated. Btw, the link to jade-lang.org (don't > click!) leads to a dodgy business homepage atm. The right address is > > http://jade-lang.com/ > Also:

[Issue 15768] std.stdio.trustedStdout accesses __gshared data without synchronization.

2016-07-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15768 --- Comment #7 from Jack Stouffer --- (In reply to Sobirari Muhomori from comment #6) > (In reply to Jack Stouffer from comment #2) > > In order for stdout, stdin, and stderr to be shared(File) > > 1. shared(File) stdio will

Re: Import from github

2016-07-28 Thread Seb via Digitalmars-d
On Thursday, 28 July 2016 at 13:39:43 UTC, Lodovico Giaretta wrote: On Thursday, 28 July 2016 at 13:31:59 UTC, eugene wrote: Hello everyone, can i do in D something like this: import "github.com/julienschmidt/httprouter" like in Golang? No, but many D libraries you find on github are

Re: Question about destructor of database and multiple use access

2016-07-28 Thread Suliman via Digitalmars-d-learn
class GDB { Config config; MySQLDriver driver; DataSource ds; Connection conn; this(Config config) { this.config = config; driver = new MySQLDriver(); string[string] params; string url =

Re: Why D isn't the next "big thing" already

2016-07-28 Thread burjui via Digitalmars-d-learn
On Wednesday, 27 July 2016 at 10:41:54 UTC, ketmar wrote: On Wednesday, 27 July 2016 at 10:39:52 UTC, NX wrote: Lack of production quality tools like? no, "refactoring" and other crap is not "production quality tools", they are only useful to pretend that you are doing something useful, so

[Issue 16291] phobosinit fails to register encodings on individual tests

2016-07-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16291 --- Comment #21 from Steven Schveighoffer --- I have a branch to fix this. I'm waiting for my cycle detection fix to be pulled, because I don't want to re-introduce cycles to make that fail (in case it's specific to an OS I

Re: Things that make writing a clean binding system more difficult

2016-07-28 Thread Kagamin via Digitalmars-d
On Thursday, 28 July 2016 at 08:33:22 UTC, Ethan Watson wrote: This also isn't the only use case I have. I'm a game engine programmer. We write a lot of abstracted interfaces with platform specific implementations. I know, I know, version(X){} your code, right? But that's not how everyone

[Issue 16291] phobosinit fails to register encodings on individual tests

2016-07-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16291 Johannes Pfau changed: What|Removed |Added CC|

Re: D-Man culture

2016-07-28 Thread Chris via Digitalmars-d-announce
On Thursday, 28 July 2016 at 09:35:20 UTC, Walter Bright wrote: On 7/28/2016 2:06 AM, Jack Applegame wrote: [...] Past time to drop this topic. Any way we could generate revenue with the (real) D-Man? I don't know, if it existed independently of DLang, or if it's in some way related to

Documented unittests & code coverage

2016-07-28 Thread Johannes Pfau via Digitalmars-d
Some time ago we moved some example code from documentation comments into documented unittests. Some of these more complicated examples are incomplete and therefore are not expected to actually run. These are also not very useful as real unittests as they do not contain any asserts or verification

Re: Why D isn't the next "big thing" already

2016-07-28 Thread ketmar via Digitalmars-d-learn
On Thursday, 28 July 2016 at 11:41:49 UTC, burjui wrote: Why do you use D then? it is fun. Oh, D is more convenient and robust? no, it is more fun. "Refactoring" is more convenient and robust than sed -i 's/.../.../g'. ues, using specialised tools to do useless work can be counted as

Re: How do I use the ScopedAllocator?

2016-07-28 Thread Nick Treleaven via Digitalmars-d
On Monday, 25 July 2016 at 07:33:25 UTC, Yuxuan Shui wrote: Valgrind reports double free anyways. I think it's just the inaccuracy of the glibc double free detection. Please file a bug - thanks! https://issues.dlang.org/ I found this, maybe related:

Re: Question about destructor of database and multiple use access

2016-07-28 Thread Dechcaudron via Digitalmars-d-learn
I don't know anything about the driver you are using, but from my general experience with DBs I'll try to give you some insight. On Thursday, 28 July 2016 at 14:01:45 UTC, Suliman wrote: 1. Should declaration of them be field of class? I'd say so. If you intend to use each instance of the

Re: @gc attribute for bypassign @nogc

2016-07-28 Thread bitwise via Digitalmars-d
On Thursday, 28 July 2016 at 07:12:06 UTC, Lodovico Giaretta wrote: On Thursday, 28 July 2016 at 00:23:57 UTC, bitwise wrote: The point is though, that I WANT to use the GC. I want the memory cleaned up for me, and I don't mind little pauses once in a while. I just don't want careless

Re: Autodecode in the wild and An Awful Hack to std.regex

2016-07-28 Thread Seb via Digitalmars-d-learn
On Thursday, 28 July 2016 at 09:10:33 UTC, Kagamin wrote: Create an RFE? Given that regex returns results as slices of the input string, using the replacement character doesn't introduce data corruption. We call them DIP (D Improvement Proposals) and I think it's a lot more productive way to

Re: New Diet template engine almost complete, ready for comments

2016-07-28 Thread Sönke Ludwig via Digitalmars-d-announce
Am 28.07.2016 um 15:26 schrieb Chris: On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote: The Diet template language is aimed at providing a way to define procedurally generated HTML/XML pages (or other output formats), with minimal visual noise. Syntax and feature set are heavily

Re: Question about destructor of database and multiple use access

2016-07-28 Thread Dechcaudron via Digitalmars-d-learn
On Thursday, 28 July 2016 at 14:24:16 UTC, Suliman wrote: void dbInsert(string login, string uploading_date, string geometry_type, string data) { Statement stmt = conn.createStatement(); //stmt.executeUpdate("..."); // some processing of

Re: Why D isn't the next "big thing" already

2016-07-28 Thread Gorge Jingale via Digitalmars-d-learn
On Wednesday, 27 July 2016 at 10:41:54 UTC, ketmar wrote: On Wednesday, 27 July 2016 at 10:39:52 UTC, NX wrote: Lack of production quality tools like? no, "refactoring" and other crap is not "production quality tools", they are only useful to pretend that you are doing something useful, so

Re: New Diet template engine almost complete, ready for comments

2016-07-28 Thread rikki cattermole via Digitalmars-d-announce
On 29/07/2016 1:57 AM, Rory McGuire via Digitalmars-d-announce wrote: On Thu, Jul 28, 2016 at 3:26 PM, Chris via Digitalmars-d-announce > wrote: Great stuff! Very much appreciated. Btw, the link to

[Issue 16331] New: std.container.array constructor shouldn't check result of emplacement

2016-07-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16331 Issue ID: 16331 Summary: std.container.array constructor shouldn't check result of emplacement Product: D Version: D2 Hardware: x86_64 OS: Linux

Re: Question about destructor of database and multiple use access

2016-07-28 Thread Dechcaudron via Digitalmars-d-learn
On Thursday, 28 July 2016 at 15:18:24 UTC, Lodovico Giaretta wrote: 3) at program end, live objects are not scheduled for finalization; 4) at program end, pending finalizations from previous collections may not be run. I didn't know these two, can I get source on them? Also, I'm assuming

Re: Question about destructor of database and multiple use access

2016-07-28 Thread Lodovico Giaretta via Digitalmars-d-learn
On Thursday, 28 July 2016 at 14:33:26 UTC, Dechcaudron wrote: On Thursday, 28 July 2016 at 14:01:45 UTC, Suliman wrote: 2. Should I call destructor and how it's should like? You certainly want to close the connection to the db. Basically, the destructor is intended to free resources such as

Re: Question about destructor of database and multiple use access

2016-07-28 Thread Dechcaudron via Digitalmars-d-learn
On Thursday, 28 July 2016 at 14:43:32 UTC, Lodovico Giaretta wrote: No! Never run important finalization in a class destructor! The GC is not obliged to run the destructors, so you may end up with your objects destroyed but the connections still open. For this kind of important things, you

Re: Question about destructor of database and multiple use access

2016-07-28 Thread Lodovico Giaretta via Digitalmars-d-learn
On Thursday, 28 July 2016 at 15:02:58 UTC, Dechcaudron wrote: On Thursday, 28 July 2016 at 14:43:32 UTC, Lodovico Giaretta wrote: No! Never run important finalization in a class destructor! The GC is not obliged to run the destructors, so you may end up with your objects destroyed but the

Re: @gc attribute for bypassign @nogc

2016-07-28 Thread default0 via Digitalmars-d
On Thursday, 28 July 2016 at 16:45:05 UTC, bitwise wrote: On Thursday, 28 July 2016 at 16:15:04 UTC, Guillaume Piolat wrote: On Thursday, 28 July 2016 at 15:24:10 UTC, bitwise wrote: It's not about running out of memory. It's a performance issue. Example: In the following class, it would

[Issue 16331] std.container.array constructor shouldn't check result of emplacement

2016-07-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16331 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 16331] std.container.array constructor shouldn't check result of emplacement

2016-07-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16331 --- Comment #1 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/539d860380edea250df7eb353174e58d8ef5f2cd Fix issue 16331 - std.container.array should allow

Re: @gc attribute for bypassign @nogc

2016-07-28 Thread Guillaume Piolat via Digitalmars-d
On Thursday, 28 July 2016 at 15:24:10 UTC, bitwise wrote: It's not about running out of memory. It's a performance issue. Example: In the following class, it would be perfectly fine, and even expected to allocate in start() but not in update(). This is because start() gets called once on

Re: @gc attribute for bypassign @nogc

2016-07-28 Thread bitwise via Digitalmars-d
On Thursday, 28 July 2016 at 16:15:04 UTC, Guillaume Piolat wrote: On Thursday, 28 July 2016 at 15:24:10 UTC, bitwise wrote: It's not about running out of memory. It's a performance issue. Example: In the following class, it would be perfectly fine, and even expected to allocate in start()

Re: Most reliable debugging experience for LDC

2016-07-28 Thread Sam via Digitalmars-d-debugger
I posted an issue on Github for this (https://github.com/ldc-developers/ldc/issues/1651#issuecomment-235930281) and it seems that currently LDC 1.0.0 compiled with LLVM 3.8 does not produce good debugging info.

Re: Code coverage in Phobos

2016-07-28 Thread Walter Bright via Digitalmars-d
On 7/28/2016 7:16 AM, Seb wrote: 4) CodeCov has a bunch of other features, for example browser extensions that integrate the code coverage report directly onto Github diffs: https://github.com/codecov/browser-extension I installed the browser extension for Chrome, but it says "no coverage"

Re: Code coverage in Phobos

2016-07-28 Thread Walter Bright via Digitalmars-d
On 7/28/2016 7:16 AM, Seb wrote: Short update - the experiment is now live. Please help to kill the uncovered bits in Phobos :) Thank you very much for doing this! Raising the visibility of code coverage will push towards much better unittesting of Phobos.

Re: @gc attribute for bypassign @nogc

2016-07-28 Thread Lodovico Giaretta via Digitalmars-d
On Thursday, 28 July 2016 at 16:45:05 UTC, bitwise wrote: On Thursday, 28 July 2016 at 16:15:04 UTC, Guillaume Piolat wrote: On Thursday, 28 July 2016 at 15:24:10 UTC, bitwise wrote: It's not about running out of memory. It's a performance issue. Example: In the following class, it would

Re: New __FILE_DIR__ trait?

2016-07-28 Thread Sebastien Alaiwan via Digitalmars-d
On Thursday, 28 July 2016 at 06:21:06 UTC, Jonathan Marler wrote: auto __DIR__(string fileFullPath = __FILE_FULL_PATH__) pure { return fileFullPath.dirName; } Doesn't work, I don't think you can wrap such things ( __FILE__ and such ): import std.stdio; int main() { printNormal();

Re: New __FILE_DIR__ trait?

2016-07-28 Thread Sebastien Alaiwan via Digitalmars-d
By the way, I really think __FILE_FULL_PATH__ should be a rdmd feature, not dmd. rdmd could set an environment variable "RDMD_FULL_PATH" or something like this (replacing argv[0]), instead of potentially making the compilation depend on the working copy location on disk...

[OT] Re: @gc attribute for bypassign @nogc

2016-07-28 Thread jdfgjdf via Digitalmars-d
On Sunday, 24 July 2016 at 22:13:02 UTC, bitwise wrote: ... I like the typo in the title. Let's make a game: "write the `bypassign` function, its ddoc, and its unittests" :)

Re: [OT] Re: @gc attribute for bypassign @nogc

2016-07-28 Thread jdfgjdf via Digitalmars-d
On Thursday, 28 July 2016 at 17:54:20 UTC, jdfgjdf wrote: On Sunday, 24 July 2016 at 22:13:02 UTC, bitwise wrote: ... I like the typo in the title. Let's make a game: "write the `bypassign` function, its ddoc, and its unittests" :) Entry one: /** * Bypassign is a struct wrapper that

Re: Transform/Compile to C/CPP as a target

2016-07-28 Thread Sebastien Alaiwan via Digitalmars-d-learn
On Monday, 25 July 2016 at 07:53:17 UTC, Stefan Koch wrote: On Saturday, 23 July 2016 at 12:27:24 UTC, ParticlePeter wrote: Is there any kind of project or workflow that converts D (subset) to C/CPP ? The short answer is no, not for any recent version of D. The long answer is it's kind of

Re: New Diet template engine almost complete, ready for comments

2016-07-28 Thread WhatMeWorry via Digitalmars-d-announce
On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote: The Diet template language is aimed at providing a way to define procedurally generated HTML/XML pages (or other output formats), with minimal visual noise. Syntax and feature set are heavily inspired by Jade ,

Re: Documented unittests & code coverage

2016-07-28 Thread Walter Bright via Digitalmars-d
On 7/28/2016 3:15 AM, Johannes Pfau wrote: And as a philosophical question: Is code coverage in unittests even a meaningful measurement? Yes. I've read all the arguments against code coverage testing. But in my usage of it for 30 years, it has been a dramatic and unqualified success in

Re: Code coverage in Phobos

2016-07-28 Thread Walter Bright via Digitalmars-d
On 7/28/2016 1:46 PM, Seb wrote: For now you can click on "Last update 6db08d3...bb94012" to see the diff with overlayed code coverage. I don't see where that link is.

Re: Documented unittests & code coverage

2016-07-28 Thread Jonathan M Davis via Digitalmars-d
On Thursday, July 28, 2016 12:15:27 Johannes Pfau via Digitalmars-d wrote: > And as a philosophical question: Is code coverage in unittests even a > meaningful measurement? We write unittests to test the library code. But > if there's a line in a unittests which is never executed, this does not >

Re: Verifying the arguments of a function with ref parameters?

2016-07-28 Thread pineapple via Digitalmars-d-learn
On Thursday, 28 July 2016 at 21:49:00 UTC, pineapple wrote: On Thursday, 28 July 2016 at 20:28:39 UTC, jdfgjdf wrote: "Parameters!dgref.init" does not yield a reference. The real error is not displayed. In a normal context it would be "stuff is not callable with" What would be a better

Re: Verifying the arguments of a function with ref parameters?

2016-07-28 Thread ZombineDev via Digitalmars-d-learn
On Thursday, 28 July 2016 at 21:49:00 UTC, pineapple wrote: On Thursday, 28 July 2016 at 20:28:39 UTC, jdfgjdf wrote: "Parameters!dgref.init" does not yield a reference. The real error is not displayed. In a normal context it would be "stuff is not callable with" What would be a better

Re: Verifying the arguments of a function with ref parameters?

2016-07-28 Thread pineapple via Digitalmars-d-learn
On Thursday, 28 July 2016 at 20:28:39 UTC, jdfgjdf wrote: "Parameters!dgref.init" does not yield a reference. The real error is not displayed. In a normal context it would be "stuff is not callable with" What would be a better way to check whether some callable can be called using a

Re: D-Man culture

2016-07-28 Thread jdfgjdf via Digitalmars-d-announce
On Thursday, 28 July 2016 at 09:06:42 UTC, Jack Applegame wrote: To be honest, with those legs she should wear a longer skirt. :D Yes that's two fucking hams she's got.

Re: Autodecode in the wild and An Awful Hack to std.regex

2016-07-28 Thread John Carter via Digitalmars-d-learn
On Thursday, 28 July 2016 at 15:48:58 UTC, Seb wrote: We call them DIP (D Improvement Proposals) and I think it's a lot more productive way to discuss improvements than in the forum. Eh. I hoped that somewhere in that explosion of discussion on the topic the problem had been solved and I had

Re: Documented unittests & code coverage

2016-07-28 Thread Seb via Digitalmars-d
On Thursday, 28 July 2016 at 23:14:42 UTC, Walter Bright wrote: On 7/28/2016 3:15 AM, Johannes Pfau wrote: And as a philosophical question: Is code coverage in unittests even a meaningful measurement? Yes. I've read all the arguments against code coverage testing. But in my usage of it for

Re: Code coverage in Phobos

2016-07-28 Thread Walter Bright via Digitalmars-d
On 7/28/2016 4:39 PM, Seb wrote: e.g. on this PR (https://github.com/dlang/phobos/pull/4657), there is the following message. The link "Last update" is on the last line. Ok, I see it now. Thanks!

Re: @gc attribute for bypassign @nogc

2016-07-28 Thread Lodovico Giaretta via Digitalmars-d
On Thursday, 28 July 2016 at 20:32:18 UTC, bitwise wrote: On Thursday, 28 July 2016 at 18:53:35 UTC, Meta wrote: On Thursday, 28 July 2016 at 00:23:57 UTC, bitwise wrote: While working on a past project(C++), I found this little gem: void draw() { Font* f = new Font("arial.ttf", 16);

Re: @gc attribute for bypassign @nogc

2016-07-28 Thread ag0aep6g via Digitalmars-d
On 07/28/2016 10:46 PM, Lodovico Giaretta wrote: Also, the code of that maybe-not-@nogc library may not be available to check for this thing. Maybe the user doesn't want to trust the library writer, and so wants the compiler to guarantee no allocations at all. If you can't check the code, you

Re: Things that make writing a clean binding system more difficult

2016-07-28 Thread Steven Schveighoffer via Digitalmars-d
On 7/28/16 4:16 PM, Jonathan M Davis via Digitalmars-d wrote: On Thursday, July 28, 2016 01:49:35 Walter Bright via Digitalmars-d wrote: On 7/28/2016 1:33 AM, Ethan Watson wrote: 1) Declaring a function pointer with a ref return value can't be done without workarounds. Try compiling this:

Re: @gc attribute for bypassign @nogc

2016-07-28 Thread bitwise via Digitalmars-d
On Thursday, 28 July 2016 at 16:58:14 UTC, default0 wrote: On Thursday, 28 July 2016 at 16:45:05 UTC, bitwise wrote: On Thursday, 28 July 2016 at 16:15:04 UTC, Guillaume Piolat wrote: On Thursday, 28 July 2016 at 15:24:10 UTC, bitwise wrote: It's not about running out of memory. It's a

Re: Verifying the arguments of a function with ref parameters?

2016-07-28 Thread jdfgjdf via Digitalmars-d-learn
On Thursday, 28 July 2016 at 19:19:06 UTC, pineapple wrote: Why doesn't this code do what I'd expect it to, and how can I fix it? unittest{ import std.traits : Parameters; // Works as expected alias dg = int delegate(int value); enum bool dgcallable =

Re: Things that make writing a clean binding system more difficult

2016-07-28 Thread jmh530 via Digitalmars-d
On Thursday, 28 July 2016 at 20:16:11 UTC, Jonathan M Davis wrote: Well, if we decided to make parens with ref legal, then we could make it work. e.g. ref(int) function(int, int) functionPointer; Now, I don't know of any other case where you'd actually use parens with ref if it were legal,

Re: Things that make writing a clean binding system more difficult

2016-07-28 Thread Timon Gehr via Digitalmars-d
On 28.07.2016 10:49, Walter Bright wrote: On 7/28/2016 1:33 AM, Ethan Watson wrote: 1) Declaring a function pointer with a ref return value can't be done without workarounds. Try compiling this: ref int function( int, int ) functionPointer; It won't let you, because only parameters and for

Re: Documented unittests & code coverage

2016-07-28 Thread Walter Bright via Digitalmars-d
On 7/28/2016 9:48 PM, Jonathan M Davis via Digitalmars-d wrote: gives some good examples of why having the unittest blocks themselves counted in the total percentage is problematic and can lead to dmd's code coverage tool listing than 100% coverage in a module that is fully tested. What's

Re: Documented unittests & code coverage

2016-07-28 Thread Jonathan M Davis via Digitalmars-d
On Thursday, July 28, 2016 22:12:58 Walter Bright via Digitalmars-d wrote: > As soon as we start taking the % coverage too seriously, we are in trouble. > It's never going to be cut and dried what should be tested and what is > unreasonable to test, and I see no point in arguing about it. > > The

Re: Documented unittests & code coverage

2016-07-28 Thread Jonathan M Davis via Digitalmars-d
On Thursday, July 28, 2016 16:14:42 Walter Bright via Digitalmars-d wrote: > On 7/28/2016 3:15 AM, Johannes Pfau wrote: > > And as a philosophical question: Is code coverage in unittests even a > > meaningful measurement? > > Yes. I've read all the arguments against code coverage testing. But in

Re: D for competitive programming

2016-07-28 Thread Timon Gehr via Digitalmars-d
On 29.07.2016 00:07, Seb wrote: On Thursday, 28 July 2016 at 21:20:29 UTC, urxvt1 wrote: I wanted to try topcoder problems (never used this site before) and I found out that it doesn't support dlang. They only have c++, java, c#, vb.net, python languages. It would be great to see D on this

Re: Things that make writing a clean binding system more difficult

2016-07-28 Thread Jonathan M Davis via Digitalmars-d
On Friday, July 29, 2016 06:44:16 Timon Gehr via Digitalmars-d wrote: > My parser accepts the following: > > int function(int,int)ref functionPointer; > > I wasn't really aware that this was illegal in DMD. (Other function > attributes, such as pure, are accepted.) > > In fact, even the following

Re: D for competitive programming

2016-07-28 Thread Steven Schveighoffer via Digitalmars-d
On 7/28/16 5:20 PM, urxvt1 wrote: I wanted to try topcoder problems (never used this site before) and I found out that it doesn't support dlang. They only have c++, java, c#, vb.net, python languages. It would be great to see D on this list. I found this thread

Re: @gc attribute for bypassign @nogc

2016-07-28 Thread bitwise via Digitalmars-d
On Thursday, 28 July 2016 at 21:07:22 UTC, ag0aep6g wrote: On 07/28/2016 10:46 PM, Lodovico Giaretta wrote: Also, the code of that maybe-not-@nogc library may not be available to check for this thing. Maybe the user doesn't want to trust the library writer, and so wants the compiler to

[Issue 14856] -cov should not count unittest blocks

2016-07-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14856 greensunn...@gmail.com changed: What|Removed |Added CC||greensunn...@gmail.com --

Re: Code coverage in Phobos

2016-07-28 Thread Seb via Digitalmars-d
On Thursday, 28 July 2016 at 23:11:04 UTC, Walter Bright wrote: On 7/28/2016 1:46 PM, Seb wrote: For now you can click on "Last update 6db08d3...bb94012" to see the diff with overlayed code coverage. I don't see where that link is. Sorry about being so vague. e.g. on this PR

[Issue 16333] New: show stack overflow as error message instead of segfaulting

2016-07-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16333 Issue ID: 16333 Summary: show stack overflow as error message instead of segfaulting Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW

Re: Transform/Compile to C/CPP as a target

2016-07-28 Thread Seb via Digitalmars-d-learn
On Saturday, 23 July 2016 at 12:27:24 UTC, ParticlePeter wrote: Is there any kind of project or workflow that converts D (subset) to C/CPP ? Just FYI there is a project that does the reverse. Calypso creates a bridge between DMD/LDC and Clang, both at the AST level (DMD <=> Clang's AST,

Re: Code coverage in Phobos

2016-07-28 Thread Walter Bright via Digitalmars-d
On 7/28/2016 11:51 AM, Seb wrote: Do you see the Code coverage overlay for this diff? https://github.com/dlang/phobos/commit/6db08d3dadb007d930a4042a6140ca4fb22ea540 Yes. Took me a moment to realize the green box meant covered. and on this file?

Re: New Diet template engine almost complete, ready for comments

2016-07-28 Thread Sönke Ludwig via Digitalmars-d-announce
Am 28.07.2016 um 20:07 schrieb WhatMeWorry: On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote: The Diet template language is aimed at providing a way to define procedurally generated HTML/XML pages (or other output formats), with minimal visual noise. Syntax and feature set are

Re: Array of const objects with indirections and std.algorithm.copy

2016-07-28 Thread Ali Çehreli via Digitalmars-d-learn
On 07/27/2016 04:51 AM, drug wrote: > cfoo.copy(foo); // fails to compile because phobos in case of array uses > // array specialization and this specialization fails > // see > https://github.com/dlang/phobos/blob/v2.071.1/std/algorithm/mutation.d#L333 Thanks

Re: Code coverage in Phobos

2016-07-28 Thread Seb via Digitalmars-d
On Thursday, 28 July 2016 at 17:56:49 UTC, Walter Bright wrote: On 7/28/2016 7:16 AM, Seb wrote: 4) CodeCov has a bunch of other features, for example browser extensions that integrate the code coverage report directly onto Github diffs: https://github.com/codecov/browser-extension I

Re: D-Man culture

2016-07-28 Thread Kagamin via Digitalmars-d-announce
On Wednesday, 27 July 2016 at 19:50:13 UTC, Walter Bright wrote: partially unbuttoned blouse That's a faithful reference to the empty space in the middle of D-Man :)

  1   2   >