Limit search to available items
Book Cover
E-book
Author D. Ruppe, Adam

Title D Cookbook
Published Packt Publishing, 2014

Copies

Description 1 online resource
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
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
Notes Print version record
Subject D -- Research
Object-oriented programming languages -- Congresses
Object-oriented programming languages
Genre/Form Conference papers and proceedings
Form Electronic book
ISBN 1306823366
9781306823364
9781783287222
1783287225