[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14519 --- Comment #13 from Walter Bright bugzi...@digitalmars.com --- Vladimir, you bring up good points. I'll try to address them. First off, why do this? 1. much faster 2. string processing can be @nogc and nothrow. If you follow external discussions

Re: D audio playing and analysis library?

2015-04-29 Thread ponce via Digitalmars-d
On Tuesday, 28 April 2015 at 17:50:48 UTC, Stincky gecko wrote: If you have only a filter it can be batch-processed but if the the filter is plugged to a delay line itself pluged to a SSB frequency shifter whose itself has a feedback bus going to...well it cant be buffered anymore. I see

[Issue 14521] New: Glossary page needs updating

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14521 Issue ID: 14521 Summary: Glossary page needs updating Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1

[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14519 --- Comment #19 from Vladimir Panteleev thecybersha...@gmail.com --- (In reply to Vladimir Panteleev from comment #16) (In reply to Walter Bright from comment #15) It still allocates memory. But it's worth thinking about. Maybe assert()? Sure.

Re: if(arr) now a warning

2015-04-29 Thread via Digitalmars-d
On Wednesday, 29 April 2015 at 04:38:12 UTC, Steven Schveighoffer wrote: FYI, Andrei and Walter are reversing this change barring any new evidence it's helpful to people. Please speak up if you disagree. https://github.com/D-Programming-Language/dmd/pull/2885#issuecomment-97299912 I

[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14519 Marc Schütz schue...@gmx.net changed: What|Removed |Added CC||schue...@gmx.net --- Comment

Re: Quit running foreign unittests _

2015-04-29 Thread Dicebot via Digitalmars-d
On Wednesday, 29 April 2015 at 04:53:47 UTC, Steven Schveighoffer wrote: or rdmd -main -unittest - fail to build because the templated unit test doesn't work on your code. Good luck with that. I will create an upstream PR to fix it, problem solved. Have never had a need to do so though, not

Re: Quit running foreign unittests _

2015-04-29 Thread Dicebot via Digitalmars-d
On Wednesday, 29 April 2015 at 07:44:17 UTC, Kagamin wrote: On Tuesday, 28 April 2015 at 16:40:05 UTC, Dicebot wrote: Those are two points I fundamentally disagree with. It doesn't matter where the code comes from - in the end only thing that matters is correctness of your application as a

[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14519 --- Comment #20 from Vladimir Panteleev thecybersha...@gmail.com --- (In reply to Marc Schütz from comment #18) Data with other (or unknown) encodings needs to be stored in `ubyte[]`. Have you tried using ubyte[] to process ASCII text? It's

Re: Spelling and phonetics (Was: The amazing template which does nothing)

2015-04-29 Thread Chris via Digitalmars-d
On Wednesday, 29 April 2015 at 10:15:52 UTC, Marc Schütz wrote: On Wednesday, 29 April 2015 at 10:09:39 UTC, Chris wrote: On Wednesday, 29 April 2015 at 09:57:01 UTC, Vladimir Panteleev wrote: On Wednesday, 29 April 2015 at 09:44:27 UTC, Chris wrote: Just follow your natural way of speaking

Re: shouldn't this code at least trigger a warning?

2015-04-29 Thread Gary Willoughby via Digitalmars-d-learn
On Wednesday, 29 April 2015 at 06:37:44 UTC, ketmar wrote: subj. the code: void main () { import std.stdio; char ch = '!'; switch (ch) { int n = 42; case '!': writeln(n, : wow!); break; default: } } i think that such abomination should: 1. be forbidden,

[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14519 --- Comment #15 from Walter Bright bugzi...@digitalmars.com --- (In reply to Vladimir Panteleev from comment #14) If I understand correctly, throwing Error instead of Exception will also solve the performance issues It still allocates memory. But

[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14519 --- Comment #16 from Vladimir Panteleev thecybersha...@gmail.com --- (In reply to Walter Bright from comment #15) It still allocates memory. But it's worth thinking about. Maybe assert()? Sure. I did not mean Unicode normalization - it was a

Re: if(arr) now a warning

2015-04-29 Thread Vladimir Panteleev via Digitalmars-d
On Wednesday, 29 April 2015 at 11:07:52 UTC, Marc Schütz wrote: ://github.com/rejectedsoftware/vibe.d/commit/e9e66f4e726db64d15e078dc472606b57783728a#diff-a0c0675933703d01a5d6ad8ebfc097abL79 Are you talking about the last diff in particular? Because I would argue that that one is a poor design

[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14519 --- Comment #17 from Vladimir Panteleev thecybersha...@gmail.com --- Let's see if I understand the situation correctly... let's say we have a chain: str.a.b.c So, str is a UTF-8 string, and a, b and c are range algorithms (they use .front/.popFront

Re: Runtime metaprogramming in D

2015-04-29 Thread Dennis Ritchie via Digitalmars-d-learn
On Wednesday, 29 April 2015 at 02:20:25 UTC, Vladimir Panteleev wrote: On Wednesday, 29 April 2015 at 01:38:17 UTC, Dennis Ritchie wrote: Hi, Is it possible to write self-modifying code in D, who will perform at runtime? Not easily. Just the obvious approach to invoke the compiler and

[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14519 --- Comment #6 from Jonathan M Davis issues.dl...@jmdavisprog.com --- (In reply to Vladimir Panteleev from comment #4) Here's a counter-proposal: when encountering invalid UTF-8, instead of throwing exceptions, throw errors. This will fix the

Re: C++ const expression are not that const after all

2015-04-29 Thread Jacob Carlborg via Digitalmars-d
On 2015-04-29 02:49, Walter Bright wrote: Yes, many times, yes. Report it to bugzilla as a bug. Any code relying on buggy behavior listed in bugzilla is likely to get little sympathy from the D community when it breaks due to a bugfix. The most difficult part is to figure if a weird behavior

[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14519 --- Comment #7 from Vladimir Panteleev thecybersha...@gmail.com --- (In reply to Jonathan M Davis from comment #6) Yikes. That is far worse than throwing Exceptions, since it would kill your program, and it's indicative of a bug in the program

[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14519 --- Comment #9 from Jonathan M Davis issues.dl...@jmdavisprog.com --- Most string-based functions work perfectly well with invalid Unicode. Does find care? Does startsWith? Does filter? The replacement character simply won't match what you're looking

Re: The amazing template which does nothing

2015-04-29 Thread Chris via Digitalmars-d
On Tuesday, 28 April 2015 at 22:29:40 UTC, Steven Schveighoffer wrote: On 4/28/15 6:00 PM, Vladimir Panteleev wrote: On Tuesday, 28 April 2015 at 21:42:04 UTC, Steven Schveighoffer wrote: On 4/27/15 10:36 PM, Vladimir Panteleev wrote:

Re: The amazing template which does nothing

2015-04-29 Thread Vladimir Panteleev via Digitalmars-d
On Wednesday, 29 April 2015 at 06:56:37 UTC, Nikolay wrote: On Tuesday, 28 April 2015 at 02:36:38 UTC, Vladimir Panteleev wrote: http://blog.thecybershadow.net/2015/04/28/the-amazing-template-which-does-nothing/ Thanks for good article little mistake: return from void function: /// Search a

Re: The amazing template which does nothing

2015-04-29 Thread Nikolay via Digitalmars-d
On Tuesday, 28 April 2015 at 02:36:38 UTC, Vladimir Panteleev wrote: http://blog.thecybershadow.net/2015/04/28/the-amazing-template-which-does-nothing/ Thanks for good article little mistake: return from void function: /// Search a website for something, and parse the /// first search

[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14519 --- Comment #5 from Sobirari Muhomori dfj1es...@sneakemail.com --- Or provide a global override similar to assertHandler. --

Re: if(arr) now a warning

2015-04-29 Thread Iain Buclaw via Digitalmars-d
On 29 April 2015 at 06:38, Steven Schveighoffer via Digitalmars-d digitalmars-d@puremagic.com wrote: FYI, Andrei and Walter are reversing this change barring any new evidence it's helpful to people. Please speak up if you disagree.

Re: The amazing template which does nothing

2015-04-29 Thread John Colvin via Digitalmars-d
On Tuesday, 28 April 2015 at 21:19:53 UTC, Vladimir Panteleev wrote: On Tuesday, 28 April 2015 at 10:24:27 UTC, Andrea Fontana wrote: Trying on d.godbolt.com it seems a lot of extra-code is generated for the first version. d.godbolt.com is dead, use asm.dlang.org d.godbolt.org (note .org

Re: The amazing template which does nothing

2015-04-29 Thread Iain Buclaw via Digitalmars-d
On 29 Apr 2015 09:05, John Colvin via Digitalmars-d digitalmars-d@puremagic.com wrote: On Tuesday, 28 April 2015 at 21:19:53 UTC, Vladimir Panteleev wrote: On Tuesday, 28 April 2015 at 10:24:27 UTC, Andrea Fontana wrote: Trying on d.godbolt.com it seems a lot of extra-code is generated for

Re: if(arr) now a warning

2015-04-29 Thread bearophile via Digitalmars-d
Steven Schveighoffer: FYI, Andrei and Walter are reversing this change barring any new evidence it's helpful to people. Please speak up if you disagree. There's no more evidence. It's an improvement, for people coming from Python. The current semantics is not meaningful. One of the points

[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14519 --- Comment #10 from Vladimir Panteleev thecybersha...@gmail.com --- OK, I see from your post that you don't see many of the problems with the replacement character. Let me show you some example problematic situations: 1. Bob wants to update his

Re: Quit running foreign unittests _

2015-04-29 Thread Jacob Carlborg via Digitalmars-d
On 2014-09-10 04:13, Nick Sabalausky wrote: This is getting to be (or rather, *continuing* to be) a royal PITA: https://github.com/rejectedsoftware/vibe.d/issues/673 I don't mean to pick on Vibe.d in particular, but can we have a solution (that doesn't involve obscure corners of druntime, or

Re: if(arr) now a warning

2015-04-29 Thread Andrei Alexandrescu via Digitalmars-d
On 4/28/15 11:03 PM, Steven Schveighoffer wrote: On 4/29/15 1:14 AM, Andrei Alexandrescu wrote: On 4/28/15 9:38 PM, Steven Schveighoffer wrote: FYI, Andrei and Walter are reversing this change barring any new evidence it's helpful to people. Please speak up if you disagree.

Re: Quit running foreign unittests _

2015-04-29 Thread Kagamin via Digitalmars-d
On Tuesday, 28 April 2015 at 16:40:05 UTC, Dicebot wrote: Those are two points I fundamentally disagree with. It doesn't matter where the code comes from - in the end only thing that matters is correctness of your application as a whole. 3rd party libraries are supposed to be tested already,

[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14519 bearophile_h...@eml.cc changed: What|Removed |Added CC||bearophile_h...@eml.cc --- Comment

Re: Calypso: Direct and full interfacing to C++

2015-04-29 Thread Kelly via Digitalmars-d-announce
A small update may be appropriate. We have run into a couple snags this past week when Elie improved the modulemap'ing for C files. Calypso now autodetects modulemap files for libc and POSIX standard headers in the /usr/include directory and /usr/include/x86_64-linux-gnu/sys. This change

Re: shouldn't this code at least trigger a warning?

2015-04-29 Thread via Digitalmars-d-learn
On Wednesday, 29 April 2015 at 06:37:44 UTC, ketmar wrote: subj. the code: void main () { import std.stdio; char ch = '!'; switch (ch) { int n = 42; case '!': writeln(n, : wow!); break; default: } } i think that such abomination should: 1. be forbidden,

[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14519 Jonathan M Davis issues.dl...@jmdavisprog.com changed: What|Removed |Added CC|

shouldn't this code at least trigger a warning?

2015-04-29 Thread ketmar via Digitalmars-d-learn
subj. the code: void main () { import std.stdio; char ch = '!'; switch (ch) { int n = 42; case '!': writeln(n, : wow!); break; default: } } i think that such abomination should: 1. be forbidden, or 2. trigger a warning, or 3. execute initializer anyway.

[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14519 --- Comment #4 from Vladimir Panteleev thecybersha...@gmail.com --- Here's a counter-proposal: when encountering invalid UTF-8, instead of throwing exceptions, throw errors. This will fix the nothrow and performance problems, and will avoid the risk

[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14519 --- Comment #3 from Vladimir Panteleev thecybersha...@gmail.com --- it's hugely annoying when you need to actually process invalid unicode Yeah, and it'll me a lot more than just annoying when you discover too late that your data's been

Re: if(arr) now a warning

2015-04-29 Thread Steven Schveighoffer via Digitalmars-d
On 4/29/15 1:14 AM, Andrei Alexandrescu wrote: On 4/28/15 9:38 PM, Steven Schveighoffer wrote: FYI, Andrei and Walter are reversing this change barring any new evidence it's helpful to people. Please speak up if you disagree.

Re: [dvm] Can't install compilers on Mac

2015-04-29 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-28 19:46, Chris wrote: I keep getting this message. Why? Fetching: http://ftp.digitalmars.com/dmd.2.067.0.zip [] 56256/54884 KB Installing: dmd-2.067.0 An unknown error occurred:

[Issue 14522] New: Postfix array declaration examples should be removed from arrays.html

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14522 Issue ID: 14522 Summary: Postfix array declaration examples should be removed from arrays.html Product: D Version: D2 Hardware: All OS: All Status:

[Issue 14328] The terms lvalue and rvalue should be added to the glossary

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14328 Gary Willoughby d...@nomad.so changed: What|Removed |Added Keywords||pull CC|

[Issue 14522] Postfix array declaration examples should be removed from arrays.html

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14522 Vladimir Panteleev thecybersha...@gmail.com changed: What|Removed |Added CC|

Re: The amazing template which does nothing

2015-04-29 Thread Vladimir Panteleev via Digitalmars-d
On Wednesday, 29 April 2015 at 07:00:15 UTC, John Colvin wrote: On Tuesday, 28 April 2015 at 21:19:53 UTC, Vladimir Panteleev wrote: On Tuesday, 28 April 2015 at 10:24:27 UTC, Andrea Fontana wrote: Trying on d.godbolt.com it seems a lot of extra-code is generated for the first version.

Re: The amazing template which does nothing

2015-04-29 Thread Iain Buclaw via Digitalmars-d
On 29 April 2015 at 14:07, Vladimir Panteleev via Digitalmars-d digitalmars-d@puremagic.com wrote: On Wednesday, 29 April 2015 at 07:00:15 UTC, John Colvin wrote: On Tuesday, 28 April 2015 at 21:19:53 UTC, Vladimir Panteleev wrote: On Tuesday, 28 April 2015 at 10:24:27 UTC, Andrea Fontana

Re: C++ const expression are not that const after all

2015-04-29 Thread Daniel Murphy via Digitalmars-d
Jacob Carlborg wrote in message news:mhq0cq$k3h$1...@digitalmars.com... The most difficult part is to figure if a weird behavior is a bug or not. I don't think I'm the only one that looks at all of the new bugzilla issues. It might take a while, but an invalid bug in bugzilla should get

Re: The amazing template which does nothing

2015-04-29 Thread John Colvin via Digitalmars-d
On Wednesday, 29 April 2015 at 12:07:58 UTC, Vladimir Panteleev wrote: On Wednesday, 29 April 2015 at 07:00:15 UTC, John Colvin wrote: On Tuesday, 28 April 2015 at 21:19:53 UTC, Vladimir Panteleev wrote: On Tuesday, 28 April 2015 at 10:24:27 UTC, Andrea Fontana wrote: Trying on d.godbolt.com

Re: Spelling and phonetics (Was: The amazing template which does nothing)

2015-04-29 Thread via Digitalmars-d
On Wednesday, 29 April 2015 at 10:09:39 UTC, Chris wrote: On Wednesday, 29 April 2015 at 09:57:01 UTC, Vladimir Panteleev wrote: On Wednesday, 29 April 2015 at 09:44:27 UTC, Chris wrote: Just follow your natural way of speaking and you'll be fine. Read it out to yourself. And let's be honest,

Re: The amazing template which does nothing

2015-04-29 Thread Iain Buclaw via Digitalmars-d
On 29 April 2015 at 12:16, John Colvin via Digitalmars-d digitalmars-d@puremagic.com wrote: On Wednesday, 29 April 2015 at 07:49:34 UTC, Iain Buclaw wrote: On 29 Apr 2015 09:05, John Colvin via Digitalmars-d digitalmars-d@puremagic.com wrote: On Tuesday, 28 April 2015 at 21:19:53 UTC,

[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14519 --- Comment #14 from Vladimir Panteleev thecybersha...@gmail.com --- (In reply to Walter Bright from comment #13) Vladimir, you bring up good points. I'll try to address them. First off, why do this? 1. much faster If I understand correctly,

[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14519 --- Comment #11 from Walter Bright bugzi...@digitalmars.com --- https://github.com/D-Programming-Language/druntime/pull/1240 --

[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14519 --- Comment #12 from Walter Bright bugzi...@digitalmars.com --- (In reply to bearophile_hugs from comment #8) Another solution is to deprecate foreach iteration on strings, and require something like foreach(c; mystring.byCharThrowing) and similar

Re: Range of chars (narrow string ranges)

2015-04-29 Thread Chris via Digitalmars-d
On Tuesday, 28 April 2015 at 16:48:48 UTC, Jonathan M Davis wrote: On Tuesday, 28 April 2015 at 09:11:10 UTC, Chris wrote: Would it be much work to show have example code or even an experimental module that gets rid of auto-decoding, so we could see what would be affected in general and how

Re: Spelling and phonetics (Was: The amazing template which does nothing)

2015-04-29 Thread Chris via Digitalmars-d
On Wednesday, 29 April 2015 at 09:57:01 UTC, Vladimir Panteleev wrote: On Wednesday, 29 April 2015 at 09:44:27 UTC, Chris wrote: Just follow your natural way of speaking and you'll be fine. Read it out to yourself. And let's be honest, it sounds really crap when you read an UFCS, bahhh! Yes,

Re: The amazing template which does nothing

2015-04-29 Thread John Colvin via Digitalmars-d
On Wednesday, 29 April 2015 at 07:49:34 UTC, Iain Buclaw wrote: On 29 Apr 2015 09:05, John Colvin via Digitalmars-d digitalmars-d@puremagic.com wrote: On Tuesday, 28 April 2015 at 21:19:53 UTC, Vladimir Panteleev wrote: On Tuesday, 28 April 2015 at 10:24:27 UTC, Andrea Fontana wrote:

Spelling and phonetics (Was: The amazing template which does nothing)

2015-04-29 Thread Vladimir Panteleev via Digitalmars-d
On Wednesday, 29 April 2015 at 09:44:27 UTC, Chris wrote: Just follow your natural way of speaking and you'll be fine. Read it out to yourself. And let's be honest, it sounds really crap when you read an UFCS, bahhh! Yes, well, the problem is that an U sounds completely fine in my head!

[Issue 14470] Reuse of object memory: new emplace overload

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14470 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added CC|

Re: Range of chars (narrow string ranges)

2015-04-29 Thread Chris via Digitalmars-d
On Wednesday, 29 April 2015 at 15:13:15 UTC, Jonathan M Davis wrote: On Wednesday, 29 April 2015 at 10:02:09 UTC, Chris wrote: This sounds like a good starting point for a transition plan. One important thing, though, would be to do some benchmarking with and without autodecoding, to see if it

[Issue 14277] Compile-time array casting error - ugly error report

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14277 --- Comment #4 from Ketmar Dark ket...@ketmar.no-ip.org --- this also ruing things like `typeof(smth).stringof[$-2..$] == []` for example. so it's unusable. --

Re: shouldn't this code at least trigger a warning?

2015-04-29 Thread Ali Çehreli via Digitalmars-d-learn
On 04/29/2015 07:57 AM, H. S. Teoh via Digitalmars-d-learn wrote: Switch statements in D allow all sorts of abominations, if only you would try it. I think it was originally designed to support a particular loop idiom (sorry I forgot what it was called

[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14519 --- Comment #21 from Sobirari Muhomori dfj1es...@sneakemail.com --- (In reply to Vladimir Panteleev from comment #16) Global opt-in for foreach is not feasible. I agree - some libraries will expect one thing, and others another. Libraries don't

Re: Calypso: Direct and full interfacing to C++

2015-04-29 Thread Elie Morisse via Digitalmars-d-announce
On Wednesday, 22 April 2015 at 14:57:43 UTC, Kagamin wrote: What about Qt? I don't remember it being heavily templated. Thanks for the hint, it's definitely true for most of the code of Qt although there are still a few areas like QtCore/qtypetraits.h or Q_STATIC_ASSERT in non-C++11 mode

Re: Calypso: Direct and full interfacing to C++

2015-04-29 Thread Kelly via Digitalmars-d-announce
On Wednesday, 29 April 2015 at 14:45:42 UTC, Kagamin wrote: On Thursday, 23 April 2015 at 08:04:46 UTC, Kelly wrote: I haven't tried Qt yet because it needs to be hand-compiled with a user supplied namespace Aren't there precompiled versions? Kagamin, Yes, the precompiled version was the

Re: [hackathon] An article about metaprogramming

2015-04-29 Thread bearophile via Digitalmars-d
Mafi: https://marfisc.wordpress.com/2015/04/29/using-d-templates-for-gamedev/ What do you think? Any remarks? The SDL_Event is a union. Accessing it is inherently unsafe for type consistency and memory safety. The SDL library mitigates this problem by adding a tag (the member type) which

Re: [hackathon] An article about metaprogramming

2015-04-29 Thread Andrei Alexandrescu via Digitalmars-d
On 4/29/15 8:26 AM, Mafi wrote: Hello there, I took the occasion of the D hackathon to finally write a technical article. I am programming games as a hobby and find the D programming language perfectly suited for this task. So I thought I could write an article about how I use D's capabilities

Re: C++ const expression are not that const after all

2015-04-29 Thread Walter Bright via Digitalmars-d
On 4/29/2015 12:14 AM, Jacob Carlborg wrote: On 2015-04-29 02:49, Walter Bright wrote: Yes, many times, yes. Report it to bugzilla as a bug. Any code relying on buggy behavior listed in bugzilla is likely to get little sympathy from the D community when it breaks due to a bugfix. The most

ldc std.getopt

2015-04-29 Thread Laeeth Isharc via Digitalmars-d-learn
When building the following (reduced by hand - I hope I didn't take out something useful when doing so): import std.stdio; import std.getopt; int main(string[] args) { string apiKey; string startCode; bool reverseOrder=false; bool noReverse=false; auto

Re: Runtime metaprogramming in D

2015-04-29 Thread Ali Çehreli via Digitalmars-d-learn
On 04/28/2015 07:20 PM, Vladimir Panteleev wrote: On Wednesday, 29 April 2015 at 01:38:17 UTC, Dennis Ritchie wrote: Hi, Is it possible to write self-modifying code in D, who will perform at runtime? Not easily. Just the obvious approach to invoke the compiler and run/load the created

Re: if(arr) now a warning

2015-04-29 Thread Andrei Alexandrescu via Digitalmars-d
On 4/29/15 7:05 AM, Marc =?UTF-8?B?U2Now7x0eiI=?= schue...@gmx.net wrote: On Wednesday, 29 April 2015 at 11:28:02 UTC, Vladimir Panteleev wrote: On Wednesday, 29 April 2015 at 11:07:52 UTC, Marc Schütz wrote:

Re: Runtime metaprogramming in D

2015-04-29 Thread Dennis Ritchie via Digitalmars-d-learn
On Wednesday, 29 April 2015 at 17:35:50 UTC, Ali Çehreli wrote: SDC will make D such a language. :) Ali It remains to build SDC in the standard library of the future DDMD :)

Re: Create custom data types

2015-04-29 Thread tcak via Digitalmars-d-learn
On Wednesday, 29 April 2015 at 17:17:07 UTC, Dennis Ritchie wrote: Hi, Is it possible to create simple D user-defined data types without the use of classes and other OOP? For example, in Ada is done as follows: - type balance is new Integer range -32_000 .. 32_000; I think you can use

Re: Create custom data types

2015-04-29 Thread Ali Çehreli via Digitalmars-d-learn
On 04/29/2015 10:17 AM, Dennis Ritchie wrote: Hi, Is it possible to create simple D user-defined data types without the use of classes and other OOP? For example, in Ada is done as follows: - type balance is new Integer range -32_000 .. 32_000; Something similar to the following solution

Re: if(arr) now a warning

2015-04-29 Thread Jonathan M Davis via Digitalmars-d
On Wednesday, 29 April 2015 at 17:35:58 UTC, Andrei Alexandrescu wrote: I have no doubt the change can find certain errors. Problem is false positives. FWIW these are the changes I had to operate on std.allocator to make it work with the new compiler. One per 194 lines on average, all false

Re: C++ const expression are not that const after all

2015-04-29 Thread H. S. Teoh via Digitalmars-d
On Wed, Apr 29, 2015 at 12:06:50PM -0700, Walter Bright via Digitalmars-d wrote: On 4/29/2015 12:14 AM, Jacob Carlborg wrote: On 2015-04-29 02:49, Walter Bright wrote: Yes, many times, yes. Report it to bugzilla as a bug. Any code relying on buggy behavior listed in bugzilla is likely to get

[Issue 14497] Disassembly view

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14497 Rainer Schuetze r.sagita...@gmx.de changed: What|Removed |Added CC||r.sagita...@gmx.de ---

[Issue 14524] New: Right clicking in solution explorer to add folders does not work as expected

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14524 Issue ID: 14524 Summary: Right clicking in solution explorer to add folders does not work as expected Product: D Version: D2 Hardware: x86_64 OS: Windows

Re: Create a case-insensitive startsWith

2015-04-29 Thread PhilipDaniels via Digitalmars-d-learn
On Tuesday, 28 April 2015 at 22:34:07 UTC, Justin Whear wrote: if (startsWith!icmp(a, b) == 0(input, 0x)) if (startsWith!std.uni.icmp(a, b) == 0(input, 0x)) if (startsWith!((a,b) = icmp(a,b) == 0)(input, 0x)) The issue is that those icmp functions take strings as arguments while

Re: Create custom data types

2015-04-29 Thread Dennis Ritchie via Digitalmars-d-learn
On Wednesday, 29 April 2015 at 17:52:27 UTC, Ali Çehreli wrote: On 04/29/2015 10:17 AM, Dennis Ritchie wrote: Hi, Is it possible to create simple D user-defined data types without the use of classes and other OOP? For example, in Ada is done as follows: - type balance is new Integer

[Issue 14523] New: New Windows Application uses incorrect initialization/termination code

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14523 Issue ID: 14523 Summary: New Windows Application uses incorrect initialization/termination code Product: D Version: D2 Hardware: x86_64 OS: Windows

Create custom data types

2015-04-29 Thread Dennis Ritchie via Digitalmars-d-learn
Hi, Is it possible to create simple D user-defined data types without the use of classes and other OOP? For example, in Ada is done as follows: - type balance is new Integer range -32_000 .. 32_000;

Re: C++ interface problem

2015-04-29 Thread extrawurst via Digitalmars-d-learn
On Wednesday, 29 April 2015 at 13:55:46 UTC, Benjamin Thaut wrote: On Monday, 27 April 2015 at 21:19:02 UTC, extrawurst wrote: here is the shortened version of the returned class CSteamID: https://gist.github.com/Extrawurst/936f56ceaa87cf287257 this is the shortened interface (no destructors

Re: C++ const expression are not that const after all

2015-04-29 Thread deadalnix via Digitalmars-d
On Wednesday, 29 April 2015 at 07:14:34 UTC, Jacob Carlborg wrote: On 2015-04-29 02:49, Walter Bright wrote: Yes, many times, yes. Report it to bugzilla as a bug. Any code relying on buggy behavior listed in bugzilla is likely to get little sympathy from the D community when it breaks due to

Re: if(arr) now a warning

2015-04-29 Thread deadalnix via Digitalmars-d
On Wednesday, 29 April 2015 at 04:38:12 UTC, Steven Schveighoffer wrote: FYI, Andrei and Walter are reversing this change barring any new evidence it's helpful to people. Please speak up if you disagree. https://github.com/D-Programming-Language/dmd/pull/2885#issuecomment-97299912 -Steve I

Re: [hackathon] An article about metaprogramming

2015-04-29 Thread Mafi via Digitalmars-d
On Wednesday, 29 April 2015 at 16:55:58 UTC, bearophile wrote: Mafi: https://marfisc.wordpress.com/2015/04/29/using-d-templates-for-gamedev/ What do you think? Any remarks? The SDL_Event is a union. Accessing it is inherently unsafe for type consistency and memory safety. The SDL library

[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14519 --- Comment #22 from Marc Schütz schue...@gmx.net --- (In reply to Vladimir Panteleev from comment #20) (In reply to Marc Schütz from comment #18) Data with other (or unknown) encodings needs to be stored in `ubyte[]`. Have you tried using

[Issue 14215] invalid import in core.sys.linux.stdio

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14215 Joakim db...@joakim.fea.st changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[OT] Visual Studio Code on three platform

2015-04-29 Thread tcak via Digitalmars-d
Microsoft is releasing .NET Core for Linux, Windows, and Mac. http://techcrunch.com/2015/04/29/microsoft-launches-its-net-distribution-for-linux-and-mac/#.jlueia:elZb I cannot find the flexibility of D in C# though, having .NET on every platform will be a big gain for them I think.

OSCON Europe: please make your D submission

2015-04-29 Thread Andrei Alexandrescu via Digitalmars-d-announce
http://www.oscon.com/open-source-eu-2015/public/cfp/385 I encourage people in the D community to consider submitting (I will). DConf speakers might find it easy to submit their DConf talk. Even rejected submissions add value seeing as there is D-related material available. Andrei

Re: [hackathon] An article about metaprogramming

2015-04-29 Thread weaselcat via Digitalmars-d
On Wednesday, 29 April 2015 at 15:26:58 UTC, Mafi wrote: Hello there, I took the occasion of the D hackathon to finally write a technical article. I am programming games as a hobby and find the D programming language perfectly suited for this task. So I thought I could write an article about

stdx.data.json

2015-04-29 Thread Laeeth Isharc via Digitalmars-d-learn
Hi. What's the best way to pass the contents of a file to the stream parser without reading the whole thing into memory first? I get an error if using byLine because the kind of range this function returns is not what the stream parser is expecting. There is an optional filename argument

Re: ldc std.getopt

2015-04-29 Thread Anon via Digitalmars-d-learn
On Wednesday, 29 April 2015 at 19:43:44 UTC, Laeeth Isharc wrote: I get the following errors under LDC (this is LDC beta, but same problem under master) although the code compiles fine under DMD. Am I doing something wrong? The help generating feature of std.getopt is new in 2.067. Use

Re: Create custom data types

2015-04-29 Thread Ali Çehreli via Digitalmars-d-learn
On 04/29/2015 12:53 PM, Dennis Ritchie wrote: On Wednesday, 29 April 2015 at 17:52:27 UTC, Ali Çehreli wrote: It should be easy to make a template of it. (I really think it should already be in Phobos. :) ) Where can I find documentation on this subject? Once a piece of code works for a

Code coverage for D now supported

2015-04-29 Thread Steve Peak via Digitalmars-d-announce
With the help of @ColdenCullen, Codecov now supports D language. You can easily upload your coverage reports and utilize our many features to enhance your workflow. Writing tests for your code is important, no question. The results of your tests is simply pass or fail without proper coverage

String from executeshell

2015-04-29 Thread William Dunne via Digitalmars-d-learn
I'm trying to run this command: wget -O - URL | gpg -d and get the result of the action, but I can't quite work out to do it. currently it looks like: executeShell(escapeShellCommand(wget, -O, -, url, |, gpg, -D)); But I can't work out how to pull the string returned with this. Any help?

Re: [dvm] Can't install compilers on Mac

2015-04-29 Thread Chris via Digitalmars-d-learn
On Wednesday, 29 April 2015 at 06:41:30 UTC, Jacob Carlborg wrote: On 2015-04-28 19:46, Chris wrote: I keep getting this message. Why? Fetching: http://ftp.digitalmars.com/dmd.2.067.0.zip [] 56256/54884 KB Installing: dmd-2.067.0 An unknown error

Re: Possible to write a classic fizzbuzz example using a UFCS chain?

2015-04-29 Thread Atila Neves via Digitalmars-d-learn
On Tuesday, 28 April 2015 at 10:46:54 UTC, Gary Willoughby wrote: After reading the following thread: http://forum.dlang.org/thread/nczgumcdfystcjqyb...@forum.dlang.org I wondered if it was possible to write a classic fizzbuzz[1] example using a UFCS chain? I've tried and failed. [1]:

Re: String from executeshell

2015-04-29 Thread Ali Çehreli via Digitalmars-d-learn
On 04/29/2015 02:05 PM, William Dunne wrote: I'm trying to run this command: wget -O - URL | gpg -d and get the result of the action, but I can't quite work out to do it. currently it looks like: executeShell(escapeShellCommand(wget, -O, -, url, |, gpg, -D)); But I can't work out how to pull

Re: String from executeshell

2015-04-29 Thread Ali Çehreli via Digitalmars-d-learn
On 04/29/2015 02:54 PM, Ali Çehreli wrote: executeShell returns the status and the output as a type Certainly not. The output is an object of a special type, which the documentation refers to as 'auto'. Grrr... :) Ok, maybe it's a Voldemort type. Anyway... Ali

[Issue 14525] New: Cannot access help information from getopt if a required parameter is not given

2015-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14525 Issue ID: 14525 Summary: Cannot access help information from getopt if a required parameter is not given Product: D Version: D2 Hardware: All OS: All

  1   2   >