October 28, 2016
On Thursday, 27 October 2016 at 22:24:57 UTC, Temtaime wrote:
> On Thursday, 27 October 2016 at 19:49:16 UTC, Ali Çehreli wrote:
>> [...]
>
> You create some complicated template function and then compiler show you an ICE.

You shoot yourself in a tuple containing your foot, boot and sock.
October 28, 2016
On Friday, 28 October 2016 at 01:25:55 UTC, Kirill Kryukov wrote:

>
> You shoot yourself in a tuple containing your foot, boot and sock.

Cannot implicitly convert expression (map(shoot(foot))) of type MapResult to std.ouch.InputRange!limb
October 28, 2016
On Friday, 28 October 2016 at 09:29:41 UTC, Chris wrote:
> On Friday, 28 October 2016 at 01:25:55 UTC, Kirill Kryukov wrote:
>
>>
>> You shoot yourself in a tuple containing your foot, boot and sock.
>
> Cannot implicitly convert expression (map(shoot(foot))) of type MapResult to std.ouch.InputRange!limb

You create the bullet in your foot for efficiency (CTFE).
October 28, 2016
On Friday, 28 October 2016 at 09:55:34 UTC, Patric Dexheimer wrote:
> On Friday, 28 October 2016 at 09:29:41 UTC, Chris wrote:
>> On Friday, 28 October 2016 at 01:25:55 UTC, Kirill Kryukov wrote:
>>
>>>
>>> You shoot yourself in a tuple containing your foot, boot and sock.
>>
>> Cannot implicitly convert expression (map(shoot(foot))) of type MapResult to std.ouch.InputRange!limb
>
> You create the bullet in your foot for efficiency (CTFE).

You shoot yourself in the foot, but it doesn't matter, it was allocated on the stack.
October 28, 2016
On Thursday, 27 October 2016 at 19:49:16 UTC, Ali Çehreli wrote:
>
>   http://www.toodarkpark.org/computers/humor/shoot-self-in-foot.html
>
> Some entries for reference:
>
> C
> - You shoot yourself in the foot.
> - You shoot yourself in the foot and then nobody else can figure out what you did.
>
> C++
> - You accidentally create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical assistance is impossible since you can't tell which are bitwise copies and which are just pointing at others and saying, "That's me, over there."
>
> Python
> - You shoot yourself in the foot and then brag for hours about how much more elegantly you did it than if you had been using C or (God forbid) Perl.
>
> What would the entry for D be? :)
>
> Ali

When you try shooting at your foot with your AK-47, you realize the GC has blown it already.
October 28, 2016
On Thursday, 27 October 2016 at 19:49:16 UTC, Ali Çehreli wrote:
>
>   http://www.toodarkpark.org/computers/humor/shoot-self-in-foot.html
>
> Some entries for reference:
>
> C
> - You shoot yourself in the foot.
> - You shoot yourself in the foot and then nobody else can figure out what you did.
>
> C++
> - You accidentally create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical assistance is impossible since you can't tell which are bitwise copies and which are just pointing at others and saying, "That's me, over there."
>
> Python
> - You shoot yourself in the foot and then brag for hours about how much more elegantly you did it than if you had been using C or (God forbid) Perl.
>
> What would the entry for D be? :)
>
> Ali

You unregister your feet from the runtime in order to move smoothly, wander in front of a bullet that's paused by the GC, which then un-pauses and hits you in the foot.
October 28, 2016
On Friday, 28 October 2016 at 11:41:11 UTC, John Colvin wrote:
> You unregister your feet from the runtime in order to move smoothly, wander in front of a bullet that's paused by the GC, which then un-pauses and hits you in the foot.

This is the best one so far! This is typical D: circumvent safety to enable you to shoot yourself in the foot.
October 28, 2016
On 10/28/2016 04:32 AM, Guillaume Piolat wrote:

> When you try shooting at your foot with your AK-47, you realize the GC
> has blown it already.

Or... the bullet stops midair, waiting for the GC to finish a collection cycle (probably for a lollipop created in another thread).

Ali

October 28, 2016
On 10/28/2016 04:41 AM, John Colvin wrote:

> a bullet that's paused by the GC

Wow. I've just said almost the same thing before reading this one. :)

Ali

October 31, 2016
as i just happened to have me mutilated, i couldn't resist (even though the example 'works' only with DMD-m64 bullets):


being forced to share your foot among parallel universes, it will surely find a stray bullet in one of them.


can you guess which toe is going to be blown off?

'''
version(DigitalMars)version(D_LP64){
	import std.stdio	: writeln;
	import core.atomic	: atomicOp;

	ulong toe0 = 2;
	shared ulong toe1 = 2;
	shared ulong toe2 = 2;
	shared ulong toe3 = 2;
	uint bullet1 = 1;
	int bullet2 = 1;
	ulong bullet3 = 1;

	toe0 -= 1;
	writeln( "toe0: ", toe0 );

	atomicOp!"-="( toe1, bullet1 );
	writeln( "toe1: ", toe1 );
	
	atomicOp!"-="( toe2, bullet2 );
	writeln( "toe2: ", toe2 );

	atomicOp!"-="( toe3, bullet3 );
	writeln( "toe3: ", toe3 );
}


( https://issues.dlang.org/show_bug.cgi?id=16651 )