forked from p0nce/d-idioms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
3170 lines (2972 loc) · 151 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html><head><meta charset="utf-8">
<meta name="description" content="Effective D Programming Language.">
<style type="text/css" media="all" >/* Eric Meyer's Reset CSS v2.0 - http://cssreset.com */
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}
html
{
height: 100%;
font-size: 10px;
}
body
{
font-family: "HelveticaNeue", "Helvetica Neue", "HelveticaNeueRoman", "HelveticaNeue-Roman", "Helvetica Neue Roman", 'TeXGyreHerosRegular', "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif;
font-weight: 400;
font-stretch: normal;
display: block;
color: #bbbbbb;
background-color: #424040;
}
.sub
{
font-size: 0.8em;
vertical-align: super;
}
.container
{
display: block;
width: 90%;
max-width: 1100px;
padding: 0.5rem;
margin: 0 auto;
background-color: #bbbbbc;
box-shadow: 0.2rem 0.4rem 1rem 0rem rgba(32,32,32,0.15);
}
.permalink
{
float: right;
display: inline-block;
font-size: 0.7em;
}
header
{
display: block;
width: 90%;
max-width: 1100px;
font-size: 2.2rem;
padding: 0.5rem;
margin: 0 auto;
height: 13rem;
text-align: center;
background-color: #744;
font-weight: 700;
line-height: 4em;
vertical-align: middle;
box-shadow: 0.2em 0.8em 1em 0em rgba(32,32,32,0.15);
z-index: 5;
color: #e8e8ef;
}
nav
{
display: block;
width: 90%;
max-width: 1100px;
font-size: 1.6rem;
padding: 0.5rem;
margin: 0 auto;
background-color: #ededef;
list-style-type: square;
box-shadow: 0.2em 0.4em 2.0em 0em rgba(32,32,32,0.1);
z-index: 10;
}
footer
{
display: block;
width: 90%;
max-width: 1100px;
font-size: 1.6rem;
padding: 0.5rem;
margin: 0 auto;
background-color: #744;
list-style-type: square;
box-shadow: 0.2em 0.4em 2.0em 0em rgba(32,32,32,0.1);
z-index: 10;
color: black;
line-height: 1.3em;
}
footer h2
{
color: #f8deb7;
padding: 4rem 4.25rem 0rem 4.25rem;
margin: 2rem;
}
footer p, footer ul
{
padding: 0rem 4.25rem 0rem 4.25rem;
margin: 2rem;
color: #ccb3b3;
}
footer a
{
color: #84c6ea;
}
a
{
text-decoration: none;
color: #5050c0;
font-weight: 700;
}
a:hover
{
color: #5000c0;
text-decoration: underline;
}
.item-nav
{
padding: 0.32em;
margin: 1rem 8rem 1rem 8rem;
display: list-item;
}
h1
{
font-size: 2.38rem;
padding: 1.2rem;
margin: 0em 0em 2.4rem 1.2rem;
color: #444;
}
h2
{
font-size: 1.9rem;
padding: 0.34rem;
margin: 4rem 0rem 1rem -0.5rem;
color: #444;
}
p
{
padding: 1rem 2rem;
padding: 1rem 2rem;
max-width: 80rem;
}
ol
{
margin: 0.85rem;
}
li
{
display: list-item;
list-style: square;
margin: 0rem 0rem 0rem 6rem;
padding: 0.34rem;
}
strong
{
font-weight: 700;
}
em
{
font-style:italic;
}
.prettyprint
{
font-family: "Inconsolata", "Courier New", "Courier", monospace, sans-serif;
color: #883900;
}
pre
{
font-family: "Inconsolata", "Courier New", "Courier", monospace, sans-serif;
padding: 0rem;
margin: 1.7rem;
font-size: 1.53rem;
line-height: 1.7rem;
box-shadow: inset 0.15rem 0.3rem 1.5rem 0rem rgba(0,0,0,0.2);
}
.idiom
{
font-size: 1.7rem;
color: #222;
background-color: #ededef;
display: block;
padding: 8rem 6rem;
margin: 2.4rem;
line-height: 2.5rem;
box-shadow: 0.17rem 0.34rem 1.7rem 0rem rgba(32,32,32,0.15);
}
#logo
{
position: relative;
left: -0.5rem;
display: inline-block;
vertical-align: middle;
float: left;
}
#title
{
display: inline-block;
vertical-align: middle;
float: left;
text-align: center;
margin: 2rem 2rem 2rem 4rem;
font-size: 2.4rem;
}
/*
#contributors ul
{
margin: 0rem 0rem 5rem 5rem;
color: white;
}
#contributors li
{
color: white;
}
*//*
vim-hybrid theme by w0ng (https://github.com/w0ng/vim-hybrid)
*/
/*background color*/
.hljs {
display: block;
overflow-x: auto;
padding: 1.0em;
background: #1d1f21;
-webkit-text-size-adjust: none;
}
/*selection color*/
.hljs::selection,
.hljs span::selection {
background: #bababa;
}
.hljs::-moz-selection,
.hljs span::-moz-selection {
background: #bababa;
}
/*foreground color*/
.hljs,
.hljs-setting .hljs-value,
.hljs-expression .hljs-variable,
.hljs-expression .hljs-begin-block,
.hljs-expression .hljs-end-block,
.hljs-class .hljs-params,
.hljs-function .hljs-params,
.hljs-at_rule .hljs-preprocessor {
color: #c5c8c6;
}
/*color: fg_yellow*/
.hljs-title,
.hljs-function .hljs-title,
.hljs-keyword .hljs-common,
.hljs-class .hljs-title,
.hljs-decorator,
.hljs-tag .hljs-title,
.hljs-header,
.hljs-sub,
.hljs-function {
color: #f0c674;
}
/*color: fg_comment*/
.hljs-comment,
.hljs-javadoc,
.hljs-output .hljs-value,
.hljs-pi,
.hljs-shebang,
.hljs-doctype {
color: #707880;
}
/*color: fg_red*/
.hljs-number,
.hljs-symbol,
.hljs-literal,
.hljs-deletion,
.hljs-link_url,
.hljs-symbol .hljs-string,
.hljs-argument,
.hljs-hexcolor,
.hljs-input .hljs-prompt,
.hljs-char {
color: #cc6666
}
/*color: fg_green*/
.hljs-string,
.hljs-special,
.hljs-javadoctag,
.hljs-addition,
.hljs-important,
.hljs-tag .hljs-value,
.hljs-at.rule .hljs-keyword,
.hljs-regexp,
.hljs-attr_selector {
color: #b5bd68;
}
/*color: fg_purple*/
.hljs-variable,
.hljs-property,
.hljs-envar,
.hljs-code,
.hljs-expression,
.hljs-localvars,
.hljs-id,
.hljs-variable .hljs-filter,
.hljs-variable .hljs-filter .hljs-keyword,
.hljs-template_tag .hljs-filter .hljs-keyword {
color: #b294bb;
}
/*color: fg_blue*/
.hljs-statement,
.hljs-label,
.hljs-keyword,
.hljs-xmlDocTag,
.hljs-function .hljs-keyword,
.hljs-chunk,
.hljs-cdata,
.hljs-link_label,
.hljs-bullet,
.hljs-class .hljs-keyword,
.hljs-smartquote,
.hljs-method,
.hljs-list .hljs-title,
.hljs-tag {
color: #81a2be;
}
/*color: fg_aqua*/
.hljs-pseudo,
.hljs-exception,
.hljs-annotation,
.hljs-subst,
.hljs-change,
.hljs-cbracket,
.hljs-operator,
.hljs-horizontal_rule,
.hljs-preprocessor .hljs-keyword,
.hljs-typedef,
.hljs-template_tag,
.hljs-variable,
.hljs-variable .hljs-filter .hljs-argument,
.hljs-at_rule,
.hljs-at_rule .hljs-string,
.hljs-at_rule .hljs-keyword {
color: #8abeb7;
}
/*color: fg_orange*/
.hljs-type,
.hljs-typename,
.hljs-inheritance .hljs-parent,
.hljs-constant,
.hljs-built_in,
.hljs-setting,
.hljs-structure,
.hljs-link_reference,
.hljs-attribute,
.hljs-blockquote,
.hljs-quoted,
.hljs-class,
.hljs-header {
color: #de935f;
}
.hljs-emphasis
{
font-style: italic;
}
.hljs-strong
{
font-weight: bold;
}
</style><link href='//fonts.googleapis.com/css?family=Inconsolata' rel='stylesheet' type='text/css'>
<title>d-idioms - Idioms for the D programming language</title></head><body><script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create', 'UA-71912218-1', 'auto');ga('send', 'pageview');</script><script src="highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<header><img id="logo" src="d-logo.svg"></img><div id="title">Idioms for the D Programming Language
</div></header><nav><div class="item-nav"><a href="#Rvalue-references:-Understanding-auto-ref-and-then-not-using-it">Rvalue references: Understanding auto ref and then not using it
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Nov 21<span class="sub">th</span> 2016, created Oct 23<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#@nogc-Array-Literals:-Breaking-the-Limits">@nogc Array Literals: Breaking the Limits
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Oct 23<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#Compile-time-RNG">Compile-time RNG
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Oct 19<span class="sub">th</span> 2016, created Feb 5<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#Leveraging-TLS-for-a-fast-thread-safe-singleton">Leveraging TLS for a fast thread-safe singleton
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Oct 19<span class="sub">th</span> 2016, created Mar 20<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#Smallest-valid-D-program">Smallest valid D program
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Oct 19<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#People-blogging-about-D">People blogging about D
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Sep 20<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#Games-made-with-D">Games made with D
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Sep 14<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#Voldemort-types">Voldemort types
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Sep 12<span class="sub">th</span> 2016, created Jan 5<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#So-what-do-module-declarations-do,-exactly?">So what do module declarations do, exactly?
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Sep 4<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#So-D-is-just-C++-with-a-Garbage-Collector?">So D is just C++ with a Garbage Collector?
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Sep 4<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#The-trouble-with-class-destructors">The trouble with class destructors
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Sep 4<span class="sub">th</span> 2016, created Jan 31<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Which-book-should-I-read?">Which book should I read?
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Sep 4<span class="sub">th</span> 2016, created Jan 5<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#Four-ways-to-use-the-static-keyword-you-may-not-know-about">Four ways to use the static keyword you may not know about
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Sep 4<span class="sub">th</span> 2016, created Jan 26<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#Qualified-switch-using-with">Qualified switch using with
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Jun 4<span class="sub">th</span> 2016, created Jan 4<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Precomputed-tables-at-compile-time-through-CTFE">Precomputed tables at compile-time through CTFE
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Jun 4<span class="sub">th</span> 2016, created Jan 26<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#Porting-from-C-gotchas">Porting from C gotchas
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Jun 4<span class="sub">th</span> 2016, created Jan 11<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#The-impossible-real-time-thread">The impossible real-time thread
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Jun 4<span class="sub">th</span> 2016, created Jan 24<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Phobos-gems">Phobos gems
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Jun 4<span class="sub">th</span> 2016, created Jan 17<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#The-importance-of-being-pure">The importance of being pure
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Jun 4<span class="sub">th</span> 2016, created Jan 27<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#Optimal-AA-lookup">Optimal AA lookup
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Jun 4<span class="sub">th</span> 2016, created Jan 10<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Eponymous-templates">Eponymous templates
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified May 25<span class="sub">th</span> 2016, created Oct 4<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#GC-proof-resource-class">GC-proof resource class
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Apr 2<span class="sub">nd</span> 2016, created Aug 30<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Enumerate-fields-with-__traits(allMembers)-and-static-foreach">Enumerate fields with __traits(allMembers) and static foreach
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Mar 20<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#Automatic-attribute-inference-for-function-templates">Automatic attribute inference for function templates
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Feb 14<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#Converting-from-and-to-C-strings">Converting from and to C strings
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Feb 14<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#Static-arrays-are-value-types">Static arrays are value types
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Feb 14<span class="sub">th</span> 2016, created Jan 10<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Differences-in-integer-handling-vs-C">Differences in integer handling vs C
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Feb 14<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#Trailing-commas">Trailing commas
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Jan 27<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#So-what-does--release-do,-exactly?">So what does -release do, exactly?
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Jan 27<span class="sub">th</span> 2016, created May 16<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Getting-a-method-callbacked-from-C">Getting a method callbacked from C
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Jan 27<span class="sub">th</span> 2016, created Jan 23<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Design-by-Introspection">Design by Introspection
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Jan 23<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#Using-std.typecons.Flag-like-a-pro">Using std.typecons.Flag like a pro
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Jan 21<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#String-interpolation-as-a-library">String interpolation as a library
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Jan 20<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#assert(false)-is-special">assert(false) is special
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Jan 20<span class="sub">th</span> 2016, created Jan 14<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Is-a-specific-program-available-in-PATH?">Is a specific program available in PATH?
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Jan 5<span class="sub">th</span> 2016, created Oct 15<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Knowing-inout-inside-out">Knowing inout inside out
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Jan 5<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#Never-use->=-for-dependencies">Never use >= for dependencies
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Jan 4<span class="sub">th</span> 2016, created Jan 28<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Throwing-despite-@nogc">Throwing despite @nogc
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Jan 4<span class="sub">th</span> 2016, created Jun 8<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#What-is-the-difference-between-out-and-ref-parameters?">What is the difference between out and ref parameters?
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Jan 4<span class="sub">th</span> 2016
</span></div><div class="item-nav"><a href="#How-does-D-improve-on-C++17?">How does D improve on C++17?
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Jan 2<span class="sub">nd</span> 2016, created Apr 26<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Working-with-associative-arrays">Working with associative arrays
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Jan 1<span class="sub">st</span> 2016
</span></div><div class="item-nav"><a href="#Friends-don't-let-friends-use-the-default-struct-postblit">Friends don't let friends use the default struct postblit
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Dec 28<span class="sub">th</span> 2015, created Sep 6<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Falsey-values">Falsey values
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Dec 19<span class="sub">th</span> 2015, created Jan 15<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Extend-a-struct-with-alias-this">Extend a struct with alias this
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Nov 28<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Embed-a-dynamic-library-in-an-executable">Embed a dynamic library in an executable
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Nov 28<span class="sub">th</span> 2015, created Jan 4<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Custom-format()-for-builtin-types">Custom format() for builtin types
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Nov 28<span class="sub">th</span> 2015, created Jun 8<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Bypassing-@nogc">Bypassing @nogc
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Nov 28<span class="sub">th</span> 2015, created Jun 7<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Minimum-or-maximum-of-numbers">Minimum or maximum of numbers
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Oct 25<span class="sub">th</span> 2015, created Jan 4<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Precise-timestamps-in-milliseconds">Precise timestamps in milliseconds
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Oct 6<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#How-the-D-Garbage-Collector-works">How the D Garbage Collector works
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Oct 4<span class="sub">th</span> 2015, created Feb 14<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Working-with-files">Working with files
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Oct 4<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#D-online-resources">D online resources
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Sep 1<span class="sub">st</span> 2015, created Jan 8<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Smallest-dub.json-for-an-executable">Smallest dub.json for an executable
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Aug 25<span class="sub">th</span> 2015, created Jan 8<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Capturing-with-regular-expressions">Capturing with regular expressions
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Aug 24<span class="sub">th</span> 2015, created Jan 29<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Patching-a-library-available-on-the-DUB-registry">Patching a library available on the DUB registry
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Aug 6<span class="sub">th</span> 2015, created Jan 7<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Adding-or-removing-an-element-from-arrays">Adding or removing an element from arrays
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified May 20<span class="sub">th</span> 2015, created Mar 22<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Skip-initialization-with-=-void">Skip initialization with = void
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created May 16<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#if-(__ctfe)">if (__ctfe)
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Apr 26<span class="sub">th</span> 2015, created Feb 22<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Slices-.capacity,-the-mysterious-property">Slices .capacity, the mysterious property
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Mar 31<span class="sub">th</span> 2015, created Mar 22<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Grouping-modules-with-package.d">Grouping modules with package.d
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Mar 22<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Should-I-use-++pre-increment-or-post-increment++?">Should I use ++pre-increment or post-increment++?
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Mar 22<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#/+-+/-nestable-comments-and-version(none)">/+ +/ nestable comments and version(none)
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Mar 22<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Unrecoverable-vs-recoverable-errors">Unrecoverable vs recoverable errors
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Feb 22<span class="sub">th</span> 2015, created Feb 12<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Recursive-Sum-Type-with-matching">Recursive Sum Type with matching
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Jan 24<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Ensure-array-access-without-bounds-checking">Ensure array access without bounds checking
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Jan 24<span class="sub">th</span> 2015, created Jan 7<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Implicit-conversion-for-user-defined-types">Implicit conversion for user-defined types
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Jan 23<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#if-embedded-declaration">if embedded declaration
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Jan 15<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Linking-with-C-gotchas">Linking with C gotchas
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Jan 14<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Placement-new-with-emplace">Placement new with emplace
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Jan 14<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#The-truth-about-shared">The truth about shared
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Created Jan 10<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Searching-for-a-substring-position">Searching for a substring position
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Jan 8<span class="sub">th</span> 2015, created Jan 4<span class="sub">th</span> 2015
</span></div><div class="item-nav"><a href="#Inheriting-from-Exception">Inheriting from Exception
</a><span style=" color:rgb(158,158,158); font-size: 0.7em; float: right;"> Modified Jan 7<span class="sub">th</span> 2015, created Jan 4<span class="sub">th</span> 2015
</span></div></nav><div class="container"><a name="Rvalue-references:-Understanding-auto-ref-and-then-not-using-it"></a><div class="idiom"><a class="permalink" href="#Rvalue-references:-Understanding-auto-ref-and-then-not-using-it">Link
</a><h1>Rvalue references: Understanding <code class="prettyprint">auto ref</code> and then not using it</h1>
<h2> What are Rvalue references?</h2>
<p><em>"Rvalue references"</em>, known from C++, are a way to pass both Lvalues and Rvalues by reference.<br>It looks like this:
</p>
<pre class="prettyprint"><code>#include <iostream>
struct Vector2f
{
float x, y;
explicit Vector2f(float x, float y) : x(x), y(y)
{
}
};
void foo(const Vector2f& pos)
{
std::cout << pos.x << '|' << pos.y << std::endl;
}
int main()
{
Vector2f v(42, 23);
foo(v); // Pass a Lvalue, works
foo(Vector2f(42, 23)); // Pass a Rvalue, works as well
}
</code></pre><p>How do you achieve something similar in D?
</p>
<h2> Understanding <code class="prettyprint">auto ref</code> parameters</h2>
<p>The canonical way to pass both Rvalues and Lvalues in D is to use <code class="prettyprint">auto ref</code> parameters in combination with templates.
</p>
<pre class="prettyprint"><code>
struct A
{
int id;
}
void test(T)(auto ref T a)
{
}
//
// Case 1:
//
// This generates one function:
//
// void test(ref A a) { ... }
//
// taking the argument by ref.
A a = A(42);
test(a);
//
// Case 2
//
// This generates another function:
//
// void test(A a) { ... }
//
// taking the argument by value.
test(A(42));
</code></pre><p>What <code class="prettyprint">auto ref</code> does is generating two different versions of the function, one passing Lvalues by reference, and the other passing Rvalues by copy.
</p>
<p><strong>Wait!</strong> You may immediately notice two key differences with C++:
</p>
<ul>
<li>There are no Rvalue references: Rvalues are moved instead.
</li>
<li>In the worst case, using <code class="prettyprint">auto ref</code> may lead to template bloat with many such parameters.
</li>
</ul>
<p>You'll be relieved to know there is a way to mimic the C++ behaviour.
</p>
<h2> Here comes the trick</h2>
<p>Let's define in our struct a <code class="prettyprint">byRef</code> method which return <code class="prettyprint">this</code> by reference.
</p>
<pre class="prettyprint"><code>import std.stdio;
mixin template RvalueRef()
{
alias T = typeof(this); // typeof(this) get us the type we're in
static assert (is(T == struct));
@nogc @safe
ref const(T) byRef() const pure nothrow return
{
return this;
}
}
struct Vector2f
{
float x, y;
this(float x, float y) pure nothrow
{
this.x = x;
this.y = y;
}
mixin RvalueRef;
}
void foo(ref const Vector2f pos)
{
writefln("(%.2f|%.2f)", pos.x, pos.y);
}
void main()
{
Vector2f v = Vector2f(42, 23);
foo(v); // Works
foo(Vector2f(42, 23).byRef); // Works as well, and use the same function
}
</code></pre><p>By effectively converting the Lvalue into an Rvalue using the <code class="prettyprint">ref</code> storage class on a function return type, we can pass the <code class="prettyprint">Vector2f</code> to a function taking <code class="prettyprint">ref const</code> input.
</p>
<p><em>This idiom was written by</em> <a href="https://github.com/Dgame">Randy Schütt</a><em>.</em>
</p>
</div><a name="@nogc-Array-Literals:-Breaking-the-Limits"></a><div class="idiom"><a class="permalink" href="#@nogc-Array-Literals:-Breaking-the-Limits">Link
</a><h1>@nogc Array Literals: Breaking the Limits</h1>
<h2> Array literals may allocate</h2>
<p>The most vexing limitation of <code class="prettyprint">@nogc</code> is that array literals generally can't be used anymore.
</p>
<pre class="prettyprint"><code>void main() @nogc
{
// Works: the array literal is used as a value.
int[3] myStaticArray = [1, 2, 3];
// Doesn't work.
int[] myDynamicArray = [1, 2, 3]; // Error: array literal in @nogc function
// may cause GC allocation
}
</code></pre><p>Indeed, such literals may well <strong>allocate a new array on the GC heap</strong>.
</p>
<h2> The little template that could</h2>
<p>Fortunately, like often in the D world, there is an easy work-around to lift the limitations.
</p>
<pre class="prettyprint"><code>T[n] s(T, size_t n)(auto ref T[n] array) pure nothrow @nogc @safe
{
return array;
}
void main() @nogc
{
int[] myDynamicArray = [1, 2, 3].s; // Slice that static array which is on stack
// Use myDynamicArray...
}
</code></pre><h2> Beware of the stack lifetime</h2>
<p>That work-around slices the stack allocated array and turn it into a slice. This would lead to memory corruption if the reference escapes.
</p>
<p>Do not fear! The compiler warns you of escaped references to the stack, even in unsafe D.
</p>
<pre class="prettyprint"><code>// This function is illegal
int[] doNotDoThat() @nogc
{
return [1, 2, 3].s; // Error: escaping reference to stack allocated
// value returned by s([1, 2, 3])
}
</code></pre><p>Instead, duplicate this slice <code class="prettyprint">@nogc</code>-style, for example with <code class="prettyprint">malloc</code>. <strong>You are now able to use array literals in</strong> <code class="prettyprint">@nogc</code> <strong>code.</strong>
</p>
<p><em>This idiom originated from</em> <a href="https://github.com/Dgame">Randy Schütt</a>.
</p>
</div><a name="Compile-time-RNG"></a><div class="idiom"><a class="permalink" href="#Compile-time-RNG">Link
</a><h1>Compile-time RNG</h1>
<p>In January 2016, an anonymous programmer <a href="http://forum.dlang.org/post/[email protected]">posted on the D forums</a> a Proof-of-Concept for a devious compile-time Random Number Generator.
</p>
<pre class="prettyprint"><code>/+ CTRNG
Proof-Of-Concept Compile-Time Random Number Generator.
Please never actually use this or anything like it.
While doing some metaprogramming tomfoolery, I stumbled into an
interesting scenario. It occurred to me that with some work, I could
probably turn what I had into a functioning compile-time random
number generator, despite D's restrictions on metaprogramming intended
to keep things deterministic. Some of this may be obvious to you,
some of it may be interesting. Whether or not any of this is a bug, I do
not know. It probably isn't useful unless trying to sabotage a codebase.
Note: This is specifically developed with minimal dependence on other
modules (even standard ones), so some things are implemented in
non-idiomatic (read: strange) ways.
+/
/+
Step 1
We need something useable as a seed. Luckily, D has __TIMESTAMP__, which
reports time of build as a string in roughly the following format:
Wed Jan 20 18:04:41 2016
Specific contents of this function don't matter. All that matters is
timestamp goes in, largish unsigned integers come out. Feel free to skip
the implementation, it is not important. All that matters is that with
this, we will be able to get a psuedo-random seed at compile-time.
We *could* parse the timestamp accurately, but the rest of this is
hackish, so why not make this hackish as well?
+/
ulong timestampToUlong(string stamp)
{
ulong result;
foreach_reverse(c; stamp)
{
result += c;
result *= 10;
}
return result;
}
/+
Step 2
Next, we'll need the ability to track some sort of state. D is designed
with the intention that compile-time constructs cannot have a useful
permanent state, so this'll take some doing.
For starters, we need something we can query that can give different
results different times we call it (as in, impure). For this, we
have the following templated enum. It is manifest constant giving
the number of top-level members in the current module. However,
this number can change as other templates and mixins are resolved.
Technically, each instantiation is different, but because the dirty
details are hidden inside the default parameter value, it can be used
as if it should always be the same value.
+/
enum counter(size_t x = [__traits(allMembers, mixin(__MODULE__))].length)=x;
/+
Step 3
For step 2 to work, we also need the ability to add members in between
uses of `counter`. These need to be uniquely named, so we will
need a way to generate names. Step 2 already gave us a source of
increasing numbers, so we can trivially generate names based on
the value of `counter`. So, we define a method to yeild a string
containing a new unique declaration that we can `mixin()`.
+/
char[] member(ulong x)
{
char[] buf = "void[0] _X0000000000000000;".dup;
enum mapping = "0123456789abcdef";
foreach_reverse(i; buf.length-17 .. buf.length-1)
{
buf[i] = mapping[x & 0xf];
x >>= 4;
}
return buf;
}
/+
Step 4
This is just a simple wrapper combining `member` and `counter` under
a single name, making it slightly easier to increment the counter.
+/
mixin template next()
{
mixin(member(counter!()));
}
/+
Step 5
Finally, we define a simple XorShift64* RNG. We don't really
have arbitrary mutable state (yet?), so this depends on the D
compiler caching previous template instantiations.
The first is a specialization introducing our seed.
The second is how all subsequent xorShift instantiations are
handled, again taking advantage of changing default parameters.
+/
template xorShift(size_t x = counter!())
{
static if(x == 0)
{
enum xorShift = timestampToUlong(__TIMESTAMP__);
}
else
{
// Name previous result to reduce syntax noise.
enum y = xorShift!(x-1);
enum xorShift = 0x2545_f491_4f6c_dd1dUL
* (((y ^ (y >> 12)) ^ ((y ^ (y >> 12)) << 25))
^ (((y ^ (y >> 12)) ^ ((y ^ (y >> 12)) << 25)) >> 27));
}
}
/+
Now, let's use it!
+/
// Two instantiantions of xorShift result in the same value
static assert(xorShift!() == xorShift!());
// However, we can save one value,
enum a = xorShift!();
// ... update the counter,
mixin next;
// ... and save another value,
enum b = xorShift!();
// ... and they will not be the same.
static assert(a != b);
/+ What's more, because we have a time based seed, they will
all be different every time you compile this code. +/
pragma(msg, a);
pragma(msg, b);
mixin next;
mixin template headsOrTails(size_t x)
{
static if(x % 2 == 0)
{
pragma(msg, "Heads!");
}
else
{
pragma(msg, "Tails!");
}
}
mixin headsOrTails!(xorShift!());
/+
Conclusion
This is a really simple proof of concept. A "better" version
could use a recursively scanning counter implementation that
looked for symbols tagged with a certain User-Defined attribute
to allow advancing the RNG state inside structs and such.
More complicated RNGs could be implemented in a similar way.
There may be value in mixing in template specializations.
But then again, all this code is evil and I won't be doing
anything more with it.
+/
void main()
{
// Don't do anything at runtime. Just make dpaste's linker happy.
}
</code></pre><p><a href="http://dpaste.dzfl.pl/668646ce6d71">See source code on DPaste...</a>.
</p>
</div><a name="Leveraging-TLS-for-a-fast-thread-safe-singleton"></a><div class="idiom"><a class="permalink" href="#Leveraging-TLS-for-a-fast-thread-safe-singleton">Link
</a><h1>Leveraging TLS for a fast thread-safe singleton</h1>
<p>In D the declarations you reasonably thought would be globals, are instead put in Thread-Local Storage (TLS) unless marked with <code class="prettyprint">shared</code> or <code class="prettyprint">__gshared</code>. Each thread the runtime knows has its own independent copy of TLS things.
</p>
<pre class="prettyprint"><code>class A
{
static int instanceCount = 0; // Caution: one per thread
}
</code></pre><h2> Don't ask what TLS can do for you. Ask what you can do with TLS!</h2>
<p><strong>TLS is useful to avoid locks when accessing global state.</strong>
</p>
<p>In this example, we'll show how to leverage TLS to avoid a costly <code class="prettyprint">synchronized</code> block and still be thread-safe.
</p>
<pre class="prettyprint"><code>class FastSingleton
{
private:
this()
{
}
// TLS flag, each thread has its own
static bool instantiated_;
// "True" global
__gshared FastSingleton instance_;
public:
static FastSingleton get()
{
// Since every thread has its own instantiated_ variable,
// there is no need for synchronization here.
if (!instantiated_)
{
synchronized (FastSingleton.classinfo)
{
if (!instance_)
{
instance_ = new FastSingleton();
}
instantiated_ = true;
}
}
return instance_;
}
}
</code></pre><p>This singleton implementation was taken from <a href="https://www.youtube.com/watch?v=yMNMV9JlkcQ">this talk</a> by David Simcha.
</p>
<p>If you find any other use for TLS, please send us your discoveries.
</p>
</div><a name="Smallest-valid-D-program"></a><div class="idiom"><a class="permalink" href="#Smallest-valid-D-program">Link
</a><h1> Smallest valid D program</h1>
<p>Only 13 bytes are necessary:
</p>
<pre class="prettyprint"><code>void main(){}
</code></pre><p>You don't necessarily need to write <code class="prettyprint">void main(string[] args){}</code>.
</p>
</div><a name="People-blogging-about-D"></a><div class="idiom"><a class="permalink" href="#People-blogging-about-D">Link
</a><h1>People blogging about D</h1>
<ul>
<li>The official D blog: <a href="https://dlang.org/blog/">https://dlang.org/blog/</a>
</li>
<li>Michael Parker's blog (Derelict author): <a href="http://dblog.aldacron.net/">http://dblog.aldacron.net/</a>
</li>
<li>Vladimir Panteleev's blog: <a href="http://blog.thecybershadow.net/">http://blog.thecybershadow.net/</a>
</li>
<li>Átila Neves's blog: <a href="https://atilanevesoncode.wordpress.com/">https://atilanevesoncode.wordpress.com/</a>
</li>
<li>Gary Willoughby's blog: <a href="http://nomad.so/tag/d/">http://nomad.so/tag/d/</a>
</li>
<li>The Art of Machinery: <a href="https://theartofmachinery.com/">https://theartofmachinery.com/</a>
</li>
</ul>
<p>Planet D is a blog aggregator much more complete than this list:<br><a href="http://planet.dsource.org/">http://planet.dsource.org/</a>
</p>
</div><a name="Games-made-with-D"></a><div class="idiom"><a class="permalink" href="#Games-made-with-D">Link
</a><h1>Games made with D</h1>
<h2> Quantum Break</h2>
<p><a href="http://www.quantumbreak.com/">Quantum Break</a> is an AAA video game developed by Remedy Entertainment (2016).<br>Is it written in C++ with D as the scripting language. Available on Xbox One and Windows.
</p>
<p>See:
</p>
<ul>
<li><a href="https://www.youtube.com/watch?v=OLFBal4Qo_k">Quantum Break: AAA Gaming With Some D Code</a>
</li>
<li><a href="https://www.youtube.com/watch?v=FKceA691Wcg">Using D Alongside a Game Engine by Manu Evans</a>
</li>
<li><a href="https://github.com/Remedy-Entertainment/binderoo">Binderoo</a> the binding library
</li>
</ul>
<h2> Mayhem Intergalactic</h2>
<p><a href="http://www.inventivedingo.com/mayhemig">Mayhem Intergalactic</a> is the first ever commercial video game written in D (2007).<br>Available for Windows.<br>See the <a href="http://forum.dlang.org/post/[email protected]">newsgroup announcement</a>.
</p>
<h2> Kenta Cho's games</h2>
<p>Kenta Cho released a number of Windows shooter games in early D.
</p>
<ul>
<li><a href="http://www.asahi-net.or.jp/~cs8k-cyu/windows/tt_e.html">Torus Trooper</a>
</li>
<li><a href="http://www.asahi-net.or.jp/~cs8k-cyu/windows/tf_e.html">TUMIKI Fighters</a>