Re: Why does D rely on a GC?

2014-08-19 Thread Meta via Digitalmars-d
On Tuesday, 19 August 2014 at 18:22:46 UTC, Andrei Alexandrescu wrote: What is the main Rust forum? Thanks, Andrei Until very recently it was the mailing list [0]. There is now also a Discourse forum [1]. [0] rust-...@mozilla.org [1] http://discuss.rust-lang.org/

Re: Automatic Inference for Both Key and Value Types of an Associative Array

2014-08-15 Thread Meta via Digitalmars-d
On Friday, 15 August 2014 at 08:34:22 UTC, Kenji Hara via Digitalmars-d wrote: I implemented partial type deduction in AA keys. https://github.com/D-Programming-Language/dmd/pull/3615 For example: auto[auto[$]] aa5 = [[1,2]:1, [3,4]:2]; static assert(is(typeof(aa5) == int[int[2]]));

Re: Automatic Inference for Both Key and Value Types of an Associative Array

2014-08-14 Thread Meta via Digitalmars-d
On Thursday, 14 August 2014 at 18:07:57 UTC, bearophile wrote: Meta: Isn't that also the case for the auto*, const[], immutable[$], etc. syntax? Conceptually it feels the same to me as Kenji's enhancement; I don't know enough about the compiler to talk about it technically.

Re: unittesting generic functions

2014-08-13 Thread Meta via Digitalmars-d
On Thursday, 14 August 2014 at 01:10:54 UTC, Andrei Alexandrescu wrote: Destroy https://issues.dlang.org/show_bug.cgi?id=13291? Andrei It's worth noting that you can currently do this: template fun(T) { int fun(T val) { static if(is(T == string) || is(T == floa

Re: Fun with range deprecations

2014-08-11 Thread Meta via Digitalmars-d
On Monday, 11 August 2014 at 23:45:27 UTC, H. S. Teoh via Digitalmars-d wrote: On Tue, Aug 12, 2014 at 02:38:24AM +0300, ketmar via Digitalmars-d wrote: On Mon, 11 Aug 2014 15:57:50 -0700 "H. S. Teoh via Digitalmars-d" wrote: seems that such deprecations hits even rdmd: trying to compile it

Re: Automatic Inference for Both Key and Value Types of an Associative Array

2014-08-07 Thread Meta via Digitalmars-d
On Thursday, 7 August 2014 at 17:37:54 UTC, Daniel Murphy wrote: "Meta" wrote in message news:ohzzgcslkthrozimf...@forum.dlang.org... Something H.S. Teoh in a recent pull request in Github got me thinking that it would be useful in some cases to tell the compiler that y

Re: Automatic Inference for Both Key and Value Types of an Associative Array

2014-08-07 Thread Meta via Digitalmars-d
On Thursday, 7 August 2014 at 16:07:38 UTC, Meta wrote: Something H.S. Teoh in a recent pull request Something H.S. Teoh *said* in a recent pull request

Automatic Inference for Both Key and Value Types of an Associative Array

2014-08-07 Thread Meta via Digitalmars-d
Something H.S. Teoh in a recent pull request in Github got me thinking that it would be useful in some cases to tell the compiler that you want to automatically infer the either the key type or value type of an AA. Something like the following: //typeof(aa) -> string[int] string[auto] aa = [1:

Re: Phobos PR: `call` vs. `bindTo`

2014-08-05 Thread Meta via Digitalmars-d
On Tuesday, 5 August 2014 at 19:31:08 UTC, H. S. Teoh via Digitalmars-d wrote: There are currently two Phobos PR's that implement essentially the same functionality, but in slightly different ways: https://github.com/D-Programming-Language/phobos/pull/1255 https://github.com/D-P

Re: Algebraic Data Types in D?

