letUtils

A few handy macros for those who prefer `let` over `var`

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version 1.1.2
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:25

Authors

  • Nickolay Bukreyev

Installation

nimble install letUtils
choosenim install letUtils
git clone https://github.com/SirNickolas/let-utils-nim

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
letUtils - - - - - - -

Dependencies

Package Version Optional
nim >= 0.19.0 No

Source

Repository https://github.com/SirNickolas/let-utils-nim
Homepage https://github.com/SirNickolas/let-utils-nim
Registry Source nimble_official

README

letUtils

Immutability is good. But one day I got tired of repeating variable names over and over again:

let fib = block: # OK, we are going to declare `fib`.
  var fib = @[0, 1] # I already got it will be `fib`, thanks.
  for i in 2 ..< 13:
    fib &= fib[^1] + fib[^2]
  fib # Once again? Really?

So I wrote a bunch of macros that handle the boilerplate. Now we can do this:

import letUtils

freezeVars:
  var fib = @[0, 1]
  for i in 2 ..< 13:
    fib &= fib[^1] + fib[^2]

echo fib
assert not compiles (fib[0] = 123)

Look at the documentation for more goodies.