Struct nock::Noun [] [src]

pub struct Noun { /* fields omitted */ }

A Nock noun, the basic unit of representation.

A noun is an atom or a cell. An atom is any natural number. A cell is any ordered pair of nouns.

Atoms are represented by a little-endian byte array of 8-bit digits.

Methods

impl Noun
[src]

Get a shape wrapper for the noun to examine its structure.

Pattern-match a noun with shape [p q r].

The digit sequence shows the branch length of each leaf node in the expression being matched. 122 has the leftmost leaf 1 step away from the root and the two leaves on the right both 2 steps away from the root.

Address of the noun's data in memory, usable as an unique identifier.

Nouns with the same address are always the same, but nouns with different addresses are not guaranteed to have different values.

Build a new atom noun from a little-endian 8-bit digit sequence.

Build a new cell noun from two existing nouns.

Build a noun from a convertible value.

Match noun if it's an atom that's a small integer.

Will not match atoms that are larger than 232, but is not guaranteed to match atoms that are smaller than 232 but not by much.

Run a memoizing fold over the noun.

Each noun with an unique memory address will only be processed once, so the fold method allows efficient computation over nouns that may be extremely large logically, but involve a great deal of reuse of the same subnoun objects in practice.

Print the complete noun, even if it's very large.

Print a truncated noun.

Trait Implementations

impl Clone for Noun
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Noun
[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 Noun
[src]

impl Default for Noun
[src]

Returns the "default value" for a type. Read more

impl Hash for Noun
[src]

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

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

impl FromIterator<Noun> for Noun
[src]

Creates a value from an iterator. Read more

impl FromNoun for Noun
[src]

Try to convert a noun to an instance of the type.

impl ToNoun for Noun
[src]

impl FromStr for Noun
[src]

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

impl Display for Noun
[src]

Formats the value using the given formatter. Read more

impl Debug for Noun
[src]

Formats the value using the given formatter.