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…
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…
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…
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…
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.
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)…
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…
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…
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…
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…
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…
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…
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]);
…
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…
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…