Function proto_vulcan::relation::cons [−][src]
pub fn cons<U, E, G>(
first: LTerm<U, E>,
rest: LTerm<U, E>,
out: LTerm<U, E>
) -> InferredGoal<U, E, G> where
U: User,
E: Engine<U>,
G: AnyGoal<U, E>,
Expand description
A relation such that the out
parameter is equal to rest
parameter appended to first
parameter. The first
parameter is the head of the list out
and the rest
is the tail.
Example
extern crate proto_vulcan;
use proto_vulcan::prelude::*;
use proto_vulcan::relation::cons;
fn main() {
let query = proto_vulcan_query!(|q| {
cons(1, [2, 3], q)
});
assert!(query.run().next().unwrap().q == lterm!([1, 2, 3]));
}