Re: Setting a list of values

2016-04-30 Thread Ali Çehreli via Digitalmars-d-learn
On 04/30/2016 10:05 PM, Joel wrote: > This has no effect: > _bars.each!(a => { a._plots.fillColor = Color(255, 180, 0); }); This is a common issue especially for people who know lambdas from other languages. :) Your lambda does not do any work. Rather, your lambda returns another lambda,

Re: Can't use std.algorithm.remove on a char[]?

2016-04-30 Thread TheGag96 via Digitalmars-d-learn
On Saturday, 30 April 2016 at 19:21:30 UTC, ag0aep6g wrote: On 30.04.2016 21:08, Jon D wrote: If an initial step is to fix the documentation, it would be helpful to include specifically that it doesn't work with characters. It's not obvious that characters don't meet the requirement.

Using a string generated at compile-time in a @nogc function

2016-04-30 Thread Mithun Hunsur via Digitalmars-d-learn
Hi all, I'm working on removing the string mixins from my code, but have run into an issue: http://dpaste.dzfl.pl/ecd7eb53947e As far as I can tell, this should work; the enum should force compile-time execution (which it does, as evidenced by the pragma). I've worked around this by

Setting a list of values

2016-04-30 Thread Joel via Digitalmars-d-learn
This has no effect: _bars.each!(a => { a._plots.fillColor = Color(255, 180, 0); }); I tried putting ..each!((ref a) =>.. with no difference This works: foreach(b; _bars) { b._plots.fillColor = Color(255, 180, 0); }

Re: Rust piece on integer safety

2016-04-30 Thread Ed via Digitalmars-d-learn
On Saturday, 30 April 2016 at 23:11:20 UTC, Laeeth Isharc wrote: All the design/discussion/implementation of this scheme for handling integer overflow would be wasted if it didn’t actually find any bugs in practice. I personally have had quite a few bugs found nearly as I write them, with

Re: Off-topic: Nationalism on the rise again?

2016-04-30 Thread QAston via Digitalmars-d
On Saturday, 30 April 2016 at 16:14:10 UTC, Marco Leise wrote: The sentence right before where you cut the citation captured what I was thinking of: […] frustration with the establishment leads to the rise of people who favor a single opinion, prejudice, distrust, controlled press and

Rust piece on integer safety

2016-04-30 Thread Laeeth Isharc via Digitalmars-d-learn
All the design/discussion/implementation of this scheme for handling integer overflow would be wasted if it didn’t actually find any bugs in practice. I personally have had quite a few bugs found nearly as I write them, with expressions like cmp::max(x - y, z) (they never hit the internet, so

Re: Inheritance of mixin

2016-04-30 Thread Andrew Benton via Digitalmars-d
On Saturday, 30 April 2016 at 22:14:47 UTC, Ed wrote: On Saturday, 30 April 2016 at 01:06:18 UTC, Andrew Benton wrote: On Friday, 29 April 2016 at 19:11:24 UTC, tsbockman wrote: Rare as in, "effecting only a very small amount of real world code" - not as in "effecting only a very small number

Re: Inheritance of mixin

2016-04-30 Thread Ed via Digitalmars-d
On Saturday, 30 April 2016 at 01:06:18 UTC, Andrew Benton wrote: On Friday, 29 April 2016 at 19:11:24 UTC, tsbockman wrote: Rare as in, "effecting only a very small amount of real world code" - not as in "effecting only a very small number of people". [...] Additionally, any libraries that

Re: Walter's Famous German Language Essentials Guide

2016-04-30 Thread Walter Bright via Digitalmars-d
On 4/28/2016 6:49 AM, jack wrote: [...] Such comments are not welcome here. Please stop.

Re: VariantPointer

2016-04-30 Thread Nordlöw via Digitalmars-d-learn
On Wednesday, 20 April 2016 at 13:41:27 UTC, Nordlöw wrote: https://github.com/nordlow/phobos-next/blob/master/src/variant_pointer.d Moved here: https://github.com/nordlow/phobos-next/blob/master/src/variant_ex.d

Re: Can't use std.algorithm.remove on a char[]?

2016-04-30 Thread ag0aep6g via Digitalmars-d-learn
On 30.04.2016 21:41, Jon D wrote: I didn't mean to suggest making the documentation technically incorrect. Just that it be helpful in important cases that won't necessarily be obvious. To me, char[] is an important case, one that's not made obvious by listing the hasLvalueElements constraint by

Re: Can't use std.algorithm.remove on a char[]?

2016-04-30 Thread Jon D via Digitalmars-d-learn
On Saturday, 30 April 2016 at 19:21:30 UTC, ag0aep6g wrote: On 30.04.2016 21:08, Jon D wrote: If an initial step is to fix the documentation, it would be helpful to include specifically that it doesn't work with characters. It's not obvious that characters don't meet the requirement.

Re: Can't use std.algorithm.remove on a char[]?

2016-04-30 Thread ag0aep6g via Digitalmars-d-learn
On 30.04.2016 21:08, Jon D wrote: If an initial step is to fix the documentation, it would be helpful to include specifically that it doesn't work with characters. It's not obvious that characters don't meet the requirement. Characters are not the problem. remove works fine on a range of

[Issue 8930] std.algorithm.remove only operates on hasLvalueElements

2016-04-30 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8930 Jon Degenhardt changed: What|Removed |Added CC|

Re: Can't use std.algorithm.remove on a char[]?

2016-04-30 Thread Jon D via Digitalmars-d-learn
On Saturday, 30 April 2016 at 18:32:32 UTC, ag0aep6g wrote: On 30.04.2016 18:44, TheGag96 wrote: I was just writing some code trying to remove a value from a character array, but the compiler complained "No overload matches for remove", and if I specifically say use std.algorithm.remove() the

Re: Walter's Famous German Language Essentials Guide

2016-04-30 Thread Johan Engelen via Digitalmars-d
On Friday, 29 April 2016 at 08:04:44 UTC, Marco Leise wrote: Beware though that a not so cute Mädchen is NOT "die Made" by reverse This! Haha, genial, will try to remember and use ;-)

Re: Can't use std.algorithm.remove on a char[]?

2016-04-30 Thread ag0aep6g via Digitalmars-d-learn
On 30.04.2016 18:44, TheGag96 wrote: I was just writing some code trying to remove a value from a character array, but the compiler complained "No overload matches for remove", and if I specifically say use std.algorithm.remove() the compiler doesn't think it fits any definition. For reference,

Re: Proposed: start DConf days one hour later

2016-04-30 Thread WhatMeWorry via Digitalmars-d-announce
On Wednesday, 27 April 2016 at 18:36:54 UTC, Andrei Alexandrescu wrote: The folks at Sociomantic suggested to start at 10:00 AM instead of 9:00 AM, therefore shifting the end time by one as well. Please reply with thoughts on this! We're particularly concerned about folks who need to take off

Can't use std.algorithm.remove on a char[]?

2016-04-30 Thread TheGag96 via Digitalmars-d-learn
I was just writing some code trying to remove a value from a character array, but the compiler complained "No overload matches for remove", and if I specifically say use std.algorithm.remove() the compiler doesn't think it fits any definition. For reference, this would be all I'm doing:

Off-topic: Nationalism on the rise again?

2016-04-30 Thread Marco Leise via Digitalmars-d
Am Sat, 30 Apr 2016 13:08:28 + schrieb QAston : > On Friday, 29 April 2016 at 09:07:47 UTC, Marco Leise wrote: > > It might be difficult with your daily > > experience in Berlin to look at the world from above, but if > > you do it should become obvious looking at Turkey,

Re: Walter's Famous German Language Essentials Guide

2016-04-30 Thread Liam McSherry via Digitalmars-d
Dies ist warum, wir können kein nettes Zeug haben.

Re: String lambdas

2016-04-30 Thread Bauss via Digitalmars-d
On Saturday, 30 April 2016 at 16:02:02 UTC, Bauss wrote: On Tuesday, 26 April 2016 at 17:58:22 UTC, Andrei Alexandrescu wrote: [...] An alternative to string lambads could be something like a shortened version of lambdas like consider [...] %1 and %2 should be %0 and %1 and also the <

Re: String lambdas

2016-04-30 Thread Bauss via Digitalmars-d
On Tuesday, 26 April 2016 at 17:58:22 UTC, Andrei Alexandrescu wrote: https://github.com/dlang/phobos/pull/3882 I just closed with some regret a nice piece of engineering. Please comment if you think string lambdas have a lot of unexploited potential. One thing we really need in order to

Re: Walter's Famous German Language Essentials Guide

2016-04-30 Thread jack via Digitalmars-d
well you seem to run around and chose to close your eyes to whats going on - just another "gutmensch" who knows whats good. got a sister or a little brother? send have her go out these days alone - if you dare. moslem rapefugees and turks might get to know her/him very well. this is

Re: Garbage Collector : Ignoring a reference

2016-04-30 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 26 April 2016 at 09:07:59 UTC, Begah wrote: I am trying to create an asset manager for my textures. I had the idea ( it may be a wrong idea ) to create a hashmap of my textures with a string as the key. When the program request a texture, it firts check if it is in the hashmap and

Re: Walter's Famous German Language Essentials Guide

2016-04-30 Thread QAston via Digitalmars-d
On Friday, 29 April 2016 at 09:07:47 UTC, Marco Leise wrote: It might be difficult with your daily experience in Berlin to look at the world from above, but if you do it should become obvious looking at Turkey, Russia, Poland, Austria and Germany's own past or Donald Trump, that if we let these

Linking to library dependent on Objective-C functions

2016-04-30 Thread FreeSlave via Digitalmars-d-learn
I have two files. The one has Objective-C functions and interfaces declarations written in D. Another file is main app and it imports the first and uses its functions. Imported file: http://codepad.org/jqdBb6sh Main file: http://codepad.org/0gKBqKxi When I compile them in one command it run

Re: Garbage Collector : Ignoring a reference

2016-04-30 Thread Namespace via Digitalmars-d-learn
On Tuesday, 26 April 2016 at 09:07:59 UTC, Begah wrote: I am trying to create an asset manager for my textures. I had the idea ( it may be a wrong idea ) to create a hashmap of my textures with a string as the key. When the program request a texture, it firts check if it is in the hashmap and

Re: Inheritance of mixin

2016-04-30 Thread Daniel N via Digitalmars-d
On Friday, 29 April 2016 at 10:59:20 UTC, Timon Gehr wrote: The use case isn't rare (it is a quite popular request, at least four independent instances that I remember). Having a mixin in all classes in some subtree of the class hierarchy can be a good idea. Of course one can easily do it