D cookbook : discover the advantages of programming in D with over 100 incredibly effective recipes
- Author/Creator:
- Ruppe, Adam D., author
- Publication/Creation:
- Birmingham, England : Packt Publishing, 2014
- Resource Type:
- Book
- Edition:
- 1st ed.
More Details
Additional/Related Title Information
- Full Title:
- D cookbook : discover the advantages of programming in D with over 100 incredibly effective recipes / Adam D. Ruppe
Subjects/Genre
Description/Summary
- Table of Contents:
- Cover; Copyright; Credits; Foreword; About the Author; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Core Tasks; Introduction; Installing the compiler and writing a ""Hello World"" program; Adding additional modules (files) to your program; Using external libraries; Building and processing arrays; Using associative arrays to translate input; Creating a user-defined vector type; Using a custom exception type; Understanding immutability; Slicing a string to get a substring; Creating a tree of classes; Chapter 2: Phobos - The Standard Library; Introduction
Performing type conversionsFinding the largest files in a directory; Creating a network client and server; Using Base64 to create a data URI; Generating random numbers; Normalizing a string and performing Unicode comparisons; Searching with regular expressions; Writing a digest utility; Using std.zlib compression; Using the std.json module; Chapter 3: Ranges; Introduction; Using ranges when implementing an algorithm; Creating an input range; Creating an output range; Creating a higher-order range; Putting a range interface on a collection; Creating an input range over a tree structure
Using runtime polymorphic (class) rangesStoring a range as a data member; Sorting ranges efficiently; Searching ranges; Using functional tools to query data; Chapter 4: Integration; Introduction; Calling the Windows API functions; Removing the Windows console; Making Linux system calls; Writing part of a C program in D; Interfacing with C++; Using structs to mimic the C++ object structure; Communicating with external processes; Communicating with a dynamic scripting language; Using Windows' COM; Chapter 5: Resource Management; Introduction; Avoiding the garbage collector
Making a reference-counted objectManually managing class memory; Using scope guards to manage transactions; Creating an array replacement; Managing lent resources; Creating a NotNull struct; Using unique pointers; Using RAII and handling the limitations of class destructors; Chapter 6: Wrapped Types; Introduction; Creating a struct with reference semantics; Simulating inheritance with structs; Creating a ranged integer; Creating an opaque handle type; Creating a subtyped string for i18n; Forwarding methods with opDispatch; Creating a tagged dynamic type
Creating a structure with two views into the same dataSimulating multiple inheritance with mixin templates; Chapter 7: Correctness Checking; Introduction; Using assertions and exceptions; Using static assert; Using template constraints and static if; Preventing memory corruption bugs with @safe; Leveraging const-correctness; Avoiding side effects of pure functions; Verifying object invariants and pre- and post-conditions; Unit testing your code; Documenting your code with Ddoc; Writing platform-specific code (versions) and per-client configuration modules; Chapter 8: Reflection; Introduction
Getting dynamic runtime type information - Summary:
- A recipe-packed reference guide filled with practical tasks that are concisely explained to develop and broaden the user's abilities with the D programming language. If you are an experienced programmer who is looking to explore a language that offers plenty of advantages over more established programming languages, this is the book for you. We assume that you are already familiar with general programming language basics, but you do not need to be a proficient user of D.
- Language:
- English
- Language Note:
- English
- Physical Type/Description:
- 1 online resource (362 p.)
- General Note:
- "Quick answers to common problems."
Includes index.
Additional Identifiers
- Catalog ID (MMSID):
- 9936718544202486
- ISBN:
- 1-78328-722-5
- OCLC Number:
- 881035342
Tools
- Cite
- Export as RIS
-
Direct Link
Direct Link
Direct Link URL
- Staff View