knave 0.12.5

A Lisp programming language for humans and agents that infers types and ownership and compiles to readable Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::ptr;

use crate::types::TypedLambda;

// An address names one lambda only while that lambda stays alive: drop every
// address before a lambda it names can be freed, or a new lambda can take it.
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
pub struct LambdaAddress(*const TypedLambda);

impl LambdaAddress {
    pub fn of(lambda: &TypedLambda) -> Self {
        Self(ptr::from_ref(lambda))
    }
}