Struct lamcal::environment::Binding[][src]

pub struct Binding { /* fields omitted */ }

A binding definition.

It represents a lambda term bound to a name. Bindings are stored in an environment. When evaluating lambda terms names bound terms are looked up by name and replace the name with the bound term.

Bindings can be constructed programmatically using Binding::new or the more convenient function bind.

The parser of this crate also supports bindings. In the syntax of the parser bindings are defined by let statements. For more details see the parse function and the the parser chapter in the crate documentation.

Methods

impl Binding
[src]

Constructs a new Binding of given term to the given name.

Deconstruct this binding into its name and the bound term and returns both as a tuple.

Returns a reference to the name of this binding.

Returns a reference to the term that is bound by this binding's name.

Trait Implementations

impl FromIterator<Binding> for Environment
[src]

Creates a value from an iterator. Read more

impl Extend<Binding> for Environment
[src]

Extends a collection with the contents of an iterator. Read more

impl Debug for Binding
[src]

Formats the value using the given formatter. Read more

impl Clone for Binding
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Binding
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Binding
[src]

impl Hash for Binding
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Display for Binding
[src]

Formats the value using the given formatter. Read more

impl From<(VarName, Term)> for Binding
[src]

Performs the conversion.

Auto Trait Implementations

impl Send for Binding

impl Sync for Binding