Blyx Nest Blyx language
Registry / Library
library · v0.1.0

StockLedger

Reconcile on-hand inventory with individual outstanding reservations.

Source repository · Package JSON

Use StockLedger

use vendor::stockledger::stockledger;

Run the example

nest demo stockledger@0.1.0
blyxc native-run stockledger-demo/main.blyx
Example source and expected output
use vendor::stockledger::stockledger;

fn main() {
    let onhand = 10.0;
    let holds = [2, 3];
    let result = stockledger_balance(onhand, holds);
    if len(result) == 0 { println!("invalid"); return; }
    let mut i = 0;
    while i < len(result) {
        println!(at(result, i));
        i += 1;
    }
}

Expected output

5
0

Published versions

VersionPackageSource commitSHA-256
0.1.0Download ZIP1aabeffc9c4a99a9a321b6c8afe1ad2fa47ca599dcb4f551cc9569e2068e162968f6ad3829