Macro adapton::fork [] [src]

macro_rules! fork {
    ( $nm:expr ) => { ... };
}

Wrappers for engine::fork_name.

Name forking

Sometimes one has a single name but wants more that are determined by it, deterministically:

use adapton::macros::*;
use adapton::engine::*;
manage::init_dcg();

// Run 1, start with `name_unit()`:
let u : Name = name_unit();
let (u1,u2) = fork!( u );
let (u3,u4) = fork!( u1 );

// Run 2, start with the same name, `name_unit()`:
let w : Name = name_unit();
let (w1,w2) = fork!( w );
let (w3,w4) = fork!( w1 );

// The name forks consist of the same names between runs 1 and 2:
assert_eq!(u2, w2);
assert_eq!(u3, w3);
assert_eq!(u4, w4);

In the context of incremental computation, the archivist names the output of their computation by the names of its input.