Questions tagged [dmd]

Dmd stands for the Digital Mars D compiler.

The reference D compiler.

Usage:

Use as a generic tag.

199 questions
7
votes
4 answers

D programming language char arrays

This may sound really stupid. but I've got a strange problem with the D programming language. When I try to create a new array like this: import std.stdio; void main() { char[] variable = "value"; writefln(variable); } The DMD compiler…
user32756
  • 739
  • 3
  • 12
  • 15
7
votes
2 answers

Writing a D (D2) binding for existing C libraries

I'd really like to get more into D, but the lack of good library support is really hindering me. Therefore I'd like to create some D bindings for existing C libraries I'd like to use. I've never done any binding, but it doesn't look too difficult…
Taco de Wolff
  • 1,682
  • 3
  • 17
  • 34
7
votes
3 answers

Digital Mars D compiler; acquiring ASM output

I am reading the book from Andrei Alexandrescu about the D programming language. He's an excellent writer and does a pretty good job at explaining aspects of the D language. I however find certain constructs hard to understand when I cannot imagine…
Taco de Wolff
  • 1,682
  • 3
  • 17
  • 34
7
votes
2 answers

sdl ttf_rendertext_blended fails randomly

EDIT: Even that the problem still exists, I haven't been able to reproduce this frequently enough to examine it closer. See more info at the end of the question. I started to develop a game, and I am currently writing basic library for it. I'm…
MaKo
  • 746
  • 3
  • 11
7
votes
1 answer

How does to!string(enum.member) works?

How does std.conv.to!string(enum.member) work? How is it possible that a function takes an enum member and returns its name? Does it use a compiler extension or something similar? It's a bit usual to me since I came from C/C++ world.
Jack
  • 16,276
  • 55
  • 159
  • 284
7
votes
2 answers

How to develop a library in D

How would you develop a library in D language? I want to write a simple library for image processing that I then want to use in an application. I am looking for analogy to either Java's JARs with Maven system (build, install, use in other projects)…
Binders Lachel
  • 505
  • 1
  • 5
  • 14
7
votes
2 answers

D Development Process

What is the recommended development process for D programs that use packages that are cloned from github and separately built? Typically in relation to how C/C++ projects are built using make, autotools, cmake, etc. Most other build specifications…
Nordlöw
  • 11,838
  • 10
  • 52
  • 99
7
votes
2 answers

How to compile D application without the D runtime?

Iv been trying to figure this one out forever, and its starting to annoy me. I understand the D runtime library. What it is, what it does. I also understand that you can compile a D app without it. Like what XoMB does. Well, XoMB defines its own…
kbzombie
  • 322
  • 2
  • 12
7
votes
2 answers

Sorting based on associative arrays in D

I am trying to follow examples given in various places for D apps. Generally when learning a language I start on example apps and change them myself, purely to test stuff out. One app that caught my eye was to count the frequency of words in a block…
GKelly
  • 3,835
  • 4
  • 38
  • 45
7
votes
1 answer

std.algorithm.joiner(string[],string) - why result elements are dchar and not char?

I try to compile following code: import std.algorithm; void main() { string[] x = ["ab", "cd", "ef"]; // 'string' is same as 'immutable(char)[]' string space = " "; char z = joiner( x, space ).front(); // error } Compilation with dmd…
dnsmkl
  • 792
  • 5
  • 17
6
votes
1 answer

Why is readf not behaving as expected?

import std.stdio; void main(){ int n; while(readf("%d", &n)){ if(n == 11) break; writeln(n); } } The first iteration works, and it prints n, but after that readf() never returns. The documentation has only a single line…
Arlen
  • 6,641
  • 4
  • 29
  • 61
6
votes
1 answer

Confusion regarding the 'align' attribute

I understand that the align attribute has a few different form of use. In my first attempt, I was using it as follows: align(1) private struct TGAHeader { ubyte idLenght; ubyte hasColormap; ubyte imageType; ushort…
glampert
  • 4,371
  • 2
  • 23
  • 49
5
votes
1 answer

Sending a templated function as an argument to a templated function in D

I'm trying to send D's sort function as a template argument to the pipe function. When I use sort without template arguments it works: import std.stdio,std.algorithm,std.functional; void main() { auto arr=pipe!(sort)([1,3,2]); …
Idan Arye
  • 12,402
  • 5
  • 49
  • 68
5
votes
1 answer

Mono-D DMD compiler issues

With features like Code Completion and simple refactoring, writing D in Mono-D is almost as productive as writing C# in Visual Studios. Everything works great on Linux, just install Mono Develop, add the Mono-D repository, and build; but on Windows…
F i L
  • 760
  • 3
  • 12
5
votes
3 answers

Is there a way to create an elegant class-member window-function?

The Window-Procedure in the Win32 API must be static \ global function since it cannot take a class-object (the this) parameter. One can of-course use workarounds like a hWnd->object dictionary and such. I wonder if D has a way to elegantly solve…
Tar
  • 8,529
  • 9
  • 56
  • 127
1
2
3
13 14