Re: Blog post : OOP composition with mixins

2015-08-24 Thread Atila Neves via Digitalmars-d-announce
On Monday, 24 August 2015 at 11:10:16 UTC, Dicebot wrote: Rough summary of the talk I have given for recent Berlin D meetup event: https://blog.dicebot.lv/posts/2015/08/OOP_composition_with_mixins Nice. I've only just started exploring code reuse with template mixins, and used it to great

Re: string - null/bool implicit conversion

2015-08-24 Thread Kagamin via Digitalmars-d
On Friday, 21 August 2015 at 20:01:21 UTC, Vladimir Panteleev wrote: This warning almost doesn't break any code! Yes it flipping does. It does break some code, but only in certain extremely specialized contexts like memory allocation! No it's bleeping not. Many of those warnings are probably

Re: associative arrays with manual memory management

2015-08-24 Thread Ilya Yaroshenko via Digitalmars-d
On Saturday, 22 August 2015 at 04:16:30 UTC, Rikki Cattermole wrote: On 8/22/2015 5:20 AM, Ilya Yaroshenko wrote: Hi All! I am going to implement associative arrays with manual memory management based on amazing std.experimental.allocator by Andrei

associative arrays with manual memory management

2015-08-24 Thread Ilya Yaroshenko via Digitalmars-d-announce
http://code.dlang.org/packages/aammm/~master # aammm Associative arrays with manual memory management All enries and buckets would be dealocated and disposed by internal implementation's destructor. The destructor is called by garbage collector (by default). Example ```D

Re: dmd codegen improvements

2015-08-24 Thread jmh530 via Digitalmars-d
On Monday, 24 August 2015 at 08:59:57 UTC, ixid wrote: One of D's potential massive wins is speed and I think that has the most easily conveyed impacted on the audience. If we had the best benchmark site for a very large range of languages it would not only draw people here but drive the

Re: [OT] Sharp Regrets: Top 10 Worst C# Features

2015-08-24 Thread renoX via Digitalmars-d
On Thursday, 20 August 2015 at 16:22:22 UTC, Jonathan M Davis wrote: I really don't mind NaN. Well with silent NaN you have 'x == x' is false which means all the generic algorithms (silently) fail. It really doesn't cause problems normally. The problem with floating point values is

Re: string - null/bool implicit conversion

2015-08-24 Thread Kagamin via Digitalmars-d
On Saturday, 22 August 2015 at 21:23:19 UTC, Timon Gehr wrote: For the comma operator, I think it's pretty clear that the usage of ',' to separate components of a tuple would be more useful. Why not use C/C++/C# initializer syntax? Technically it's a tuple, but not related to comma operator.

Re: [OT] Sharp Regrets: Top 10 Worst C# Features

