blc 0.6.0

An implementation of the binary lambda calculus.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
extern crate blc;

use blc::*;
use blc::encoding::binary::decompress;
use blc::execution::Input;

#[test]
// program code from https://tromp.github.io/cl/Binary_lambda_calculus.html#A_quine
fn repeat() {
    let code_compressed = [0x16, 0x46, 0x80, 0x05, 0xbc, 0xbc, 0xfd, 0xf6, 0x80];
    let code_blc        = decompress(&code_compressed);

    assert_eq!(
        run(&*code_blc, Input::Bytes(&*b"hurr")).unwrap(),
        "hurrhurr"
    );
}