Enum oftlisp::Value
[−]
[src]
pub enum Value<C: 'static + Context> { AtomicWord(AtomicIsize, C::ValueMeta), BuiltinFunction(Symbol, C::BuiltinFunction, C::ValueMeta), Byte(u8, C::ValueMeta), Bytes(Gc<Vec<u8>>, C::ValueMeta), Cons(Gc<Value<C>>, Gc<Value<C>>, C::ValueMeta), Fixnum(isize, C::ValueMeta), Func(Option<Symbol>, Gc<Args<C>>, C::UserFunction, C::ValueMeta), Object(C::ObjectVtable, Vec<Gc<Value<C>>>, C::ValueMeta), Nil(C::ValueMeta), String(Gc<String>, C::ValueMeta), Symbol(Symbol, C::ValueMeta), Vector(Vec<Gc<Value<C>>>, C::ValueMeta), }
A single OftLisp value.
Variants
AtomicWord(AtomicIsize, C::ValueMeta)
A mutable, signed, machine-sized integer.
BuiltinFunction(Symbol, C::BuiltinFunction, C::ValueMeta)
A built-in function.
Byte(u8, C::ValueMeta)
An unsigned 8-bit integer.
Bytes(Gc<Vec<u8>>, C::ValueMeta)
A vector of arbitrary bytes, not subject to the UTF-8 condition of Strings.
Cons(Gc<Value<C>>, Gc<Value<C>>, C::ValueMeta)
A cons cell, used to create lists, trees, and other data structures.
Fixnum(isize, C::ValueMeta)
A signed machine-sized integer.
Func(Option<Symbol>, Gc<Args<C>>, C::UserFunction, C::ValueMeta)
A user-defined function.
Object(C::ObjectVtable, Vec<Gc<Value<C>>>, C::ValueMeta)
The object type, containing a vtable and values.
Nil(C::ValueMeta)
The nil literal, used to terminate lists and signal failure (or the lack of interesting results).
String(Gc<String>, C::ValueMeta)
A UTF-8 string.
Symbol(Symbol, C::ValueMeta)
An interned symbol, which may be compared in O(1).
Vector(Vec<Gc<Value<C>>>, C::ValueMeta)
A fixed-length collection with O(1) lookup.
Methods
impl<C: 'static + Context> Value<C>
[src]
fn bool(b: bool) -> Gc<Value<C>>
[src]
A pseudo-constructor that converts a bool
to a Value
.
fn improper_list<II: IntoIterator<Item = Gc<Value<C>>>>(
iter: II,
last: Gc<Value<C>>,
meta: C::ValueMeta
) -> Gc<Value<C>>
[src]
iter: II,
last: Gc<Value<C>>,
meta: C::ValueMeta
) -> Gc<Value<C>>
Converts an Iterator
and a last element to an improper cons-list.
fn list<II: IntoIterator<Item = Gc<Value<C>>>>(
iter: II,
meta: C::ValueMeta
) -> Gc<Value<C>>
[src]
iter: II,
meta: C::ValueMeta
) -> Gc<Value<C>>
Converts an Iterator
to a cons-list.
fn meta(&self) -> C::ValueMeta
[src]
Extracts the metadata from a Value
.
fn ordering(o: Option<CmpOrdering>) -> Gc<Value<C>>
[src]
Converts an ordering to a Value
.
fn transmute_with<C2, F>(&self, f: &F) -> Option<Value<C2>> where
C2: 'static + Context,
F: Fn(&C::ValueMeta) -> Option<C2::ValueMeta>,
[src]
C2: 'static + Context,
F: Fn(&C::ValueMeta) -> Option<C2::ValueMeta>,
Converts a Value
between Context
s.
Will fail to transmute functions and objects.
fn transmute_data<C2: 'static + Context>(&self) -> Option<Value<C2>>
[src]
Converts a Value
between Context
s.
Will fail to transmute functions and objects. Any metadata will be
discarded, with the default for the destination being used. To preserve
metadata, use transmute_with
instead.
fn vector<II: IntoIterator<Item = Gc<Value<C>>>>(iter: II) -> Gc<Value<C>>
[src]
Converts an Iterator
to a vector.
Trait Implementations
impl<C: 'static + Context> Finalize for Value<C>
[src]
impl<C: 'static + Context> Trace for Value<C>
[src]
unsafe fn trace(&self)
[src]
Marks all contained Gc
s.
unsafe fn root(&self)
[src]
Increments the root-count of all contained Gc
s.
unsafe fn unroot(&self)
[src]
Decrements the root-count of all contained Gc
s.
fn finalize_glue(&self)
[src]
Runs Finalize::finalize() on this object and all contained subobjects Read more
impl<C: 'static + Context> Drop for Value<C>
[src]
impl<C: 'static + Context> Clone for Value<C>
[src]
fn clone(&self) -> Self
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<C: 'static + Context> Debug for Value<C>
[src]
impl<C: 'static + Context> Display for Value<C>
[src]
fn fmt(&self, fmt: &mut Formatter) -> FmtResult
[src]
Formats the value using the given formatter. Read more
impl<C: 'static + Context> PartialEq for Value<C>
[src]
fn eq(&self, other: &Self) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<C: 'static + Context> PartialOrd for Value<C>
[src]
fn partial_cmp(&self, other: &Self) -> Option<CmpOrdering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more