kexpr
wrapper for kexpr math expression evaluation library
Summary
| Latest Version | Unknown |
|---|---|
| License | MIT |
| CI Status | Passing |
| Downloads | 0 |
| Last Indexed | 2026-07-21 05:24 |
Tags
Installation
nimble install kexpr
choosenim install kexpr
git clone https://github.com/brentp/kexpr-nim
OS Compatibility
| Platform | Linux | macOS | Windows | FreeBSD | OpenBSD | NetBSD | Android | iOS | WASM | Embedded |
|---|---|---|---|---|---|---|---|---|---|---|
| kexpr | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Source
| Repository | https://github.com/brentp/kexpr-nim |
|---|---|
| Homepage | https://github.com/brentp/kexpr-nim |
| Documentation | View Documentation |
| Registry Source | nimble_official |
README
kexpr-nim
nim wrapper for Heng Li's kexpr math expression library
var e = expression("5*6+x > 20")
e["x"] = 10
echo e.int
e["x"] = 20
echo e.int64
assert e.error() == 0
e = expression("(sample1 > 20 & sample2 > 10 & sample3 < 40")
# missing paren
assert e.error() != 0
e.clear()
e = expression("(sample1 > 20) & (sample2 > 10) & (sample3 < 40)")
e["sample1"] = 21; e["sample2"] = 65; e["sample3"] = 20
echo e.int # 1
e["sample1"] = 0
echo e.int # 0
assert e.error() == 0
echo e.float # 0.0
installation
If you have nimble installed you can do:
nimble install kexpr
