Debugging a druntime issue found by AutoTester

2017-12-11 Thread Ali Çehreli via Digitalmars-d-learn
The automatic tests for a PR failed for a target that I could not test myself: 32-bit build on Darwin_64_32. https://auto-tester.puremagic.com/show-run.ghtml?projectid=1=2940199=20802787=true Testing attach_detach timelimit -t 10 ./generated/osx/debug/32/attach_detach

Re: Static array as immutable

2017-12-11 Thread Radu via Digitalmars-d-learn
On Tuesday, 12 December 2017 at 07:33:47 UTC, Ivan Trombley wrote: Is there some way that I can make this array immutable? static float[256] ga = void; static foreach (i; 0 .. 256) ga[i] = (i / 255.0f) ^^ (1 / 2.2f); Check https://dlang.org/phobos/std_exception.html#assumeUnique

Static array as immutable

2017-12-11 Thread Ivan Trombley via Digitalmars-d-learn
Is there some way that I can make this array immutable? static float[256] ga = void; static foreach (i; 0 .. 256) ga[i] = (i / 255.0f) ^^ (1 / 2.2f);

Re: SDL2 texture blend help

2017-12-11 Thread Dmitry via Digitalmars-d
On Tuesday, 12 December 2017 at 06:27:30 UTC, Ivan Trombley wrote: This isn't a scaling problem (which is totally solved by Scaling is not a prerequisite for this problem. pre-multiplying the alpha with the colors BTW). This is a gamma How did you this? Using editor or using shader? If shder,

