Skip to content

Commit

Permalink
v2.2.0
Browse files Browse the repository at this point in the history
This release adds several new features, and as such bumps the minor version.

Added `lu.traits.udaIndexOf`, upstreamed from importing projects.
It functions the same as `std.traits.hasUDA` in that you can use it to
tell whether a symbol is annotated with some attribute, but it incurs
less template bloat and lowers compilation memory required. As the name
implies, unlike `hasUDA` it returns the index of the attribute, or `-1`
if it doesn't exist, so it's not a direct drop-in replacement.

Added `lu.traits.stringOfTypeOf`, upstreamed from importing projects.
A simple template that aliases itself to the string name of a passed type,
or the string name of the type of a passed symbol.

Added `lu.array.zero`, upstreamed from importing projects. It allows for
zeroing out the internal `.data` array of a `std.array.Appender`.
This can be useful if these contain indirections, such as an
`Appender!(string[])` does, as a built-in call to `.clear()` would never
null the pointers, and the memory referenced would be considered live by
the garbage collector.

Added `lu.string.replaceFromAA`, upstreamed from importing projects.
It replaces all occurrences of `$tokens` in a string with values from an
associative array. The associative array must be keyed by the token
strings, and have values in the form of delegates (or functions) that in
turn return replacement strings. This is useful if you want to replace
many tokens in a string at the same time, and when organising them into
an associative array makes sense.

`lu.container.RehashingAA` was fleshed out, and while it can't be called
fully complete, it is now much more useful. Notably you can't `foreach`
over one as the `opApply` function isn't implemented, but the `.byKey`,
`.byValue` and `.byKeyValue` properties are in place and should in the
majority of cases be enough. If it isn't, you can always access the
underlying internal associative array directly via the `.aaOf` escape hatch.

* Refactored `escapeControlCharacters` and `removeControlCharacters` to
  copy (chunks of) the input string by slice instead of
  character-by-character
* Converted many template constraints into static asserts with
  descriptive messages
* Miscellaneous code cleanup
  • Loading branch information
zorael committed Jan 27, 2024
1 parent e1af3dc commit ce2ae5a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
# lu [![Linux/macOS/Windows](https://img.shields.io/github/actions/workflow/status/zorael/lu/d.yml?branch=master)](https://github.com/zorael/lu/actions?query=workflow%3AD) [![Linux](https://img.shields.io/circleci/project/github/zorael/lu/master.svg?logo=circleci&style=flat&maxAge=3600)](https://circleci.com/gh/zorael/lu) [![Windows](https://img.shields.io/appveyor/ci/zorael/lu/master.svg?logo=appveyor&style=flat&maxAge=3600)](https://ci.appveyor.com/project/zorael/lu) [![Commits since last release](https://img.shields.io/github/commits-since/zorael/lu/v2.1.0.svg?logo=github&style=flat&maxAge=3600)](https://github.com/zorael/lu/compare/v2.1.0...master)
# lu [![Linux/macOS/Windows](https://img.shields.io/github/actions/workflow/status/zorael/lu/d.yml?branch=master)](https://github.com/zorael/lu/actions?query=workflow%3AD) [![Linux](https://img.shields.io/circleci/project/github/zorael/lu/master.svg?logo=circleci&style=flat&maxAge=3600)](https://circleci.com/gh/zorael/lu) [![Windows](https://img.shields.io/appveyor/ci/zorael/lu/master.svg?logo=appveyor&style=flat&maxAge=3600)](https://ci.appveyor.com/project/zorael/lu) [![Commits since last release](https://img.shields.io/github/commits-since/zorael/lu/v2.2.0.svg?logo=github&style=flat&maxAge=3600)](https://github.com/zorael/lu/compare/v2.2.0...master)

Miscellaneous general-purpose library modules. Nothing extraordinary.

Expand Down
2 changes: 1 addition & 1 deletion source/lu/semver.d
Expand Up @@ -26,7 +26,7 @@ enum LuSemVer
/++
SemVer minor version of the library.
+/
minor = 1,
minor = 2,

/++
SemVer patch version of the library.
Expand Down

0 comments on commit ce2ae5a

Please sign in to comment.