alid 0.1.4

'cached' that stores elements of InputRanges as ForwardRanges efficiently, and other modules


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:


This package provides sub packages which can be used individually:

alid:blockreusable - Reusable block of elements that can emplace and moveEmplace

alid:cached - Range algorithm to cache elements of InputRanges and present them as ForwardRanges with opIndex

alid:circularblocks - Expanding circular buffer that uses array of blocks of memory

alid:errornogc - Defining and throwing of Error subclasses inside @nogc code

alid:test - Unit test helpers

Introduction

This repository is a collection of D modules written by Ali Çehreli.

Name

The package name alid is a combination of "Ali" and "D".

History

It started with cached which was based on an old idea of Ali's that rested for more than ten years. Ali decided to revisit the idea when a piece of D code--written by Janis, a friend and colleague--produced surprising results. The surprises were due to side effects in a generator function similar to the map lambda in the following code:

    auto r = iota(n)
             .map!((i) {
                     arr ~= i;     // <-- A side effect (adds to an array)
                     return i;
                 })
             .filter!(i => true);  // <-- Side effect is repeated

Every access to the generated "element" down the execution chain repeats the side effect, adding one more element to the array in the code above.

cached is for executing elements only once while not holding on to already popFront'ed elements for too long. cached was the main topic of Ali's DConf 2022 lightning talk.

circularblocks was written for storing range elements by cached. It can be used independently.

blockreusable was written as storage blocks for circularblocks. It can be used independently.

errornogc was needed for throwing Errors from @nogc code. It can be used independently.

test contains some helper utilities for unit testing.

Authors:
  • Ali Çehreli
Sub packages:
alid:blockreusable, alid:cached, alid:circularblocks, alid:errornogc, alid:test
Dependencies:
none
Versions:
0.1.6 2022-Oct-04
0.1.5 2022-Sep-23
0.1.4 2022-Sep-15
0.1.3 2022-Sep-15
0.1.2 2022-Sep-14
Show all 8 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 23 downloads total

Score:
0.8
Short URL:
alid.dub.pm