2015-08-24 Thread Shachar Shemesh via Digitalmars-d
On 19/08/15 15:01, Kagamin wrote: Just switch your editor to RTL mode, haha. OT: (so this is an off topic reply to an off topic thread) I actually tried to write a good RTL text editor (you can see the half baked result at http://bidiedit.lingnu.com). I know your comment was meant as a

Re: string - null/bool implicit conversion

2015-08-24 Thread Kagamin via Digitalmars-d
On Friday, 21 August 2015 at 11:34:42 UTC, Marc Schütz wrote: On Thursday, 20 August 2015 at 19:41:44 UTC, Jonathan M Davis wrote: On Thursday, 20 August 2015 at 17:50:11 UTC, Steven Schveighoffer wrote: if(arr != null) Definitely don't do that. IMHO, == null and != null should be illegal.

[Issue 14929] [REG2.067] ICE: Assertion failure: 'ez-exp ez-exp-op == TOKconstruct' on line 302 in file 'escape.c'

2015-08-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14929 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/3e3fdfe12e49815f3a78659266b2a5aad737ec79 fix Issue 14929 - ICE:

Re: Ranges - Question about desing choices

2015-08-24 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 24 August 2015 at 15:09:14 UTC, Michal Minich wrote: What are the advantages of current design. One advantage of the current design is you can statically determine if something is an infinite range by seeing if empty is a constant false. With your change, you could never be sure

Ranges - Question about desing choices

2015-08-24 Thread Michal Minich via Digitalmars-d-learn
I'm thinking about ranges I can think of similar design of the input range, but with different pros and cons. Obviously not for/in D. Currently ranges has 3 primitive operations, and they can be translated from foreach like: for (auto __r = range; !__r.empty; __r.popFront()) { auto e =

[Issue 14929] [REG2.067] ICE: Assertion failure: 'ez-exp ez-exp-op == TOKconstruct' on line 302 in file 'escape.c'

2015-08-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14929 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

Re: Ranges - Question about desing choices

2015-08-24 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Aug 24, 2015 at 03:16:10PM +, Adam D. Ruppe via Digitalmars-d-learn wrote: On Monday, 24 August 2015 at 15:09:14 UTC, Michal Minich wrote: What are the advantages of current design. One advantage of the current design is you can statically determine if something is an infinite

C++/STL interop

2015-08-24 Thread anonymous via Digitalmars-d-learn
I saw https://issues.dlang.org/show_bug.cgi?id=14956 . questions: - is std.basic_string released into the wild? - where do I find std.basic_string? - does std.vector exist? That would allow me to get rid of some C++ clue code (build an C-like interface, copy data etc)... Putting extern(C++)

Re: dmd codegen improvements

2015-08-24 Thread ixid via Digitalmars-d
On Monday, 24 August 2015 at 15:03:48 UTC, Isaac Gouy wrote: On Monday, 24 August 2015 at 08:59:57 UTC, ixid wrote: -snip- People love competitions, the current benchmark site that seems to weirdly dislike D is one of people's go to references. I do not have the ability to do this but it would

[Issue 14955] New: [D1] Add module profiling feature

2015-08-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14955 Issue ID: 14955 Summary: [D1] Add module profiling feature Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority:

Re: associative arrays with manual memory management

2015-08-24 Thread extrawurst via Digitalmars-d-announce
On Monday, 24 August 2015 at 12:01:52 UTC, Ilya Yaroshenko wrote: http://code.dlang.org/packages/aammm/~master # aammm Associative arrays with manual memory management [...] Awesome, I was waiting for something like that. Thank you!

Re: Digger 2.3 verstr.h problem

2015-08-24 Thread Vladimir Panteleev via Digitalmars-d-learn
On Monday, 24 August 2015 at 09:18:14 UTC, Robert M. Münch wrote: On 2015-08-23 20:13:38 +, Vladimir Panteleev said: Not really sure what's going on there... If I could reproduce it, I'd try building DMD manually - if it still occurred, build DMD 2.067.1 from source and add debugging

Re: dmd codegen improvements

2015-08-24 Thread Isaac Gouy via Digitalmars-d
On Monday, 24 August 2015 at 08:59:57 UTC, ixid wrote: -snip- People love competitions, the current benchmark site that seems to weirdly dislike D is one of people's go to references. I do not have the ability to do this but it would seem like an excellent project for someone outside the major

[Issue 14956] New: C++ Mangling incompatible with C++11

2015-08-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14956 Issue ID: 14956 Summary: C++ Mangling incompatible with C++11 Product: D Version: D2 Hardware: All OS: Linux Status: NEW Severity: blocker Priority:

Re: dmd codegen improvements

2015-08-24 Thread ixid via Digitalmars-d
On Monday, 24 August 2015 at 13:45:58 UTC, jmh530 wrote: You mean this site? http://benchmarksgame.alioth.debian.org/ Yes, precisely that but try to one up it with more challenges.

Re: order of declaration/definition

2015-08-24 Thread via Digitalmars-d-learn
On Monday, 24 August 2015 at 01:01:13 UTC, John Colvin wrote: enum A = 1; enum B = C; //Error static if(A) enum C = 0; enum D = C; //OK Is order supposed to matter here? No.

Re: DDT 0.13.0 released - DUB configurations support.

2015-08-24 Thread Bruno Medeiros via Digitalmars-d-announce
On 11/08/2015 18:03, Bruno Medeiros wrote: A new DDT release (nicknamed Candy Kingdom ) is out, please read the changelog: https://github.com/bruno-medeiros/DDT/releases/tag/Release_0.13.0 This is Release Candidate quality, there might be a few undiscovered bugs with the recently introduced

This Week in D summarizes those long threads for you!

2015-08-24 Thread Adam D. Ruppe via Digitalmars-d-announce
I haven't posted these to the announce forum for a while, but they still come out each week! If you aren't subscribed yet, there's an rss link on the page or you can follow me on Twitter, where I post most of them: https://twitter.com/adamdruppe This Week in D has the argument over

Re: Blog post : OOP composition with mixins

2015-08-24 Thread Dejan Lekic via Digitalmars-d-announce
Good article. However, composition also has some drawbacks and they should be explained. Speaking about Java and inheritance, and popular believe it is overused - Yes, maybe it is, but Java does not have language features D has, and it should not be blamed for that. Interesting article for

[Issue 14957] New: order of declaration at global scope

2015-08-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14957 Issue ID: 14957 Summary: order of declaration at global scope Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: major Priority: P1

[Issue 14958] New: Casting a double to ulong sometimes produces wrong results

2015-08-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14958 Issue ID: 14958 Summary: Casting a double to ulong sometimes produces wrong results Product: D Version: D2 Hardware: All OS: Windows Status: NEW

Re: Ranges - Question about desing choices

2015-08-24 Thread Michal Minich via Digitalmars-d-learn
On Monday, 24 August 2015 at 15:16:12 UTC, Adam D. Ruppe wrote: One advantage of the current design is you can statically determine if something is an infinite range by seeing if empty is a constant false. That is important aspect! By having this information at compile or runtime, you can

Re: Ranges - Question about desing choices

2015-08-24 Thread Michal Minich via Digitalmars-d-learn
On Monday, 24 August 2015 at 15:23:09 UTC, H. S. Teoh wrote: It's also useful in parsing algorithms to look at the current item in the input without also consuming it. I design I outlined the 'front' property could still be called multiple times. It is the 'empty' property that would be

[Issue 14959] Regression in HEAD: linker error on printing SysTime with writeln

2015-08-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14959 --- Comment #1 from Jack Stouffer j...@jackstouffer.com --- Oops, should have been writeln(d1); --

Re: Casting double to ulong weirdness

2015-08-24 Thread anonymous via Digitalmars-d
On Monday 24 August 2015 18:52, wrote: import std.stdio; void main() { double x = 1.2; writeln(cast(ulong)(x * 10.0)); double y = 1.2 * 10.0; writeln(cast(ulong)y); } Output: 11 12 to!ulong instead of the cast does the right thing, and is a viable work-around.

Re: Casting double to ulong weirdness

2015-08-24 Thread bachmeier via Digitalmars-d
On Monday, 24 August 2015 at 16:52:54 UTC, Márcio Martins wrote: I'm posting this here for visibility. This was silently corrupting our data, and might be doing the same for others as well. import std.stdio; void main() { double x = 1.2; writeln(cast(ulong)(x * 10.0)); double y = 1.2 *

Casting double to ulong weirdness

2015-08-24 Thread via Digitalmars-d
I'm posting this here for visibility. This was silently corrupting our data, and might be doing the same for others as well. import std.stdio; void main() { double x = 1.2; writeln(cast(ulong)(x * 10.0)); double y = 1.2 * 10.0; writeln(cast(ulong)y); } Output: 11 12 to!ulong instead

Re: Ranges - Question about desing choices

2015-08-24 Thread Michal Minich via Digitalmars-d-learn
Looking at the random access range, if the indexing must be done just by numeric value, or also by other type, like string (typically used for dictionaries) or also custom object?

Sub forum for dmd implementation details

2015-08-24 Thread Benjamin Thaut via Digitalmars-d
As a occasional contributor to dmd I usually manage to get everything working the way I want by digging through the dmd source code long enough, but sometimes bad / non-existing documentation and missing knowdelge result in suboptimal solutions or unsolved problems. I would greatly appreciate

Re: Ranges - Question about desing choices

2015-08-24 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/24/15 11:09 AM, Michal Minich wrote: I'm thinking about ranges I can think of similar design of the input range, but with different pros and cons. Obviously not for/in D. Currently ranges has 3 primitive operations, and they can be translated from foreach like: for (auto __r = range;

[Issue 14958] Casting a double to ulong sometimes produces wrong results

2015-08-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14958 Steven Schveighoffer schvei...@yahoo.com changed: What|Removed |Added Status|NEW |RESOLVED

Re: Ranges - Question about desing choices

2015-08-24 Thread Michal Minich via Digitalmars-d-learn
On Monday, 24 August 2015 at 17:17:16 UTC, Steven Schveighoffer wrote: 3) it is not possible to ask a range if it's empty more times per iteration of one item This isn't very composable. If I call a function that consumes some number of items from a range, that function needs to forward the

