autoderef
Syntax sugar which supports auto-dereferencing
Summary
| Latest Version | Unknown |
|---|---|
| License | MIT |
| CI Status | Failing |
| Downloads | 0 |
| Last Indexed | 2026-07-21 05:25 |
Tags
Installation
nimble install autoderef
choosenim install autoderef
git clone https://github.com/sls1005/autoderef
OS Compatibility
| Platform | Linux | macOS | Windows | FreeBSD | OpenBSD | NetBSD | Android | iOS | WASM | Embedded |
|---|---|---|---|---|---|---|---|---|---|---|
| autoderef | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Source
| Repository | https://github.com/sls1005/autoderef |
|---|---|
| Homepage | https://github.com/sls1005/autoderef |
| Registry Source | nimble_official |
README
Auto-deref
This implements a syntax sugar for the Nim programming language. With this module imported, ptr and ref variables will be dereferenced automatically. What it does is very similar to the effect of {.experimental: "implicitDeref".}.
Example
import autoderef
type Foo = object
a: int
proc get(self: var Foo): int =
inc(self.a)
return self.a
var f: ref Foo = new Foo
echo f.get() #instead of (f[]).get()
Note
- Please ensure that the variable to be auto-dereferenced does not point to
nil.