2014-07-31 Thread Meta via Digitalmars-d
On Thursday, 31 July 2014 at 20:28:55 UTC, Remo wrote: How to translate this useless Rust code to D, with as least D code as possible ? How be sure that everything will still work as expected if programmer will add White color ? enum Color { Red, Green, Blue, Rgb(int,int,int)

Re: The Comma Operator's Deprecation Can't Come Soon Enough

2014-07-23 Thread Meta via Digitalmars-d
On Wednesday, 23 July 2014 at 19:04:52 UTC, Ali Çehreli wrote: Reminds me... Is everybody aware of D's for syntax? import std.stdio; void main() { for ( { int i = 42; double d = 1.5; string s = "hello"; } i < 100; i *= 2) { writefln("In t

Re: [OT] Empire

2014-07-19 Thread Meta via Digitalmars-d
On Sunday, 20 July 2014 at 05:03:51 UTC, Joakim wrote: Heh, Walter wrote a game that "inspired a great deal of the strategic gaming genre, most notably including Civilization:" http://en.wikipedia.org/wiki/Classic_Empire Other than a couple mentions in this newsgroup, I'd never heard of this

Re: Naming of new lazy versions of existing Phobos functions

2014-07-18 Thread Meta via Digitalmars-d
On Friday, 18 July 2014 at 17:59:05 UTC, Brad Anderson wrote: On Friday, 18 July 2014 at 08:48:08 UTC, Walter Bright wrote: [...] Since there are a lot of existing lazy algorithms in Phobos that do not follow this naming convention, either the convention is pointless or we go through yet anoth

Re: D blog?

2014-07-16 Thread Meta via Digitalmars-d
On Wednesday, 16 July 2014 at 17:00:16 UTC, Kiith-Sa wrote: On Wednesday, 16 July 2014 at 16:04:32 UTC, Meta wrote: On Wednesday, 16 July 2014 at 14:21:26 UTC, Dicebot wrote: On Wednesday, 16 July 2014 at 01:34:58 UTC, Kiith-Sa wrote: Just noticed this: http://blog.octayn.net/blog/2014/06/30

Re: D blog?

2014-07-16 Thread Meta via Digitalmars-d
On Wednesday, 16 July 2014 at 14:21:26 UTC, Dicebot wrote: On Wednesday, 16 July 2014 at 01:34:58 UTC, Kiith-Sa wrote: Just noticed this: http://blog.octayn.net/blog/2014/06/30/this-week-in-rust-54/ This is precisely the kind of thing we need. Huge amount of non-interesting effort. There was

Re: DIP62: Volatile type qualifier for unoptimizable variables in embedded programming

2014-07-15 Thread Meta via Digitalmars-d
On Tuesday, 15 July 2014 at 19:23:36 UTC, Iain Buclaw via Digitalmars-d wrote: Worse, there's no code because the compiler optimises everything away! I was assuming you'd do something in the static if (volatile) section to stop it from doing that. I know very little when it comes to these thi

Re: DIP62: Volatile type qualifier for unoptimizable variables in embedded programming

2014-07-15 Thread Meta via Digitalmars-d
On Tuesday, 15 July 2014 at 18:30:11 UTC, Johannes Pfau wrote: No, this doesn't work with Volatile!: struct A { private int _val; int read(){ return val+val }; int read(bool volatile)() { auto tmp = val; return tmp*tmp; }; } struct A { private int _val; int read(bool vola

Re: The Comma Operator's Deprecation Can't Come Soon Enough

2014-07-15 Thread Meta via Digitalmars-d
On Tuesday, 15 July 2014 at 18:08:15 UTC, Martin Krejcirik wrote: Example? For loop with multiple variables and various one liners of questionable utility aside: import std.stdio; bool funk() { static int count; return ++count > 1 ? true : false; } void main() { bool flag = f

Re: DIP62: Volatile type qualifier for unoptimizable variables in embedded programming

2014-07-15 Thread Meta via Digitalmars-d
On Tuesday, 15 July 2014 at 17:50:13 UTC, Johannes Pfau wrote: Then we have a templated struct. Which generates TypeInfo for every instance. Which might generate an Initializer for every instance and it might generate extended debug info for every instance. These are exactly the kind of workar

Re: The Comma Operator's Deprecation Can't Come Soon Enough

2014-07-15 Thread Meta via Digitalmars-d
On Tuesday, 15 July 2014 at 17:26:12 UTC, Tofu Ninja wrote: Yes please, I legitimately can't think of any use case. I don't understand why was this was ever introduced to D? What is the use? C compatibility as far as I know.

Re: The Comma Operator's Deprecation Can't Come Soon Enough

2014-07-15 Thread Meta via Digitalmars-d
On Tuesday, 15 July 2014 at 16:01:37 UTC, Frustrated wrote: This isn't a bug! It's a logic mistake. Why the heck would you have such a line anyways? alias flattenedType = typeof(R.init.front, depth - 1); The 2nd "argument" to typeof makes no sense. It shouldn't be on that line at all. Total f

Re: The Comma Operator's Deprecation Can't Come Soon Enough

2014-07-15 Thread Meta via Digitalmars-d
On Tuesday, 15 July 2014 at 08:20:34 UTC, Martin Krejcirik wrote: On Tuesday, 15 July 2014 at 08:01:40 UTC, Meta wrote: I'll give you a hint: the bug causes flattenedType!R to always returned uint. What is unexpected about that ? It makes the behaviour of the template that's

The Comma Operator's Deprecation Can't Come Soon Enough

2014-07-15 Thread Meta via Digitalmars-d
Spot the bug: template flattenedType(R, uint depth = uint.max) if (isInputRange!R) { static if (depth > 0) { static if (!isInputRange!(typeof(R.init.front))) { alias flattenedType = typeof(R.init.front, depth - 1);

Re: LinkedIn Article to be: Why you need to start moving off C/C++ to D, now.

2014-07-14 Thread Meta via Digitalmars-d
On Monday, 14 July 2014 at 23:22:54 UTC, John Carter wrote: Any other good blog posts / social media comments / pointers I can digest and use? There are two excellent articles: http://blog.thecybershadow.net/2014/03/21/functional-image-processing-in-d/ http://wiki.dlang.org/Component_programm

Re: Cool Stuff for D that we keep Secret

2014-07-14 Thread Meta via Digitalmars-d
On Monday, 14 July 2014 at 19:53:26 UTC, Nick Sabalausky wrote: 2008? That stuff's been going on *much* longer than that ;) Pick a year. I just remember 2008 was the year that 1080p TVs really became mainstream, and there was no end of terms being thrown around.

Re: Cool Stuff for D that we keep Secret

2014-07-14 Thread Meta via Digitalmars-d
On Monday, 14 July 2014 at 19:40:53 UTC, Nick Sabalausky wrote: [2] 4k: Can screens EVER standardize on fucking ANYTHING anymore?!? Pick a fucking notation for describing resolutions and STICK WITH IT!!! It's like the freaking "Lenny"/"Mountain Lion"/"Ice Cream Sandwich" bullshit here. I don't

Re: How can I dump an expression into log and execute it

2014-07-14 Thread Meta via Digitalmars-d
On Monday, 14 July 2014 at 15:13:21 UTC, Timon Gehr wrote: On 07/14/2014 11:55 AM, Dicebot wrote: I must admit D is far from perfect in that regard because operator overloading is still not limited enough There is no real point in limiting it at all. It is just a matter of naming your functi

Re: Review: std.logger

2014-07-11 Thread Meta via Digitalmars-d
On Friday, 11 July 2014 at 14:38:19 UTC, Dicebot wrote: As usual, this review round will last for 2 weeks unless someone asks for delay. Please share link to this thread via twitter, reddit, G+ and whatever else may be used out there. On lines 606 and 729 in the comments: /** This class is

Re: Opportunities for D

2014-07-10 Thread Meta via Digitalmars-d
On Friday, 11 July 2014 at 01:08:59 UTC, Andrei Alexandrescu wrote: On 7/10/14, 2:25 PM, Walter Bright wrote: On 7/10/2014 1:49 PM, Robert Schadek via Digitalmars-d wrote: https://github.com/D-Programming-Language/phobos/pull/1977 indexOfNeither I want to defer this to Andrei. Merged. -- An

Re: Proposal for design of 'scope' (Was: Re: Opportunities for D)

2014-07-10 Thread Meta via Digitalmars-d
On Thursday, 10 July 2014 at 18:16:57 UTC, H. S. Teoh via Digitalmars-d wrote: There is an interesting subtlety here, in that local variables themselves are not necessarily scoped, for example: class C {} C createObj() { auto obj = new C; // obj is a local v

Re: Proposal for design of 'scope' (Was: Re: Opportunities for D)

2014-07-10 Thread Meta via Digitalmars-d
On Thursday, 10 July 2014 at 17:04:24 UTC, H. S. Teoh via Digitalmars-d wrote: Can you copy and paste the text from your original post? It's difficult to read on the web interface.

Re: Opportunities for D

2014-07-09 Thread Meta via Digitalmars-d
On Wednesday, 9 July 2014 at 07:10:09 UTC, Jacob Carlborg wrote: On 09/07/14 00:21, bearophile wrote: 9. Built-in tuples usable in all the most important situations (with a syntax that doesn't kill possible future improvements of the switch statement to perform basic pattern matching on struct

Re: Opportunities for D

2014-07-08 Thread Meta via Digitalmars-d
On Wednesday, 9 July 2014 at 00:25:55 UTC, Meta wrote: On Tuesday, 8 July 2014 at 21:22:31 UTC, Walter Bright wrote: 8. NotNull!T type For those that want a non-nullable reference type. This should be doable as a library type. I remember Andrei seemed pretty gung-ho about mitigating

Re: Opportunities for D

2014-07-08 Thread Meta via Digitalmars-d
On Tuesday, 8 July 2014 at 22:21:43 UTC, bearophile wrote: Walter Bright: but it doesn't go so far as creating a Unique!T type. What about the already present std.typecons.Unique? In your list I'd like to add another point: 9. Built-in tuples usable in all the most important situations (wi

Re: Opportunities for D

2014-07-08 Thread Meta via Digitalmars-d
On Tuesday, 8 July 2014 at 21:22:31 UTC, Walter Bright wrote: 8. NotNull!T type For those that want a non-nullable reference type. This should be doable as a library type. I remember Andrei seemed pretty gung-ho about mitigating nullable references in the language[0] (he made a thread about

Re: Opportunities for D

2014-07-08 Thread Meta via Digitalmars-d
On Tuesday, 8 July 2014 at 23:18:53 UTC, Remo wrote: So how about memory pool for D ? It there already one ? Andrei is working a lot on them. They look very good. Is the code public already ? https://github.com/andralex/std_allocator

Re: Bottom line re GC in D

2014-07-08 Thread Meta via Digitalmars-d
On Tuesday, 8 July 2014 at 12:24:32 UTC, John Colvin wrote: There was talk of something like immutable(char)[$] = "héllo͂"; working, but I don't know where that went. https://github.com/D-Programming-Language/dmd/pull/3615

Re: Go vs. D vs Java 8

2014-07-07 Thread Meta via Digitalmars-d
On Monday, 7 July 2014 at 15:33:06 UTC, bearophile wrote: If you write it like java, it looks like java. This sentence struck me as very zen for some reason.

Re: Languages for servers (Go, D, and more)

2014-07-04 Thread Meta via Digitalmars-d
On Friday, 4 July 2014 at 15:29:06 UTC, Brian Rogoff wrote: On Friday, 4 July 2014 at 14:10:29 UTC, bearophile wrote: D: y u no distinguish between ints/longs/floats/doubles and pointers when taking out the trash? You argue that internal pointers make implementing a precise garbage collector (w

Re: Option!T

2014-07-01 Thread Meta via Digitalmars-d
On Wednesday, 2 July 2014 at 04:26:50 UTC, Wanderer wrote: Uhm, I'm sorry, but I don't see any difference between two approaches - null-not null vs. one value/no value. In both cases, there is a possibility of a situation when the value that "should be there", is not there. It can be either b

Re: Option!T

2014-07-01 Thread Meta via Digitalmars-d
On Tuesday, 1 July 2014 at 11:37:15 UTC, Shammah Chancellor wrote: On 2013-12-10 17:28:26 +, Andrei Alexandrescu said: I talked to a programmer who knows Scala (among others) and he mentioned the usefulness of the Option type - a zero or one element collection (range in D terminology). Her

Re: Few recent dmd pull requests

2014-06-27 Thread Meta via Digitalmars-d
On Friday, 27 June 2014 at 22:31:57 UTC, H. S. Teoh via Digitalmars-d wrote: I don't know if any further progress has been made since then, though. I've yet to see a pull request for it, so I'd assume that there hasn't.

Re: Module level variable shadowing

2014-06-27 Thread Meta via Digitalmars-d
On Friday, 27 June 2014 at 20:40:24 UTC, Walter Bright wrote: On 6/27/2014 1:38 PM, Tofu Ninja wrote: On Friday, 27 June 2014 at 08:24:16 UTC, dennis luehring wrote: what i don't understand - why on earth should someone want to shadow a(or better any) variable at all? It can be useful if you

Re: Few recent dmd pull requests

2014-06-26 Thread Meta via Digitalmars-d
On Thursday, 26 June 2014 at 18:55:38 UTC, H. S. Teoh via Digitalmars-d wrote: Care to submit a PR to remove mentions of string lambdas from the Phobos docs? They're still all over the place. Sure, as soon as it gets merged.

Re: Few recent dmd pull requests

2014-06-26 Thread Meta via Digitalmars-d
On Thursday, 26 June 2014 at 20:36:01 UTC, Meta wrote: On Thursday, 26 June 2014 at 18:55:38 UTC, H. S. Teoh via Digitalmars-d wrote: Care to submit a PR to remove mentions of string lambdas from the Phobos docs? They're still all over the place. Sure, as soon as it gets merged. I mea

Re: Few recent dmd pull requests

2014-06-26 Thread Meta via Digitalmars-d
On Thursday, 26 June 2014 at 19:30:38 UTC, Tofu Ninja wrote: On Thursday, 26 June 2014 at 18:55:38 UTC, H. S. Teoh via Digitalmars-d wrote: Care to submit a PR to remove mentions of string lambdas from the Phobos docs? They're still all over the place. I feel like this is a bad idea, we shoul

Re: Few recent dmd pull requests

2014-06-26 Thread Meta via Digitalmars-d
On Thursday, 26 June 2014 at 17:26:02 UTC, bearophile wrote: Meta: There has been discussion before about doing away with string lambdas. Maybe this is a good time to do that. If they get deprecated I will have to manually fix a _ton_ of code :-) Bye, bearophile I guess instead of

Re: Few recent dmd pull requests

2014-06-26 Thread Meta via Digitalmars-d
On Thursday, 26 June 2014 at 16:05:24 UTC, bearophile wrote: Meta: So if this pull request gets merged, should we deprecate std.functional.unaryFun and binaryFun? I don't see much need for them with this pull merged. perhaps unaryFun is to convert the strings like q{a * a}. Bye, bearo

Re: Few recent dmd pull requests

2014-06-26 Thread Meta via Digitalmars-d
On Thursday, 26 June 2014 at 10:38:54 UTC, bearophile wrote: https://github.com/D-Programming-Language/dmd/pull/3638 Allows to write code like: void main() { import std.algorithm; alias sqr = a => a ^^ 2; auto r = [1, 2, 3].map!sqr; } So if this pull request gets merged, should w

Re: Few recent dmd pull requests

2014-06-26 Thread Meta via Digitalmars-d
On Thursday, 26 June 2014 at 10:38:54 UTC, bearophile wrote: // pointer type auto* p1 = new int(3); // int* const* p2 = new int(3); // const(int)* Won't some people, especially those coming from C++, mistake this for being syntax to create a constant pointer to a mutable int?

Re: Is this a bug?

2014-06-26 Thread Meta via Digitalmars-d
On Thursday, 26 June 2014 at 10:09:53 UTC, Rene Zwanenburg wrote: I /think/ this is a bug, but I'm not 100% sure. The following compiles without any problems, as it should: import std.typecons; alias Handle(T) = RefCounted!(T, RefCountedAutoInitialize.no); auto initialized(T)() if(is(T == Ref

Re: Supertypes, subtypes, and more

2014-06-25 Thread Meta via Digitalmars-d
On Wednesday, 25 June 2014 at 19:30:25 UTC, bearophile wrote: Meta: You can do this in C# as well: class SocialSecurityNumber { But it's essential to do that on structs. Bye, bearophile I believe it works for structs as well.

Re: Supertypes, subtypes, and more

2014-06-25 Thread Meta via Digitalmars-d
On Wednesday, 25 June 2014 at 15:33:16 UTC, bearophile wrote: In Phobos we have Typedef (that needs some improvements), that allows to define a not compatible type. In D we have "alias this" that inside a struct allows to create a new type (with instance object of size equal or larger than th

Re: Adding the ?. null verification

2014-06-24 Thread Meta via Digitalmars-d
On Tuesday, 24 June 2014 at 19:56:14 UTC, H. S. Teoh via Digitalmars-d wrote: So D code is going to start looking like this now?! if (myobj.elvis.subobj.memb.isAlive.or(false)) { ... } What about ifExists? if (myObj.ifExists.subobj.member.isAlive.or(false)) {

Re: DIP64: Attribute Cleanup

2014-06-20 Thread Meta via Digitalmars-d
On Friday, 20 June 2014 at 19:22:04 UTC, Brian Schott wrote: http://wiki.dlang.org/DIP64 Attributes in D have two problems: 1. There are too many of them and declarations are getting too verbose 2. New attributes use @ and the old ones do not. I've created a DIP to address these issues. Doe

Re: Icons for .d and .di files

2014-06-20 Thread Meta via Digitalmars-d
On Friday, 20 June 2014 at 16:41:14 UTC, Jordi Sayol via Digitalmars-d wrote: El 20/06/14 18:02, Jordi Sayol via Digitalmars-d ha escrit: El 20/06/14 11:49, FreeSlave via Digitalmars-d ha escrit: Thanks, but they are still logos, not icons for files. File icon should appear as document. Like th

Re: Icons for .d and .di files

2014-06-19 Thread Meta via Digitalmars-d
On Thursday, 19 June 2014 at 21:57:03 UTC, FreeSlave wrote: Is there any good icon for D source files? Now .d files look like plain text files. I changed mime on my Debian to use dlang site logo for .d files, but it looks weird among with others (C, C++, etc.) I'm not artist, but I see there

Re: Adding the ?. null verification

2014-06-19 Thread Meta via Digitalmars-d
On Thursday, 19 June 2014 at 21:34:07 UTC, Andrei Alexandrescu wrote: On 6/18/14, 10:39 AM, deadalnix wrote: Use a maybe monad : Maybe(obj).memeber.nested.val Yah, I keep on thinking we should explore the maybe monad more thoroughly as a library in D. -- Andrei The other night for fun I tri

Re: RFC: Value range propagation for if-else

2014-06-18 Thread Meta via Digitalmars-d
On Wednesday, 18 June 2014 at 20:00:20 UTC, H. S. Teoh via Digitalmars-d wrote: Until you compile with -release, and then suddenly invalid input crashes your program. :-P (Then you'll go and fire the guy who wrote it.) T My point exactly. If contracts allow things like what Bearophile want

Re: RFC: Value range propagation for if-else

2014-06-18 Thread Meta via Digitalmars-d
On Wednesday, 18 June 2014 at 17:00:36 UTC, bearophile wrote: Lionello Lunesu: Will play with it. And later you look at other things, like post-conditions: int foo() out(result) { assert(result >= 0 && result <= ubyte.max); } body { return 10; } void main() { ubyte x = foo(); }

Re: Adding the ?. null verification

2014-06-18 Thread Meta via Digitalmars-d
On Wednesday, 18 June 2014 at 19:37:42 UTC, H. S. Teoh via Digitalmars-d wrote: Here's a first stab at a library solution: /** * Simple-minded implementation of a Maybe monad. * * Params: t = data to wrap. * Returns: A wrapper around the given type, with "saf

Re: Constant relationships between non-constant objects

2014-06-17 Thread Meta via Digitalmars-d
On Wednesday, 18 June 2014 at 01:31:33 UTC, Sebastian Unger wrote: Hi there, I'm an experient C++ developer and am trying to switch to / learn D. What I've seen so far is mostly quite straight forward and VERY nice. There's only one catch so far for me for which Googling has only found the di

Re: A Perspective on D from game industry

2014-06-15 Thread Meta via Digitalmars-d
On Sunday, 15 June 2014 at 11:28:12 UTC, Peter Alexander wrote: http://c0de517e.blogspot.ca/2014/06/where-is-my-c-replacement.html?m=1 The arguments against D are pretty weak if I'm honest, but I think it's important we understand what people think of D. I can confirm this sentiment is fairly

Re: foreach

2014-06-13 Thread Meta via Digitalmars-d
On Friday, 13 June 2014 at 21:12:20 UTC, Timon Gehr wrote: Why do you claim he is bad at math? It's a joke, though I suppose not a very good one. If 1 == 1 doesn't indicate a condition that should never be false to you, then you're bad at math.

Re: foreach

2014-06-13 Thread Meta via Digitalmars-d
On Friday, 13 June 2014 at 17:05:26 UTC, H. S. Teoh via Digitalmars-d wrote: I don't like arbitrary constants like the `true` in while(true) -- it kinda goes against the grain, that "while" implies there is a stopping point, but sticking true in there contradicts this notion and is therefore d

Re: foreach

2014-06-12 Thread Meta via Digitalmars-d
On Thursday, 12 June 2014 at 15:00:20 UTC, Manu via Digitalmars-d wrote: I often find myself wanting to write this: foreach(; 0..n) {} In the case that I just want to do something n times and I don't actually care about the loop counter, but this doesn't compile. You can do this: for(;;) {}

Re: [OT] DConf socks

2014-06-10 Thread Meta via Digitalmars-d
On Tuesday, 10 June 2014 at 08:18:44 UTC, JR wrote: Missed opportunity to use std.socks.assumeMine and netting yourself an extra pair... The problem is that assumeMine is not @safe.

Re: [OT] Extra time spent

2014-06-09 Thread Meta via Digitalmars-d
On Monday, 9 June 2014 at 18:55:47 UTC, Nick Sabalausky wrote: On 6/9/2014 2:48 PM, Meta wrote: On Monday, 9 June 2014 at 18:03:54 UTC, Nick Sabalausky wrote: Speaking of such things, I've actually been considering that pair Sony recently put out aimed at the PS3/PS4. While I gene

Re: [OT] Extra time spent

2014-06-09 Thread Meta via Digitalmars-d
On Monday, 9 June 2014 at 18:03:54 UTC, Nick Sabalausky wrote: On 6/9/2014 12:57 PM, John Colvin wrote: I initially found that style uncomfortable, but quickly got used to it. That said, I almost exclusively use proper headphones these days. A pair of Audio-Technica ATH-m50s is a great buy:

Re: [OT] Extra time spent

2014-06-07 Thread Meta via Digitalmars-d
On Saturday, 7 June 2014 at 20:49:03 UTC, deadalnix wrote: https://www.youtube.com/watch?v=fCPzLNqYe1U I'm aware of BabyMetal, but they're of course not pop, and not your typical band. I think that BabyMetal is something that could only happen in Japan.

Re: [OT] Talks from NDC Oslo 2014 available on Vimeo

2014-06-07 Thread Meta via Digitalmars-d
On Saturday, 7 June 2014 at 20:42:17 UTC, Gary Willoughby wrote: On Saturday, 7 June 2014 at 20:35:25 UTC, David Nadlinger wrote: Hi all, I just noticed that all the sessions from NDC Oslo 2014 are available online in video form at http://vimeo.com/channels/ndc2014. Andrei's talks (includin

Re: [OT] Extra time spent

2014-06-07 Thread Meta via Digitalmars-d
On Saturday, 7 June 2014 at 19:53:36 UTC, Kagamin wrote: On Friday, 6 June 2014 at 02:21:45 UTC, Nick Sabalausky wrote: On 6/5/2014 6:08 PM, deadalnix wrote: On Thursday, 5 June 2014 at 14:11:32 UTC, H. S. Teoh via Digitalmars-d wrote: Ha! Though, truth be told, I can't stand modern pop music

Re: enum scope

2014-06-07 Thread Meta via Digitalmars-d
On Thursday, 26 January 2012 at 13:23:43 UTC, Trass3r wrote: It's not type safe in C. But you can wrap it in a struct with alias this instead. Yep, but in D we have strong enums, so why not use them. Enums aren't as strongly typed as you would think (or as I would like). The major problem is

Re: [OT] Extra time spent

2014-06-05 Thread Meta via Digitalmars-d
On Thursday, 5 June 2014 at 17:45:00 UTC, Adam D. Ruppe wrote: Second best opera ever: https://www.youtube.com/watch?v=ZbGw3A9Dg-Q lololol (first best opera? https://www.youtube.com/watch?v=nEuf9ZSJrdg oh yeah ff6!) There is a version of this with vocals that has been done several times by

Re: (git HEAD) std.datetime spewing deprecation messages

2014-06-04 Thread Meta via Digitalmars-d
On Wednesday, 4 June 2014 at 15:51:58 UTC, John Colvin wrote: Assuming hours, minutes and seconds are already declared, you can do this already TypeTuple!(hours, minutes, seconds) = dur.parts; A full working example of the syntax: import std.typetuple; import std.typecons; import std.stdio;

Re: (git HEAD) std.datetime spewing deprecation messages

2014-06-04 Thread Meta via Digitalmars-d
On Wednesday, 4 June 2014 at 11:28:52 UTC, Kagamin wrote: Does one really needs only one component, but not the others? Maybe it should provide full computed broken form instead of separate components? auto d=dur.breakUp; d.hours; d.minutes; d.seconds; In some glorious future where we can de

Re: [OT] Extra time spent

2014-06-03 Thread Meta via Digitalmars-d
On Tuesday, 3 June 2014 at 06:55:15 UTC, Jacob Carlborg wrote: I prefer using a real computer as well but I like having a smart phone to have something to do when I go to and from work on the subway. Like reading these newsgroups or reading Adam's new book. Although I never post on the newsgrou

Re: [OT] Apple introduces Swift as Objective-C sucessor

2014-06-02 Thread Meta via Digitalmars-d
On Monday, 2 June 2014 at 23:01:56 UTC, deadalnix wrote: On Monday, 2 June 2014 at 22:53:10 UTC, ponce wrote: - no exceptions (!) How do they do error handling ? - type inference is "bidirectional by expression or statement" KAMOULOX ! (french people will understand) It specifically says

Re: [OT] Apple introduces Swift as Objective-C sucessor

2014-06-02 Thread Meta via Digitalmars-d
On Monday, 2 June 2014 at 19:45:29 UTC, Paulo Pinto wrote: On Monday, 2 June 2014 at 19:19:27 UTC, Paulo Pinto wrote: Just thought it would be nice to give a heads up about Apple's plans to replace Objective-C in the long run. The language was presented today at the WWDC Keynote, looks like R

Re: [OT] Extra time spent

2014-06-02 Thread Meta via Digitalmars-d
On Monday, 2 June 2014 at 17:52:03 UTC, Meta wrote: This may be a sign that your work is not interesting and/or challenging enough, or you're not getting an opportunity to learn new things. One of the most fun coding experiences I've had in a long time was implementing a simple

Re: [OT] Extra time spent

2014-06-02 Thread Meta via Digitalmars-d
On Monday, 2 June 2014 at 17:41:09 UTC, Nick Sabalausky wrote: I always used to be like that (hell, I was *known* for that). But then once I started doing it for $ that quickly sucked most of the enjoyment out of it. Seems to be that everything changes when you're doing something as a job inste

Re: ++x vs. atomicOp!"+="(x,1) with a shared int

2014-06-01 Thread Meta via Digitalmars-d
On Sunday, 1 June 2014 at 07:06:27 UTC, Chuck Allison wrote: I was under the impression that calling ++x for a shared x is an error. Not only do I not get an error, the effect of ++x is identical to atomicOp"+="(x,1) in the following example (the variable is count here, not x): shared int cou

Re: Array bound checks removal increasing importance

2014-05-31 Thread Meta via Digitalmars-d
On Saturday, 31 May 2014 at 23:30:41 UTC, Walter Bright wrote: There isn't a suitable place. To make it work, data flow analysis would have to be added to the front end. While doable, this is not a simple addition. Eventually, we'll have to do it as a lot of things become possible & better with

Re: Redesign of dlang.org

2014-05-31 Thread Meta via Digitalmars-d
On Saturday, 31 May 2014 at 20:12:06 UTC, Meta wrote: The flat design looks nice, but I really dislike the choice of background colour. It's bland and clashes quite badly with the white of the menu and content box. For comparison, here's two images. One is the site with the backgro

Re: Redesign of dlang.org

2014-05-31 Thread Meta via Digitalmars-d
On Saturday, 31 May 2014 at 20:38:05 UTC, Meta wrote: On Saturday, 31 May 2014 at 20:12:06 UTC, Meta wrote: The flat design looks nice, but I really dislike the choice of background colour. It's bland and clashes quite badly with the white of the menu and content box. For comparison, h

Re: Redesign of dlang.org

2014-05-31 Thread Meta via Digitalmars-d
The flat design looks nice, but I really dislike the choice of background colour. It's bland and clashes quite badly with the white of the menu and content box.

Re: More useful fixed-size array literals

2014-05-30 Thread Meta via Digitalmars-d
On Friday, 30 May 2014 at 22:19:51 UTC, bearophile wrote: Code similar to this is not uncommon. Currently it's refused: immutable data = [1, 5, 3, 1, 5, 1, 5]; void main() @nogc { import std.algorithm: count; assert(data.count([1, 5]) == 3); } test.d(4,23): Error: array literal in @no

Re: std.experimental – DConf?

2014-05-29 Thread Meta via Digitalmars-d
On Thursday, 29 May 2014 at 14:50:40 UTC, bearophile wrote: Joseph Rushton Wakeling: Minor point -- is it really going to be the clunky std.experimental, Clunky is good for something that you only use for experiments. Short names should be left for good reliable functionality. Bye, bearophil

Re: Voldemort declarations inside structs with ctor initialization

2014-05-28 Thread Meta via Digitalmars-d
On Wednesday, 28 May 2014 at 06:20:29 UTC, Idan Arye wrote: From what I know(don't know how it is implemented in D. I know it doesn't work that way in languages that emulate closures like C++ and Java) delegates don't "allocate a closure" - rather, they use a the callstack frame that was alread

Re: Voldemort declarations inside structs with ctor initialization

2014-05-27 Thread Meta via Digitalmars-d
On Tuesday, 27 May 2014 at 23:18:12 UTC, Idan Arye wrote: Well, it won't work for the example that opened this thread(converted to use lambdas). As for limiting the delegate version to ones that use @pure and @nogc, take another look at my example. The lambdas don't allocate anything so they'

Re: Voldemort declarations inside structs with ctor initialization

2014-05-27 Thread Meta via Digitalmars-d
On Tuesday, 27 May 2014 at 19:39:23 UTC, Idan Arye wrote: Hashing the function body is not enough - you must also consider the closure! template Template(alias func){ bool Template=func(); } void foo(){ int a; writeln(Template!(()=>is(typeof(a) : char))); //

Re: Voldemort declarations inside structs with ctor initialization

2014-05-27 Thread Meta via Digitalmars-d
On Tuesday, 27 May 2014 at 17:22:43 UTC, Andrei Alexandrescu wrote: I think there was either or both a discussion and a bug report on this, but can't find either. Basically we need to clarify what it means to compare two function literals for equality. -- Andrei I remember the thread where th

Re: Questions about the scope/Exception machinery

2014-05-27 Thread Meta via Digitalmars-d
On Tuesday, 27 May 2014 at 13:24:08 UTC, Qox wrote: sounds a bit like C++ handling to me, for me *personally* it misses also the point about nothrow, because it gurantues nothing...which is like in C++ and imho bad... It guarantees at compile time that your function will not throw an Exceptio

Re: D mention w/ LLVM on hacker news.

2014-05-26 Thread Meta via Digitalmars-d
On Monday, 26 May 2014 at 19:44:32 UTC, Vic wrote: D mention on hacker news: https://news.ycombinator.com/item?id=7800445 #dlang re LLVM You shouldn't post the direct link, HN thinks you're trying to game the system if there are a bunch of visits from the same referrer. https://hn.algolia.

Re: Thank you Kenji

2014-05-23 Thread Meta via Digitalmars-d
Yes, Kenji does some amazing work. D would be far behind where it is now without him.

Re: C++ bounded::integer library

2014-05-20 Thread Meta via Digitalmars-d
On Monday, 19 May 2014 at 23:02:01 UTC, bearophile wrote: I think "enum preconditions" are exactly that :-) But I don't know if they are good enough, if they are a good idea, of if there are better ways to do similar things. But I think something like that is an useful improvement for D, able t

Re: Switch to list all druntime calls?

2014-05-20 Thread Meta via Digitalmars-d
On Tuesday, 20 May 2014 at 10:39:32 UTC, bearophile wrote: Instead (or in addition) of this dmd compiler switch: -vgc list all hidden gc allocations Isn't it more useful a compiler switch like "-noruntime" (similar to the switch of the ldc2 compiler) meant to list the lines of code

Re: "hijackable"/"customizable" keyword for solving the "customized algorithm" issue?

2014-05-14 Thread Meta via Digitalmars-d
On Thursday, 15 May 2014 at 01:49:17 UTC, Idan Arye wrote: UFCS only apply to the method call style, not the the function call style, so it's not a matter of priority here - `foo(myObject)` will not call the `foo.myObject()` method even if there is no `foo` function(in that case it'll just fail

Re: Memory allocation purity

2014-05-14 Thread Meta via Digitalmars-d
On Thursday, 15 May 2014 at 01:33:36 UTC, Idan Arye wrote: On Wednesday, 14 May 2014 at 22:50:10 UTC, w0rp wrote: I think even C malloc should be considered pure. True, it affects global state by allocating memory, but it never changes existing values, it just allows for new values. free is pu

Re: Memory allocation purity

2014-05-14 Thread Meta via Digitalmars-d
On Thursday, 15 May 2014 at 00:50:06 UTC, Walter Bright wrote: On 5/14/2014 5:03 PM, Meta wrote: Allocating memory through new and malloc should always be pure, I think, because failure either returns null in malloc's case, malloc cannot be pure if, with the same arguments, it returns

<    2   3   4   5   6   7   8   9   10   >