[Issue 14959] New: Regression in HEAD: linker error on printing SysTime with writeln

2015-08-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14959 Issue ID: 14959 Summary: Regression in HEAD: linker error on printing SysTime with writeln Product: D Version: D2 Hardware: x86 OS: Mac OS X Status:

Re: dmd codegen improvements

2015-08-24 Thread Isaac Gouy via Digitalmars-d
On Monday, 24 August 2015 at 15:36:42 UTC, ixid wrote: -snip- Yes, it requires someone to pick up the baton for what is clearly a very significant task. Your site is excellent and it's very unfortunate that D is absent. iirc I asked Peter Alexander about progress last December and he had

Re: Sub forum for dmd implementation details

2015-08-24 Thread Steven Schveighoffer via Digitalmars-d
On 8/24/15 1:00 PM, Benjamin Thaut wrote: As a occasional contributor to dmd I usually manage to get everything working the way I want by digging through the dmd source code long enough, but sometimes bad / non-existing documentation and missing knowdelge result in suboptimal solutions or

Re: Casting double to ulong weirdness

2015-08-24 Thread Steven Schveighoffer via Digitalmars-d
On 8/24/15 12:52 PM, =?UTF-8?B?Ik3DoXJjaW8=?= Martins\ marcio...@gmail.com\ wrote: I'm posting this here for visibility. This was silently corrupting our data, and might be doing the same for others as well. import std.stdio; void main() { double x = 1.2; writeln(cast(ulong)(x * 10.0));

