Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [d]

D is a systems programming language developed by Walter Bright and since 2006 Andrei Alexandrescu. Its focus is on combining the power and high performance of C and C++ with the programmer productivity of modern languages like Ruby and Python. Special attention is given to the needs of concurrency, reliability, documentation, quality assurance, management and portability.

0
votes
1answer
22 views

A D wrapper around a C function

Any problems with this D wrapper around libcomcom_run_command() C function from C library libcomcom? Does it work as expected? Is it idiomatic? Is it the right way ...
1
vote
2answers
61 views

Recursive range iteration

I decided to do Advent of Code this year in D, and the following is my solution to day 8. Algorithm aside, I was specifically wondering if there was a better way to use ranges in a recursive manner ...
1
vote
0answers
51 views

Message loop handler functions, using associative array and using switch

I am using the Windows API to register system-wide hotkeys. This requires a message loop to be created, and a handler to handle the hotkey messages. I have written two pieces of functioning code. The ...
4
votes
1answer
55 views

Minimalist config file reader/writer

I have written a simple configuration file reader and writer in D that is intended to parse string[string] associative arrays (the whole file is one array) and ...
3
votes
1answer
41 views

D minMax function implementation

I happened to need to find both the maximum and the minimum of an array, so I decided to implement a minMax function in D. Questions: Is this an efficient ...
4
votes
1answer
67 views

Lexer for a small language in D

I am writing an interpreter for a simple mathematical programming language. Below is a simple program written in it that prints 41.22: ...
1
vote
0answers
141 views

Greedy solution to minimize the max-min spread

I wrote this solution to contest challenge and I am new to D and was hoping for some tips to make it faster or more Dish. The challenge is to select K integers from a list of N integers (2 ≤ N ≤ 105, ...
3
votes
0answers
136 views

D trie implementation

I just started to learn D and ported my a bit over-templated trie. It looks way better than on C++. I'm sure there is still room for improvement and to make it be real D code. I checked an the array ...
3
votes
2answers
119 views

Haskell's intersperse in D

I am learning D. I'm trying to implement Haskell's intersperse in D. I want to use ranges. I feel that the intermediate "interspersed" value is wrong. Additionally, I suspect the concatenation ...
3
votes
1answer
33 views

Journal Application in D

Started picking up D recently. I wrote an application to create journal entries (text files) based on user input. ...
5
votes
1answer
67 views

“event_foo” method event system in D

The goal is to be able to call an event_<name> method on an object if it implements it, or otherwise do nothing, without needing to explicitly define and ...
0
votes
1answer
125 views

Null-delimited to printf %b converter

I wrote a D implementation of the nul2pfb utility from here, as the link to the source code was broken and I wanted to try to learn D. I noticed that it was rather slow (could barely keep up with the ...
10
votes
1answer
864 views

C++ vs D - Algorithm Optimization/Conversion (Using vectors/arrays)

OK, I've been playing with D for a while (and been in love with its expressive power and simplicity, to be honest). However, since I'm still new to D, I'm facing a few issues. Let's take the ...
0
votes
2answers
283 views

How code be this piece of code be refactored?

I use DMD 1.056 with Tango 0.99.9 to build a GPX document using API. I am a beginner in D language. Usage DMD 1.056 with Tango 0.99.9 is compulsory as a requirement The GPX data are here hardcoded ...
10
votes
1answer
389 views

Mixin and template-heavy code for a Silverlight clone

I've made a mock version of Silverlight in D2. It is meant to output HTML, but since I don't know HTML yet, its current output is in. HTML is not the reason I'm here, though. The goal of my project ...