Blyx Nest Blyx language
Registry / Framework
framework · v0.1.2

Inspection Lot

Release, reject or rework a lot based on observed defects and its configured acceptance limit.

Source repository · Package JSON

Use Inspection Lot

use vendor::inspection_lot::inspection_lot;

Run the example

nest demo inspection_lot@0.1.2
blyxc native-run inspection_lot-demo/main.blyx
Example source and expected output
use std::cli;
use std::text;
use vendor::inspection_lot::inspection_lot;

fn main() {
    let arguments = cli_args();
    if args_len(arguments) > 0 {
        if args_len(arguments) % 2 != 0 {
            stderr_line("Expected event and value pairs");
            process_exit(2);
        }
        let mut live = inspection_lot_start();
        let mut i = 0;
        while i < args_len(arguments) {
            let input = args_at(arguments, i + 1);
            if !text_is_number(input) {
                stderr_line("Expected a whole numeric event value");
                process_exit(2);
            }
            live = inspection_lot_step(live, args_at(arguments, i), text_number(input));
            let command = inspection_lot_command(live);
            println!(command);
            if command == "reject" { process_exit(1); }
            i += 2;
        }
        return;
    }
    let mut state = inspection_lot_start();
    state = inspection_lot_step(state, "limit", 2.0);
    println!(inspection_lot_command(state));
    state = inspection_lot_step(state, "defects", 4.0);
    println!(inspection_lot_command(state));
    state = inspection_lot_step(state, "retest", 0.0);
    println!(inspection_lot_command(state));
    state = inspection_lot_step(state, "defects", 1.0);
    println!(inspection_lot_command(state));
}

Expected output

inspect_lot
segregate_lot
inspect_lot
release_lot

Published versions

VersionPackageSource commitSHA-256
0.1.2Download ZIP · Browse filesdc2e371b451463548d2a8a7bd5c36337513dd6b48a49fcec4de79adbd4b9eba20d2024195e
0.1.1Download ZIP · Browse files0252500138c5cdbdf6d8ddc382785081037b8fa63861e8e1b538589fd1375762859e5ae281
0.1.0Download ZIP · Browse files6349f23784b52d3d466b40d2fd8b897c7768c6303f84e9027cc76a19a8dd2f181fca8200d4