Re: Casting double to ulong weirdness

2015-08-24 Thread via Digitalmars-d
On Monday, 24 August 2015 at 17:26:12 UTC, Steven Schveighoffer wrote: On 8/24/15 12:52 PM, =?UTF-8?B?Ik3DoXJjaW8=?= Martins\ marcio...@gmail.com\ wrote: I'm posting this here for visibility. This was silently corrupting our data, and might be doing the same for others as well. import

Re: Casting double to ulong weirdness

2015-08-24 Thread rumbu via Digitalmars-d
On Monday, 24 August 2015 at 17:26:12 UTC, Steven Schveighoffer wrote: Note, this is NOT a D problem, this is a problem with floating ponit. And by problem, I mean feature-that-you-should-avoid :) -Steve Visual C++ 19.00.23026, x86, x64: int _tmain(int argc, _TCHAR* argv[]) {

Re: Casting double to ulong weirdness

2015-08-24 Thread rumbu via Digitalmars-d
BTW, 1.2 and 12.0 are directly representable as double In C++: printf(%.20f\r\n, 1.2); printf(%.20f\r\n, 12.0); will output: 1.2000 12. Either upcasting to real is the wrong decision here, either the writeln string conversion is wrong.

Re: Casting double to ulong weirdness

2015-08-24 Thread Warwick via Digitalmars-d
On Monday, 24 August 2015 at 18:16:44 UTC, Justin Whear wrote: On Mon, 24 Aug 2015 18:06:07 +, rumbu wrote: BTW, 1.2 and 12.0 are directly representable as double In C++: printf(%.20f\r\n, 1.2); printf(%.20f\r\n, 12.0); will output: 1.2000 12.

Re: most elegant functional way to make a histogram

2015-08-24 Thread Laeeth Isharc via Digitalmars-d-learn
On Monday, 24 August 2015 at 09:50:41 UTC, yawniek wrote: On Friday, 21 August 2015 at 21:08:25 UTC, Laeeth Isharc wrote: I guess this kind of thing will do: upRangeHighs.each!((ref a)=(++histogram[a][0])); int[] arr = [5,1,2,2,3,4,5,5,5]; int[int] histo; arr.each!( a =

Moving forward with work on the D language and foundation

2015-08-24 Thread Andrei Alexandrescu via Digitalmars-d-announce
Hello everyone, Following an increasing desire to focus on working on the D language and foundation, I have recently made the difficult decision to part ways with Facebook, my employer of five years and nine months. Facebook has impacted my career and life very positively, and I am

Re: Casting double to ulong weirdness

2015-08-24 Thread Justin Whear via Digitalmars-d
On Mon, 24 Aug 2015 18:06:07 +, rumbu wrote: BTW, 1.2 and 12.0 are directly representable as double In C++: printf(%.20f\r\n, 1.2); printf(%.20f\r\n, 12.0); will output: 1.2000 12. Either upcasting to real is the wrong decision here, either

Re: Casting double to ulong weirdness

2015-08-24 Thread Ali Çehreli via Digitalmars-d
On 08/24/2015 11:06 AM, rumbu wrote: BTW, 1.2 and 12.0 are directly representable as double 12 is but 1.2 is not. In C++: printf(%.20f\r\n, 1.2); printf(%.20f\r\n, 12.0); will output: 1.2000 12. Either upcasting to real is the wrong decision

Re: Casting double to ulong weirdness

2015-08-24 Thread John Colvin via Digitalmars-d
On Monday, 24 August 2015 at 18:06:08 UTC, rumbu wrote: BTW, 1.2 and 12.0 are directly representable as double 12.0 is representable, but I'm pretty sure, if you work it out, 1.2 isn't.

Re: Casting double to ulong weirdness

2015-08-24 Thread Steven Schveighoffer via Digitalmars-d
On 8/24/15 2:06 PM, rumbu wrote: BTW, 1.2 and 12.0 are directly representable as double In C++: printf(%.20f\r\n, 1.2); printf(%.20f\r\n, 12.0); will output: 1.2000 12. Either upcasting to real is the wrong decision here, either the writeln string

Re: Moving forward with work on the D language and foundation

2015-08-24 Thread Rory McGuire via Digitalmars-d-announce
That is fricken' awesome. Interesting times ahead, for you, and for us as a community. On Mon, Aug 24, 2015 at 8:42 PM, Andrei Alexandrescu via Digitalmars-d-announce digitalmars-d-announce@puremagic.com wrote: Hello everyone, Following an increasing desire to focus on working on the D

Re: Casting double to ulong weirdness

2015-08-24 Thread Steven Schveighoffer via Digitalmars-d
On 8/24/15 2:38 PM, Steven Schveighoffer wrote: On 8/24/15 2:06 PM, rumbu wrote: BTW, 1.2 and 12.0 are directly representable as double In C++: printf(%.20f\r\n, 1.2); printf(%.20f\r\n, 12.0); will output: 1.2000 12. Either upcasting to real is the wrong

[Issue 14958] Casting a double to ulong sometimes produces wrong results

2015-08-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14958 Steven Schveighoffer schvei...@yahoo.com changed: What|Removed |Added Status|RESOLVED|REOPENED

Re: Moving forward with work on the D language and foundation

2015-08-24 Thread Joseph Cassman via Digitalmars-d-announce
On Monday, 24 August 2015 at 18:43:01 UTC, Andrei Alexandrescu wrote: Hello everyone, Following an increasing desire to focus on working on the D language and foundation, I have recently made the difficult decision to part ways with Facebook, my employer of five years and nine months.

Re: Casting double to ulong weirdness

2015-08-24 Thread bachmeier via Digitalmars-d
On Monday, 24 August 2015 at 18:59:58 UTC, Steven Schveighoffer wrote: All this gets down to: FP cannot accurately represent decimal. Should this be fixed? Can it be fixed? I don't know. But I would be very cautious about converting anything FP to integers without some epsilon. -Steve I

Re: Casting double to ulong weirdness

2015-08-24 Thread H. S. Teoh via Digitalmars-d
On Mon, Aug 24, 2015 at 07:15:43PM +, bachmeier via Digitalmars-d wrote: On Monday, 24 August 2015 at 18:59:58 UTC, Steven Schveighoffer wrote: All this gets down to: FP cannot accurately represent decimal. Should this be fixed? Can it be fixed? I don't know. But I would be very cautious

A better way than foreach with this?

2015-08-24 Thread Joel via Digitalmars-d-learn
auto names = Alef Bet Gimel Dalet He Vav Zayen Het Tet Yod Final_Kaf Kaf Lamed Final_Mem Mem Final_Nun Nun Samekh Ayin Final_Pe Pe Final_Tsadi Tsadi Qof Resh Shin Tav.split; foreach (ref name; names)

Re: A better way than foreach with this?

2015-08-24 Thread ted via Digitalmars-d-learn
try: auto names1 = names.map!( a = replace(a, _, )); ...not sure how to do it in-place though. Joel wrote: auto names = Alef Bet Gimel Dalet He Vav Zayen Het Tet Yod Final_Kaf Kaf Lamed Final_Mem Mem Final_Nun Nun Samekh Ayin Final_Pe Pe Final_Tsadi Tsadi Qof Resh Shin Tav.split;

Re: Ruby 3.0 to have immutable strings by default / C++ heading towards generic all the time.

2015-08-24 Thread Jonathan M Davis via Digitalmars-d
On Monday, 24 August 2015 at 06:17:06 UTC, Jacob Carlborg wrote: On 2015-08-21 23:55, Walter Bright wrote: I don't understand why the C++ committee, in its quest to improve the language, has not pushed forward with proper replacements for typical preprocessor uses, with the intent of

Re: D-Day for DMD is today!

2015-08-24 Thread via Digitalmars-d-announce
On Sunday, 23 August 2015 at 05:17:33 UTC, Walter Bright wrote: https://github.com/D-Programming-Language/dmd/pull/4923 We have made the switch from C++ DMD to D DMD! Wow! I'll spread the Word!

Re: Ruby 3.0 to have immutable strings by default / C++ heading towards generic all the time.

2015-08-24 Thread Jacob Carlborg via Digitalmars-d
On 2015-08-24 08:35, rsw0x wrote: implement this in D https://github.com/solodon4/Mach7 It's just a matter of syntax. -- /Jacob Carlborg

Re: DWT fails to build with DMD 2.068.0

2015-08-24 Thread Mike James via Digitalmars-d-dwt
On Tuesday, 11 August 2015 at 21:03:23 UTC, Jacob Carlborg wrote: On 2015-08-11 10:23, Mike James wrote: Is there an updated release for DWT - it fails to build with the latest version of DMD - mainly casting errors... There's an open pull request for adding support for 2.068.0. I'll take

Re: D-Day for DMD is today!

2015-08-24 Thread Jonas Drewsen via Digitalmars-d-announce
On Sunday, 23 August 2015 at 05:17:33 UTC, Walter Bright wrote: https://github.com/D-Programming-Language/dmd/pull/4923 We have made the switch from C++ DMD to D DMD! Many, many thanks to Daniel Murphy for slaving away for 2.5 years to make this happen. More thanks to Martin Nowak for

front-page examples not working

2015-08-24 Thread Øivind
I love the new examples on the front-page, but when I click the run button, I get this error: /d982/f573.d(32): Error: undefined identifier centerJustifier I got a different error on one of the other new examples yesterday. Please make sure these work. They are a great showcase of the

Re: front-page examples not working

2015-08-24 Thread BBasile via Digitalmars-d
On Monday, 24 August 2015 at 07:27:29 UTC, Øivind wrote: I love the new examples on the front-page, but when I click the run button, I get this error: /d982/f573.d(32): Error: undefined identifier centerJustifier I got a different error on one of the other new examples yesterday. Please make

Re: A better way than foreach with this?

2015-08-24 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-08-24 07:58, Joel wrote: auto names = Alef Bet Gimel Dalet He Vav Zayen Het Tet Yod Final_Kaf Kaf Lamed Final_Mem Mem Final_Nun Nun Samekh Ayin Final_Pe Pe Final_Tsadi Tsadi Qof Resh Shin Tav.split; foreach (ref name; names)

Re: (De)Serializing interfaces

2015-08-24 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-08-22 21:14, nims wrote: Using Orange all I got was a lot of compiler errors. Seems I completely overlooked interfaces. I'll see if I can add support for them. -- /Jacob Carlborg

Re: Ruby 3.0 to have immutable strings by default / C++ heading towards generic all the time.

2015-08-24 Thread Jacob Carlborg via Digitalmars-d
On 2015-08-21 23:55, Walter Bright wrote: I don't understand why the C++ committee, in its quest to improve the language, has not pushed forward with proper replacements for typical preprocessor uses, with the intent of eventually deprecating it entirely. With modules being already implemented

Re: D-Day for DMD is today!

2015-08-24 Thread Dmitry Olshansky via Digitalmars-d-announce
On 23-Aug-2015 08:17, Walter Bright wrote: https://github.com/D-Programming-Language/dmd/pull/4923 We have made the switch from C++ DMD to D DMD! Many, many thanks to Daniel Murphy for slaving away for 2.5 years to make this happen. More thanks to Martin Nowak for helping shepherd it through

Re: std.data.json formal review

2015-08-24 Thread Jacob Carlborg via Digitalmars-d
On 2015-08-21 18:25, Nick Sabalausky wrote: Module boundaries should be determined by organizational grouping, not by size. Well, but it depends on how you decide what should be in a group. Size is usually a part of that decision, although it might not be conscious. You wouldn't but the

Re: Ruby 3.0 to have immutable strings by default / C++ heading towards generic all the time.

2015-08-24 Thread Dmitry Olshansky via Digitalmars-d
On 24-Aug-2015 09:17, Jacob Carlborg wrote: On 2015-08-21 23:55, Walter Bright wrote: I don't understand why the C++ committee, in its quest to improve the language, has not pushed forward with proper replacements for typical preprocessor uses, with the intent of eventually deprecating it

Re: Trying to compile weather program

2015-08-24 Thread Yazan D via Digitalmars-d-learn
On Sun, 23 Aug 2015 16:00:16 +, Tony wrote: Thanks for the replies. It compiles OK with just. However, it isn't linking: /usr/bin/ld: cannot find -lcurl I do have some versions of libcurl on my system: /usr/lib/x86_64-linux-gnu/libcurl.so.3

Re: Object.factory() and exe file size bloat

2015-08-24 Thread Jacob Carlborg via Digitalmars-d
On 2015-08-21 22:26, Walter Bright wrote: The principle often used by languages (C, C++, Rust) is you only pay for what you use. With Object.factory, every program pays for it with every class, despite very few actual uses of it. A always thought of D as a bit more convenient language.

Re: Ruby 3.0 to have immutable strings by default / C++ heading towards generic all the time.

2015-08-24 Thread Walter Bright via Digitalmars-d
On 8/23/2015 11:40 PM, Jonathan M Davis wrote: To really replace macros - especially in a language that's already using them - you pretty much have to replace every use case for them, and I really don't see that happening to C++. Also, getting rid of macros would break C compatibility, which

Re: A better way than foreach with this?

2015-08-24 Thread Joel via Digitalmars-d-learn
On Monday, 24 August 2015 at 06:13:50 UTC, Jacob Carlborg wrote: On 2015-08-24 07:58, Joel wrote: auto names = Alef Bet Gimel Dalet He Vav Zayen Het Tet Yod Final_Kaf Kaf Lamed Final_Mem Mem Final_Nun Nun Samekh Ayin Final_Pe Pe Final_Tsadi Tsadi

Re: D-Day for DMD is today!

2015-08-24 Thread Nordlöw
On Sunday, 23 August 2015 at 05:17:33 UTC, Walter Bright wrote: https://github.com/D-Programming-Language/dmd/pull/4923 We have made the switch from C++ DMD to D DMD! Worth mentioning: The final call to dmd that compiles 117 klines (~80 files) of D code in one show and links dmd takes 1.1

[Issue 14954] New: extern opaque struct instance doesn't compile

2015-08-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14954 Issue ID: 14954 Summary: extern opaque struct instance doesn't compile Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal

Re: extern opaque struct

2015-08-24 Thread John Colvin via Digitalmars-d
On Monday, 24 August 2015 at 04:08:28 UTC, Daniel Murphy wrote: John Colvin wrote in message news:uhpgjffttsuqeswyj...@forum.dlang.org... Let's say I have some C headers that have code like this in: extern struct UndeclaredStruct blah; Undeclared *p = blah; which would naïvely translate to

Re: Digger 2.3 verstr.h problem

2015-08-24 Thread John Colvin via Digitalmars-d-learn
On Monday, 24 August 2015 at 09:13:56 UTC, Robert M. Münch wrote: On 2015-08-23 16:23:57 +, John Colvin said: almost certainly a consequence of the recent switchover to the dmd frontend being written in D. Have you tried building the latest Digger git HEAD first? If that doesn't work I

Re: Ruby 3.0 to have immutable strings by default / C++ heading towards generic all the time.

2015-08-24 Thread rsw0x via Digitalmars-d
On Monday, 24 August 2015 at 06:17:06 UTC, Jacob Carlborg wrote: On 2015-08-21 23:55, Walter Bright wrote: I don't understand why the C++ committee, in its quest to improve the language, has not pushed forward with proper replacements for typical preprocessor uses, with the intent of

Re: Object.factory() and exe file size bloat

2015-08-24 Thread Jacob Carlborg via Digitalmars-d
On 2015-08-21 07:06, Walter Bright wrote: This function: http://dlang.org/phobos/object.html#.Object.factory enables a program to instantiate any class defined in the program. To make it work, though, every class in the program has to have a TypeInfo generated for it. This leads to bloat:

Re: A better way than foreach with this?

2015-08-24 Thread Joel via Digitalmars-d-learn
On Monday, 24 August 2015 at 06:17:02 UTC, ted wrote: try: auto names1 = names.map!( a = replace(a, _, )); ...not sure how to do it in-place though. Joel wrote: auto names = Alef Bet Gimel Dalet He Vav Zayen Het Tet Yod Final_Kaf Kaf Lamed Final_Mem Mem Final_Nun Nun Samekh Ayin Final_Pe

[Issue 14953] New: std.concurrency: Add function to flush message box

2015-08-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14953 Issue ID: 14953 Summary: std.concurrency: Add function to flush message box Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement

Re: flush MessageBox

2015-08-24 Thread Chris via Digitalmars-d-learn
On Friday, 21 August 2015 at 17:05:56 UTC, John Colvin wrote: On Friday, 21 August 2015 at 14:35:53 UTC, Chris wrote: On Friday, 21 August 2015 at 12:59:09 UTC, John Colvin wrote: [...] Wouldn't it be easier to have a library function that can empty the mailbox immediately? It's a waste of

Re: most elegant functional way to make a histogram

2015-08-24 Thread yawniek via Digitalmars-d-learn
On Friday, 21 August 2015 at 21:08:25 UTC, Laeeth Isharc wrote: I guess this kind of thing will do: upRangeHighs.each!((ref a)=(++histogram[a][0])); int[] arr = [5,1,2,2,3,4,5,5,5]; int[int] histo; arr.each!( a = ++histo[a] ); writeln(histo); this works

Re: [OT] Sharp Regrets: Top 10 Worst C# Features

2015-08-24 Thread Chris via Digitalmars-d
On Friday, 21 August 2015 at 19:58:04 UTC, Tobias Müller wrote: Chris wend...@tcd.ie wrote: [...] As if most people were too stpid to grasp the concept that `x++` is the same as `x += 1` (which is intellectually as 'challenging' as `x++`, by the way). Because it's not. ++x is the same

Re: dmd codegen improvements

2015-08-24 Thread ixid via Digitalmars-d
On Tuesday, 18 August 2015 at 10:45:49 UTC, Walter Bright wrote: Martin ran some benchmarks recently that showed that ddmd compiled with dmd was about 30% slower than when compiled with gdc/ldc. This seems to be fairly typical. I'm interested in ways to reduce that gap. One of D's potential

Re: Digger 2.3 verstr.h problem

2015-08-24 Thread Robert M. Münch via Digitalmars-d-learn
On 2015-08-23 16:23:57 +, John Colvin said: almost certainly a consequence of the recent switchover to the dmd frontend being written in D. Have you tried building the latest Digger git HEAD first? If that doesn't work I suggest reporting it here for Vladimir (CyberShadow) to look at:

Re: (De)Serializing interfaces

2015-08-24 Thread Edwin van Leeuwen via Digitalmars-d-learn
On Monday, 24 August 2015 at 09:26:40 UTC, Edwin van Leeuwen wrote: On Saturday, 22 August 2015 at 19:14:16 UTC, nims wrote: Painlessjson indeed does not support interfaces/subclasses at the moment. There was some discussion about it here: https://github.com/BlackEdder/painlessjson/issues/8 ,

Re: (De)Serializing interfaces

2015-08-24 Thread Edwin van Leeuwen via Digitalmars-d-learn
On Saturday, 22 August 2015 at 19:14:16 UTC, nims wrote: I think interfaces are very powerful and I heavily use them. The only problem I have with them is that serializing/deserializing them to XML or JSON doesn't seem to work. So far I got to try Orange and painlessjson. Using Orange all I

Re: Ruby 3.0 to have immutable strings by default / C++ heading towards generic all the time.

2015-08-24 Thread Enamex via Digitalmars-d
On Thursday, 20 August 2015 at 22:07:10 UTC, John Carter wrote: https://twitter.com/yukihiro_matz/status/634386185507311616 Pity that concepts looks to be a very painful syntax for expressing what D does so clearly. One big difference is that C++1z concepts are supposed to allow looking for

Re: Digger 2.3 verstr.h problem

2015-08-24 Thread Robert M. Münch via Digitalmars-d-learn
On 2015-08-23 20:13:38 +, Vladimir Panteleev said: Not really sure what's going on there... If I could reproduce it, I'd try building DMD manually - if it still occurred, build DMD 2.067.1 from source and add debugging printfs to see why it's not finding verstr.h. I'm not building

Re: D-Day for DMD is today!

2015-08-24 Thread Dejan Lekic via Digitalmars-d-announce
Good news indeed! Well done everybody!

Blog post : OOP composition with mixins

2015-08-24 Thread Dicebot via Digitalmars-d-announce
Rough summary of the talk I have given for recent Berlin D meetup event: https://blog.dicebot.lv/posts/2015/08/OOP_composition_with_mixins

Re: Digger 2.3 verstr.h problem

2015-08-24 Thread Robert M. Münch via Digitalmars-d-learn
On 2015-08-24 11:01:47 +, John Colvin said: Is this from a clean clone of Digger, either with --recursive or having done git submodule update --init ? What version of DMD are you using to build it? Hi, no it was not. Doing a git submodule update --init fixed this problem. After this,

[Issue 14923] [REG2.067] ICE: Assertion failed: (tret-ty != Tvoid), function semantic3, file func.c, line 1736.

2015-08-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14923 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/bdd7d5bf7b5dd148ab0dd0087b2754b0b6867ce7 fix Issue 14923 - ICE:

[Issue 14923] [REG2.067] ICE: Assertion failed: (tret-ty != Tvoid), function semantic3, file func.c, line 1736.

2015-08-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14923 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

  1   2   >