phobos Questions

2

A really interesting conference was given about D-Specific Design Patterns and in the D community, some people thought it could be a starting point for a book dealing about effective coding techniq...
Gleich asked 15/6, 2013 at 19:40

1

Solved

Here's simple code: import std.algorithm; import std.array; import std.file; void main(string[] args) { auto t = args[1].readText() .splitter('\n') .split("---") ; } Looks like it should wo...
Pruett asked 28/10, 2015 at 0:3

2

Solved

How to construct easily a raw byte-by-byte InputRange/ForwardRange/RandomAccessRange from a file?
Stockbroker asked 16/5, 2015 at 10:30

1

Solved

I'm about to write a parser to read a text file line by line into structs of different types and giving these structs to a callback (observer or visitor - not sure yet). The text file contains MT-...
Farthingale asked 4/8, 2014 at 19:59

2

Solved

I've just begun looking at the phobos source, and it's littered with several different styles and commented out code. The style guide on the web side is very small, and I only found broken links f...
Monicamonie asked 13/8, 2010 at 20:12

1

Solved

Recently I have taken an interest in the D programming language. I just started learning it, and am coming from a C++ background. I am wondering if there is an equivalent of std::remove_if. I only ...
Rightist asked 2/7, 2013 at 7:54

1

Solved

I repeadetly need to concatenate of format strings, and is wondering what is the shortest (or easiest to read) way to concatenate strings outside of the writefln() function, in D? That is, I like ...
Rolandrolanda asked 2/1, 2013 at 11:39

8

Solved

I've decided to learn D, and I'm wondering which standard library I should use. Should I use Phobos or Tango? What are the pros and cons of each?
Lachrymose asked 28/3, 2009 at 22:34

1

Solved

I'm trying to use the slice operator to obtain a slice of the return value of the take function from std.range. My code: auto tempChunk = ['a', 'b', 'c', 'd']; auto a = tempChunk.take(3); writeln(...
Fortieth asked 22/10, 2012 at 15:47

1

Solved

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 )....
Sensuous asked 5/9, 2012 at 19:31

4

Solved

Whenever I try to use ranges in D, I fail miserably. What is the proper way to use ranges in D? (See inline comments for my confusion.) void print(R)(/* ref? auto ref? neither? */ R r) { foreach...
Mistook asked 25/6, 2012 at 13:21

3

Solved

If I import the std.c libaries instead of including the libraries in C, would C code compile with a D compiler, or are there other backwords compatibility issues?
Linkwork asked 2/6, 2012 at 16:21

3

Solved

How in D would I cast integer to string? Something like int i = 15 string message = "Value of 'i' is " ~ toString(i); // cast(string) i - also does not work Google brought me the answer on how ...
Collage asked 24/5, 2012 at 17:29

1

Solved

I am trying to make a pure function that embeds a number in a string. The obvious concatenation methods do not work: pure string foo(immutable int bar) { return "Number: " ~ bar; // Error: string...

4

Solved

I was fishing around in D's standard library looking for a Set implementation, and I only found these: BinaryHeap RedBlackTree These both would work fine, if I could only figure out how to use th...
Calumnious asked 11/12, 2011 at 1:41

1

Solved

I'm making my own little library of handy functions and I'm trying to follow Phobos's naming convention but I'm getting really confused. How do I know where things would fit? Example: If there was ...
Contagium asked 7/8, 2011 at 20:43

2

Solved

The D documentation seems to be a bit messy, and I'm not able to find this information anywhere on the official site. I'm needing some common exception types (e.g. NotFiniteNumberException, FileIOE...
Indented asked 20/5, 2011 at 8:0

2

Solved

Is there a simple, cross-platform way to get a single keystroke in D2 using Phobos? For instance, a "Press any key to continue..." prompt, or a Brainfuck interpreter. All the methods I've tried...
Mavilia asked 21/3, 2011 at 0:27

2

Solved

Is there any one-size-fits-all (more or less) way to read a text file in D? The requirement is that the function would auto-detect the encoding and give me the entire data of the file in a consist...
Cantara asked 17/1, 2011 at 21:14

1

Solved

Is it just me, or is there no binary search function in Phobos? I have a pre-sorted array that I want to search with my own comparator function, but I can't find anything in std.algorithms or std.c...
Oloughlin asked 7/1, 2011 at 3:54

3

Solved

I'm learning D, and am confused by an error I'm getting. Consider the following: module helloworld; import std.stdio; import std.perf; ptrdiff_t main( string[] args ) { auto t = new Performanc...
Plausible asked 23/10, 2010 at 22:2

2

Solved

Why does Phobos use enum to define constants? For example, in std.math: enum real E = 2.7182818284590452354L; Why not use a global immutable? What are the advantages/disadvantages of enum over i...
Vaclav asked 1/9, 2010 at 22:54

6

Solved

I'm wondering how mature and stable D is, and if it might be a good replacement for C/C++. I know that there are currently two standard libraries (Phobos and Tango). Is it still the case that ther...
Karafuto asked 8/7, 2010 at 15:54

4

Solved

There are two of them Phobos and Tango. As far as I know they are redundant and incompatible. Are there any plans to join them? If so, when will it happen?
Holbein asked 21/4, 2009 at 15:25
1

© 2022 - 2024 — McMap. All rights reserved.