Re: OT (Was: Re: What's the proper way to use std.getopt?)

2017-12-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, December 11, 2017 15:38:44 H. S. Teoh via Digitalmars-d-learn wrote: > On Mon, Dec 11, 2017 at 11:35:53PM +, Seb via Digitalmars-d-learn > wrote: [...] > > > D style would be to use sth. like this (instead of try/catch): > > > > ``` > > scope(failure) { > > > > e.msg.writeln; > >

Re: Adding Markdown to Ddoc

2017-12-11 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, December 05, 2017 20:11:33 Walter Bright via Digitalmars-d wrote: > https://help.github.com/articles/basic-writing-and-formatting-syntax/ > > Anyone interested in picking up the flag? > > (I know this has come up before, and I've been opposed to it, but I've > changed my mind.) I

[Issue 18058] @nogc and forwarding lazy argument, particularly with scope

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18058 --- Comment #6 from Maksim Fomin --- (In reply to Shachar Shemesh from comment #4) > (In reply to Seb from comment #2) > > FWIW that attributes are set wrongly on lazy parameters and their function > > is a well-known bug and

[Issue 18058] @nogc and forwarding lazy argument, particularly with scope

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18058 --- Comment #5 from Maksim Fomin --- (In reply to Shachar Shemesh from comment #3) > (In reply to Maksim Fomin from comment #1) > > > The second problem is that the lowering is overly complicated. Instead > > > of lowering to: >

Re: SDL2 texture blend help

2017-12-11 Thread Ivan Trombley via Digitalmars-d
On Tuesday, 12 December 2017 at 03:34:51 UTC, Dmitry wrote: On Tuesday, 12 December 2017 at 03:32:05 UTC, Ivan Trombley wrote: It turns out that it's an issue with the color channels being in sRGB color space and the alpha channel being linear. I verified this by doing a software blend of the

[Issue 15935] compiling dub with -fPIC triggers internal compiler error

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15935 Seb changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 17107] Runnign phobos unittests do not work with PIE

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17107 Seb changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 18014] DMD test suite fails to link on Linux distros where PIC/PIE is enforced

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18014 Seb changed: What|Removed |Added Keywords||pull CC|

Re: Adding Markdown to Ddoc

2017-12-11 Thread Patrick Schluter via Digitalmars-d
On Monday, 11 December 2017 at 15:45:07 UTC, Guillaume Piolat wrote: On Monday, 11 December 2017 at 14:22:37 UTC, Jakob Bornecrantz wrote: And to add more, CommonMark on the other hand has a full spec written and several test that covers the difficult to get right parts of

[Issue 18013] DMD test suite assertion failure in test_cdvecfill.d

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18013 --- Comment #2 from Seb --- > Running the test suite in a 32-bit Ubuntu Linux 16.04 VirtualBox guest on the > same host works fine. -fPIC was not required to get a build. Ubuntu introduced PIE-hardening in 16.10:

[Issue 18013] DMD test suite assertion failure in test_cdvecfill.d

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18013 Seb changed: What|Removed |Added Keywords||pull CC|

Re: Post about comparing C, C++ and D performance with a real world project

2017-12-11 Thread Daniel Kozak via Digitalmars-d
Thanks, I will try that. On Mon, Dec 11, 2017 at 7:34 PM, German Diago via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > On Thursday, 7 December 2017 at 14:09:35 UTC, Steven Schveighoffer wrote: > >> On 12/7/17 6:46 AM, Daniel Kozak wrote: >> >>> Not much helpful, still does not know

Re: Adding Markdown to Ddoc

2017-12-11 Thread Bernard Helyer via Digitalmars-d
On Tuesday, 12 December 2017 at 02:30:39 UTC, Walter Bright wrote: It's apparently written in Volt: https://github.com/VoltLang/Watt But the two links there to Volt are dead: https://github.com/VoltLang/Watt/blob/master/volt-lang.org Ah, the joys of forgetting too ensure URLs in Markdown

Re: SDL2 texture blend help

2017-12-11 Thread Dmitry via Digitalmars-d
On Tuesday, 12 December 2017 at 03:32:05 UTC, Ivan Trombley wrote: It turns out that it's an issue with the color channels being in sRGB color space and the alpha channel being linear. I verified this by doing a software blend of the images and then doing another software blend using gamma

Re: SDL2 texture blend help

2017-12-11 Thread Ivan Trombley via Digitalmars-d
It turns out that it's an issue with the color channels being in sRGB color space and the alpha channel being linear. I verified this by doing a software blend of the images and then doing another software blend using gamma corrected values. There's a setting in opengl to correct for it,

Re: Druntime and non-D threads

2017-12-11 Thread Joakim via Digitalmars-d
On Friday, 8 December 2017 at 09:33:03 UTC, Ali Çehreli wrote: I'm trying to use D as a library to be called from a non-D environment e.g. Java runtime. If I'm not mistaken, it's quite difficult and perhaps impossible to use GC in such a scenario. It works as long as attached threads don't go

[Issue 18066] duplicate symbol error when symbol is in a ".o" and a ".a" ; linker should accept it to allow partial recompilation

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18066 --- Comment #3 from Timothee Cour --- NOTE: there's also the mystery that "import std.file;" is somehow special and other imports don't have this error. --

Re: Why is there no std.stream anymore?

2017-12-11 Thread codephantom via Digitalmars-d-learn
On Tuesday, 12 December 2017 at 02:15:13 UTC, codephantom wrote: just playing around with this also...in case you only want to read n bytes.. // --- module test; import std.stdio, std.file, std.exception; import std.datetime.stopwatch; void main() { string

[Issue 18066] duplicate symbol error when symbol is in a ".o" and a ".a" ; linker should accept it to allow partial recompilation

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18066 Timothee Cour changed: What|Removed |Added Summary|regression: duplicate |duplicate symbol

[Issue 18066] duplicate symbol error when symbol is in a ".o" and a ".a" ; linker should accept it to allow partial recompilation

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18066 Timothee Cour changed: What|Removed |Added Severity|regression |blocker --

[Issue 18066] regression: duplicate symbol __Dmain : worked in dmd.071.2, fails in dmd.072

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18066 Timothee Cour changed: What|Removed |Added CC|

[Issue 18058] @nogc and forwarding lazy argument, particularly with scope

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18058 --- Comment #4 from Shachar Shemesh --- (In reply to Seb from comment #2) > FWIW that attributes are set wrongly on lazy parameters and their function > is a well-known bug and has been around for a long time. True, but it wouldn't

Re: Adding Markdown to Ddoc

2017-12-11 Thread Walter Bright via Digitalmars-d
On 12/11/2017 2:30 PM, Jakob Bornecrantz wrote: It is not written in D, but the language is close enough in concepts that it can be mechanically ported into D, and is licensed under BOOST. Feel free to do what ever to it[1]. Thank you for Boost licensing it! We first used the markdown

[Issue 18058] @nogc and forwarding lazy argument, particularly with scope

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18058 --- Comment #3 from Shachar Shemesh --- (In reply to Maksim Fomin from comment #1) > > The second problem is that the lowering is overly complicated. Instead > > of lowering to: > > Again, currently compiler behaves according to

[Issue 18066] New: regression: duplicate symbol __Dmain : worked in dmd.071.2, fails in dmd.072

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18066 Issue ID: 18066 Summary: regression: duplicate symbol __Dmain : worked in dmd.071.2, fails in dmd.072 Product: D Version: D2 Hardware: x86 OS: Mac OS X

Re: LDC 1.7.0-beta1

2017-12-11 Thread John via Digitalmars-d-announce
On Sunday, 10 December 2017 at 18:11:46 UTC, Suliman wrote: On Sunday, 10 December 2017 at 17:33:34 UTC, kinke wrote: Hi everyone, on behalf of the LDC team, I'm glad to announce the first beta for LDC 1.7. The highlights of this version in a nutshell: * Based on D 2.077.1. * Catching C++

Re: Why is there no std.stream anymore?

2017-12-11 Thread codephantom via Digitalmars-d-learn
On Monday, 11 December 2017 at 20:51:41 UTC, Jordi Gutiérrez Hermoso wrote: I'd like to read from a file, one byte at a time, without loading the whole file in memory. just playing around with this // module test; import std.stdio, std.file, std.exception; void

Re: Adding Markdown to Ddoc

2017-12-11 Thread Walter Bright via Digitalmars-d
On 12/11/2017 2:30 PM, Jakob Bornecrantz wrote: What I'm trying to get at is, use the testsuit and spec, it will save you lot of other problems down the road. And you will be making the world of Markdown a better place because there will be one less implementation that does things slightly

[Issue 16265] unittest imports should not be counted as dependencies for static ctors

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16265 Mike Franklin changed: What|Removed |Added CC||slavo5...@yahoo.com

Re: Open Scene Graph For D?

2017-12-11 Thread Tofu ninja via Digitalmars-d-learn
On Thursday, 7 December 2017 at 19:30:13 UTC, Tofu ninja wrote: Is there a binding for it? Just a question, trying to convince people at work to use D and that is something they asked about. Guess not

Re: LDC 1.7.0-beta1

2017-12-11 Thread Meta via Digitalmars-d-announce
On Sunday, 10 December 2017 at 17:33:34 UTC, kinke wrote: Hi everyone, on behalf of the LDC team, I'm glad to announce the first beta for LDC 1.7. The highlights of this version in a nutshell: * Based on D 2.077.1. * Catching C++ exceptions supported on Linux and Windows. Full release log

Re: Supporting musl libc

2017-12-11 Thread Yuxuan Shui via Digitalmars-d
On Tuesday, 17 May 2016 at 08:51:01 UTC, Jacob Carlborg wrote: As an alternative to glibc there's a C standard library called musl [1]. This is the C standard library used by ELLCC [2], a cross-compiler based on Clang. This cross-compiler makes it very easy to target other platforms and can be

Re: Druntime and non-D threads

2017-12-11 Thread Ali Çehreli via Digitalmars-d
On 12/11/2017 08:58 AM, Mengu wrote: > On Monday, 11 December 2017 at 16:25:42 UTC, Ali Çehreli wrote: >> On 12/08/2017 02:54 AM, Nemanja Boric wrote: >>> [...] >> >> So, in cases where D is just a portable library, the only sane thing >> to do seems to be what Kagamin suggested: create a D

Re: Platform-dependent tests for druntime

2017-12-11 Thread Seb via Digitalmars-d
On Monday, 11 December 2017 at 23:24:02 UTC, Ali Çehreli wrote: Since I don't have access to Windows, OS X, etc. systems nor have I expertise in them, I don't trust myself to write core.thread tests for anything but Posix. What to do for non-Posix systems? I'm tempted to wrap the entire test

[Issue 18063] thread_attachThis returns dangling pointer

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18063 --- Comment #2 from Ali Cehreli --- New PR: https://github.com/dlang/druntime/pull/1989 --

[Issue 18065] pdf not build with "make"

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18065 --- Comment #1 from Seb --- Building the PDF is part of DAutoTest, see e.g.: http://dtest.dlang.io/results/c3909c9c8aeafb5b8853cf22a0891230dc5a5ff0/1dff9af544b9f169f8b326050ea13422411476e5 Maybe an old make is used or other

Re: Clarify "Starting as a Contributor" document

2017-12-11 Thread Seb via Digitalmars-d-learn
On Monday, 11 December 2017 at 14:13:41 UTC, Dukc wrote: On Sunday, 10 December 2017 at 08:18:17 UTC, Ali Çehreli wrote: This page is very good: https://wiki.dlang.org/Starting_as_a_Contributor I need clarifications Another oddity: Someone has apparently made DRuntime build to use

Re: What's the proper way to use std.getopt?

2017-12-11 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 11 December 2017 at 20:58:25 UTC, Jordi Gutiérrez Hermoso wrote: I don't quite understand what to do if getopt throws. I would have hoped for something like I might have already said this to you on IRC but the way I'd do it (if you must do this) is: void main(string[] args) {

Re: Clarify "Starting as a Contributor" document

2017-12-11 Thread Seb via Digitalmars-d-learn
On Monday, 11 December 2017 at 06:43:46 UTC, Ali Çehreli wrote: On 12/10/2017 12:36 AM, Seb wrote: > [...] is no harm > [...] Thanks. I don't care anymore. :) >> [...] should have >> [...] a comment >> [...] necessary >> [...] message should > [...] second part > [...] opened a PR and > [...]

[Issue 18065] pdf not build with "make"

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18065 Andrei Alexandrescu changed: What|Removed |Added Hardware|x86_64 |All

[Issue 18065] New: pdf not build with "make"

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18065 Issue ID: 18065 Summary: pdf not build with "make" Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: enhancement Priority: P1

[Issue 18064] New: dlang.org: issuing "make" after a successful "make" does a lot of work

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18064 Issue ID: 18064 Summary: dlang.org: issuing "make" after a successful "make" does a lot of work Product: D Version: D2 Hardware: x86_64 OS: All

[Issue 18064] dlang.org: issuing "make" after a successful "make" does a lot of work

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18064 Andrei Alexandrescu changed: What|Removed |Added Assignee|nob...@puremagic.com

OT (Was: Re: What's the proper way to use std.getopt?)

2017-12-11 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Dec 11, 2017 at 11:35:53PM +, Seb via Digitalmars-d-learn wrote: [...] > D style would be to use sth. like this (instead of try/catch): > > ``` > scope(failure) { > e.msg.writeln; > 1.exit; > } > ``` Frankly, much as I love UFCS syntax, I think this is taking it a little too far.

Re: What's the proper way to use std.getopt?

2017-12-11 Thread Jordi Gutiérrez Hermoso via Digitalmars-d-learn
On Monday, 11 December 2017 at 21:24:41 UTC, Mike Wey wrote: try { auto helpInformation = getopt( args, "input|i", "The input", , "output|o", "The output", ); if (helpInformation.helpWanted) {

Re: Get pointer or reference of an element in Array(struct)

2017-12-11 Thread Arun Chandrasekaran via Digitalmars-d-learn
On Saturday, 9 December 2017 at 19:26:26 UTC, David Nadlinger wrote: but "free" references don't exist in the language. To the point! Thanks!

Re: What's the proper way to use std.getopt?

2017-12-11 Thread Seb via Digitalmars-d-learn
On Monday, 11 December 2017 at 21:24:41 UTC, Mike Wey wrote: On 11-12-17 21:58, Jordi Gutiérrez Hermoso wrote: [...] I would use something like this, print the help information for --help, print an error for invalid arguments: ``` try { auto helpInformation = getopt(

Re: Why is there no std.stream anymore?

2017-12-11 Thread Seb via Digitalmars-d-learn
On Monday, 11 December 2017 at 22:58:53 UTC, Jordi Gutiérrez Hermoso wrote: On Monday, 11 December 2017 at 21:21:51 UTC, Steven Schveighoffer wrote: Use the undead repository: Wow, really? Is the removal of stream from D some kind of error that hasn't been corrected yet? Well of course you

Re: Why is there no std.stream anymore?

2017-12-11 Thread flamencofantasy via Digitalmars-d-learn
On Monday, 11 December 2017 at 20:51:41 UTC, Jordi Gutiérrez Hermoso wrote: I'd like to read from a file, one byte at a time, without loading the whole file in memory. I was hoping I could do something like auto f = File("somefile"); foreach(c; f.byChar) { process(c); } but

Platform-dependent tests for druntime

2017-12-11 Thread Ali Çehreli via Digitalmars-d
Since I don't have access to Windows, OS X, etc. systems nor have I expertise in them, I don't trust myself to write core.thread tests for anything but Posix. What to do for non-Posix systems? I'm tempted to wrap the entire test code with version(Posix) but it will give the wrong impression

Re: Why is there no std.stream anymore?

2017-12-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, December 11, 2017 22:58:53 Jordi Gutiérrez Hermoso via Digitalmars-d-learn wrote: > On Monday, 11 December 2017 at 21:21:51 UTC, Steven Schveighoffer > > wrote: > > Use the undead repository: > Wow, really? Is the removal of stream from D some kind of error > that hasn't been corrected

Re: Why is there no std.stream anymore?

2017-12-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/11/17 5:58 PM, Jordi Gutiérrez Hermoso wrote: On Monday, 11 December 2017 at 21:21:51 UTC, Steven Schveighoffer wrote: Use the undead repository: Wow, really? Is the removal of stream from D some kind of error that hasn't been corrected yet? No, it was removed because it was

Re: File.byLine for either Windows / Unix newlines

2017-12-11 Thread Dennis via Digitalmars-d-learn
Thanks for your reply, that clears it up. On Monday, 11 December 2017 at 21:13:11 UTC, Steven Schveighoffer wrote: 3. Stop using Windows ;) Haha, if only the rest of the userbase would follow.

Re: is there any plan to support shared libraries in OSX?

2017-12-11 Thread Jacob Carlborg via Digitalmars-d
On 2017-12-10 22:00, Timothee Cour wrote: Is it on the roadmap? It's been a very long standing issue. I don't think it's on the roadmap. Nobody has needed it badly enough to implement it. I could probably give it a shot if someone implements constructors, i.e. __attribute__((constructor)),

Re: Overloading float operators

2017-12-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, December 11, 2017 19:28:47 rumbu via Digitalmars-d-learn wrote: > Is there any way to overload specific floating point operators? > https://dlang.org/spec/expression.html#floating-point-comparisons If those haven't been deprecated yet, they almost certainly will be. It was decided that

Re: Why is there no std.stream anymore?

2017-12-11 Thread Jordi Gutiérrez Hermoso via Digitalmars-d-learn
On Monday, 11 December 2017 at 21:21:51 UTC, Steven Schveighoffer wrote: Use the undead repository: Wow, really? Is the removal of stream from D some kind of error that hasn't been corrected yet?

Re: Adding Markdown to Ddoc

2017-12-11 Thread Jakob Bornecrantz via Digitalmars-d
On Monday, 11 December 2017 at 20:45:38 UTC, Walter Bright wrote: On 12/11/2017 6:22 AM, Jakob Bornecrantz wrote: There are loads of implementations of CommonMark https://github.com/commonmark/CommonMark/wiki/List-of-CommonMark-Implementations They appear to be libraries that offer an

Re: d-apt update

2017-12-11 Thread Manu via Digitalmars-d-announce
I would strongly suggest the rdmd be included in dmd-bin rather than dmd-tools. On 8 December 2017 at 07:53, Jordi Sayol via Digitalmars-d-announce < digitalmars-d-announce@puremagic.com> wrote: > d-apt release dmd v2.077.1 > > In this release, d-apt splits

Re: d-apt update

2017-12-11 Thread TooHuman via Digitalmars-d-announce
On Saturday, 9 December 2017 at 14:57:17 UTC, Jordi Sayol wrote: El 09/12/17 a les 14:32, jmh530 via Digitalmars-d-announce ha escrit: I consider rdmd to be part of the compiler in a way that I don't consider the other dmd-tools... You're right. I'll fix on next dmd release. Jordi Yes,

Re: Adding Markdown to Ddoc

2017-12-11 Thread David Gileadi via Digitalmars-d
On 12/11/17 1:45 PM, Walter Bright wrote: On 12/11/2017 6:22 AM, Jakob Bornecrantz wrote: There are loads of implementations of CommonMark https://github.com/commonmark/CommonMark/wiki/List-of-CommonMark-Implementations They appear to be libraries that offer an implementation. Does the

Re: What's the proper way to use std.getopt?

2017-12-11 Thread Mike Wey via Digitalmars-d-learn
On 11-12-17 21:58, Jordi Gutiérrez Hermoso wrote: but instead, the docstring from getopt is only generated if all arguments are valid, i.e. when it's the least needed because the user already knew what to input. What's the proper style, then? Can someone show me a good example of how to use

Re: Why is there no std.stream anymore?

2017-12-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/11/17 3:51 PM, Jordi Gutiérrez Hermoso wrote: I'd like to read from a file, one byte at a time, without loading the whole file in memory. I was hoping I could do something like    auto f = File("somefile");    foreach(c; f.byChar) {    process(c);    } but there appears to be

Re: File.byLine for either Windows / Unix newlines

2017-12-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/11/17 10:40 AM, Dennis wrote: I'm on Windows and I recently got confused by how Phobos functions handle newlines. ``` void main() {     import std.stdio;     import std.path : buildPath, tempDir;     auto path = buildPath(tempDir(), "test.txt");     auto file = new File(path, "w");

Re: Extending D to support per-class or per-instance user-defined metadata

2017-12-11 Thread Jean-Louis Leroy via Digitalmars-d
I realize that I focused too much on the how, and not enough on the why. By "metadata" I mean the data that is "just there" in any object, in addition to user defined fields. An example of per-class metadata is the pointer to the the virtual function table. It is installed by the compiler

Re: Tuple Array Sorting

2017-12-11 Thread Biotronic via Digitalmars-d-learn
On Monday, 11 December 2017 at 19:46:04 UTC, Vino wrote: import std.algorithm; import std.container.array; import std.file: SpanMode, dirEntries, isDir ; import std.stdio: writefln, writeln; import std.typecons: Tuple, tuple; import std.range: chain; void main () { auto FFs =

What's the proper way to use std.getopt?

2017-12-11 Thread Jordi Gutiérrez Hermoso via Digitalmars-d-learn
I don't quite understand what to do if getopt throws. I would have hoped for something like int arg1; string arg2; auto parser = getopt("opt1", "docstring 1", , "opt2", "docstring 2", ); try { auto opts = parser.parse(args) } except(BadArguments) {

Re: return ref this -dip1000

2017-12-11 Thread vit via Digitalmars-d-learn
On Monday, 11 December 2017 at 20:44:06 UTC, Eugene Wissner wrote: On Monday, 11 December 2017 at 20:40:09 UTC, vit wrote: This code doesn't compile with -dip1000: struct Foo{ int foo; ref int bar(){ return foo; } } Error: returning `this.foo` escapes a reference to

Why is there no std.stream anymore?

2017-12-11 Thread Jordi Gutiérrez Hermoso via Digitalmars-d-learn
I'd like to read from a file, one byte at a time, without loading the whole file in memory. I was hoping I could do something like auto f = File("somefile"); foreach(c; f.byChar) { process(c); } but there appears to be no such way to do it anymore. Instead, the stdlib seems

Re: Adding Markdown to Ddoc

2017-12-11 Thread Walter Bright via Digitalmars-d
On 12/11/2017 6:22 AM, Jakob Bornecrantz wrote: There are loads of implementations of CommonMark https://github.com/commonmark/CommonMark/wiki/List-of-CommonMark-Implementations They appear to be libraries that offer an implementation. Does the Markdown used in github, reddit, wikipedia,

Re: return ref this -dip1000

2017-12-11 Thread Eugene Wissner via Digitalmars-d-learn
On Monday, 11 December 2017 at 20:40:09 UTC, vit wrote: This code doesn't compile with -dip1000: struct Foo{ int foo; ref int bar(){ return foo; } } Error: returning `this.foo` escapes a reference to parameter `this`, perhaps annotate with `return` How can be

return ref this -dip1000

2017-12-11 Thread vit via Digitalmars-d-learn
This code doesn't compile with -dip1000: struct Foo{ int foo; ref int bar(){ return foo; } } Error: returning `this.foo` escapes a reference to parameter `this`, perhaps annotate with `return` How can be annotated this parameter with 'return ref' ?

Re: Adding Markdown to Ddoc

2017-12-11 Thread Walter Bright via Digitalmars-d
On 12/11/2017 11:29 AM, John Gabriele wrote: Right. That said, if you want to add a handful of markdown-ish features, I think it would be most useful to draw your very limited markdown subset from the CommonMark markdown spec. The other option takes you down the road of unintentionally

Re: GSoC 2018 - Your project ideas

2017-12-11 Thread Iain Buclaw via Digitalmars-d-announce
On 11 December 2017 at 21:15, Basile B. via Digitalmars-d-announce wrote: > ## Linux debugger > > I think it's a bad idea. > > 1. because of the 3 months. Would it be usable despite of being an > interesting for the student ? > 2. what will it do better than

Re: GSoC 2018 - Your project ideas

2017-12-11 Thread Basile B. via Digitalmars-d-announce
On Tuesday, 5 December 2017 at 18:20:40 UTC, Seb wrote: Hi all, Google Summer of Code (GSoC) 2018 is about to start soon [1] [...] I am looking forward to hearing (1) what you think can be done in three months by a student and (2) will have a huge impact on the D ecosystem. Cheers, Seb

Extending D to support per-class or per-instance user-defined metadata

2017-12-11 Thread Jean-Louis Leroy via Digitalmars-d
I just had a discussion with Walter, Andrei and Ali about open methods. While Andrei is not a great fan of open methods, he likes the idea of improving D to better support libraries that extend the language - of which my openmethods library is just an example. Andrei, correct me if I

Re: Overloading float operators

2017-12-11 Thread ag0aep6g via Digitalmars-d-learn
On 12/11/2017 08:28 PM, rumbu wrote: Is there any way to overload specific floating point operators? https://dlang.org/spec/expression.html#floating-point-comparisons Those don't seem to work anymore. At least since 2.073, dmd rejects them and says to use std.math.isNaN instead. Looks like

Re: Tuple Array Sorting

2017-12-11 Thread Vino via Digitalmars-d-learn
On Monday, 11 December 2017 at 19:23:40 UTC, Seb wrote: On Monday, 11 December 2017 at 16:15:14 UTC, Vino wrote: On Monday, 11 December 2017 at 15:54:11 UTC, Biotronic wrote: [...] Hi Biotronic, I tried your code with multiple folder's , but no luck the output is not sorted. Program:

[Issue 18058] @nogc and forwarding lazy argument, particularly with scope

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18058 Seb changed: What|Removed |Added CC||greensunn...@gmail.com ---

Re: remake of remake of Konami's Knightmare

2017-12-11 Thread ketmar via Digitalmars-d-announce
major update: entity logic is completely driven by external scripts now! ;-) most of "monsters.d" code moved to MES scripts. also, entity (actor in the terms of the engine) management was completely rewritten, so it mostly doesn't allocate in game loop. "what is MES?", one may ask. ok, MES

Re: Adding Markdown to Ddoc

2017-12-11 Thread John Gabriele via Digitalmars-d
On Monday, 11 December 2017 at 00:54:00 UTC, Walter Bright wrote: Don't get me wrong, I think commonmarkdown is a worthy effort, and is definitely in the running to be a standard. Certainly a lot more effort seems to have been put into it vs other markdowns. Note that CommonMark isn't

Overloading float operators

2017-12-11 Thread rumbu via Digitalmars-d-learn
Is there any way to overload specific floating point operators? https://dlang.org/spec/expression.html#floating-point-comparisons I'm using a decimal data type (a struct) and one of the possible values is NaN, that's why I need these operators. I know also that this also was discussed, but is

Re: Tuple Array Sorting

2017-12-11 Thread Seb via Digitalmars-d-learn
On Monday, 11 December 2017 at 16:15:14 UTC, Vino wrote: On Monday, 11 December 2017 at 15:54:11 UTC, Biotronic wrote: [...] Hi Biotronic, I tried your code with multiple folder's , but no luck the output is not sorted. Program: import std.algorithm: filter, map, sort; import

Re: Adding Markdown to Ddoc

2017-12-11 Thread John Gabriele via Digitalmars-d
On Monday, 11 December 2017 at 15:45:07 UTC, Guillaume Piolat wrote: The CommonMark approach is to just take the union of all possible features and call it a day. Standards without opinions don't deserve to be implemented by anyone. I disagree. If anything, it's more of a subset of features

Re: Post about comparing C, C++ and D performance with a real world project

2017-12-11 Thread German Diago via Digitalmars-d
On Thursday, 7 December 2017 at 14:09:35 UTC, Steven Schveighoffer wrote: On 12/7/17 6:46 AM, Daniel Kozak wrote: Not much helpful, still does not know which compiler flags have been used, or how I can reproduce this. It would be nice to have some shell script which will compile it and run it

D, Dub, and SCons

2017-12-11 Thread Russel Winder via Digitalmars-d
Is anyone out there interested in Dub support for D builds using SCons? If there is, then I have begun to do a bit more work on https://github.com/russel/SCons_D_Experiment and would be pleased to have others helping ready the dub.py tool and it's tests to get into the SCons distribution. --

Re: Adding Markdown to Ddoc

2017-12-11 Thread user1234 via Digitalmars-d
On Monday, 11 December 2017 at 15:45:07 UTC, Guillaume Piolat wrote: On Monday, 11 December 2017 at 14:22:37 UTC, Jakob Bornecrantz wrote: And to add more, CommonMark on the other hand has a full spec written and several test that covers the difficult to get right parts of

Re: D User Survey

2017-12-11 Thread Russel Winder via Digitalmars-d-announce
On Sun, 2017-12-10 at 04:02 -0500, Nick Sabalausky (Abscissa) via Digitalmars-d-announce wrote: > On 12/09/2017 07:58 AM, wobbles wrote: > > On Thursday, 7 December 2017 at 14:31:01 UTC, Chris wrote: > > I didn't know Ireland was so > > > unknown, unless, of course, I'm supposed to choose "Great

[Issue 17984] compile error using DMD v2.077.0-160

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17984 --- Comment #2 from Jonathan Marler --- Ah wait a minute, I updated my druntime repository and the error went away. --

Re: Adding Markdown to Ddoc

2017-12-11 Thread bachmeier via Digitalmars-d
On Monday, 11 December 2017 at 14:22:37 UTC, Jakob Bornecrantz wrote: There are loads of implementations of CommonMark https://github.com/commonmark/CommonMark/wiki/List-of-CommonMark-Implementations the one I have written is not listed. That covers 1 and 2. Also Markdown is not a standard,

[Issue 17984] compile error using DMD v2.077.0-160

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17984 Jonathan Marler changed: What|Removed |Added CC|

Re: Druntime and non-D threads

2017-12-11 Thread Mengu via Digitalmars-d
On Monday, 11 December 2017 at 16:25:42 UTC, Ali Çehreli wrote: On 12/08/2017 02:54 AM, Nemanja Boric wrote: [...] So, in cases where D is just a portable library, the only sane thing to do seems to be what Kagamin suggested: create a D thread and send requests to it. That way, we would

[Issue 18058] @nogc and forwarding lazy argument, particularly with scope

2017-12-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18058 Maksim Fomin changed: What|Removed |Added CC||m...@protonmail.com ---

Re: SDL2 texture blend help

2017-12-11 Thread Dave Jones via Digitalmars-d
On Monday, 11 December 2017 at 04:57:44 UTC, Ivan Trombley wrote: Experimenting with compositing images in SDL2, I get a dark edge around my textures. In the image below, you can see the top example where I composite the cyan image on top of the blue/magenta image looks correct but the bottom

Re: Druntime and non-D threads

2017-12-11 Thread Ali Çehreli via Digitalmars-d
On 12/08/2017 02:54 AM, Nemanja Boric wrote: On Friday, 8 December 2017 at 09:33:03 UTC, Ali Çehreli wrote: 5) We depend on SIGUSR1 (and SIGUSR2, which may not be necessary but it's a different topic) to suspend non-D threads. Does that work with all threads? What if the calling framework has

Re: Tuple Array Sorting

2017-12-11 Thread Vino via Digitalmars-d-learn
On Monday, 11 December 2017 at 15:54:11 UTC, Biotronic wrote: On Monday, 11 December 2017 at 15:33:08 UTC, Vino wrote: On Monday, 11 December 2017 at 15:15:47 UTC, Biotronic wrote: [...] Hi, I tired that but no luck, below is the output, in your code you have one folder "auto folders =

Re: Tuple Array Sorting

2017-12-11 Thread Biotronic via Digitalmars-d-learn
On Monday, 11 December 2017 at 15:33:08 UTC, Vino wrote: On Monday, 11 December 2017 at 15:15:47 UTC, Biotronic wrote: On Monday, 11 December 2017 at 14:52:35 UTC, Vino wrote: Example Program and Output import std.algorithm: filter, map, sort; import std.container.array; import std.file:

  1   2   >