Added dot-pair type
This commit is contained in:
parent
35676865b0
commit
e92e1e3f7c
|
@ -1,7 +1,9 @@
|
|||
mod function;
|
||||
mod pair;
|
||||
mod string;
|
||||
|
||||
pub use function::Function;
|
||||
pub use pair::DotPair;
|
||||
pub use string::Str;
|
||||
|
||||
use std::{collections::BTreeMap, rc::Rc};
|
||||
|
@ -10,7 +12,7 @@ pub type OrderedF64 = ordered_float::OrderedFloat<f64>;
|
|||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum Value<'s> {
|
||||
List(/* TODO: List impl (or dotted pair) */),
|
||||
DotPair(Rc<DotPair<'s>>),
|
||||
Vector(Rc<Vec<Self>>),
|
||||
Map(Rc<BTreeMap<Self, Self>>),
|
||||
Symbol(Str<'s>),
|
||||
|
@ -19,4 +21,5 @@ pub enum Value<'s> {
|
|||
String(Str<'s>),
|
||||
Function(Function),
|
||||
Macro(Function),
|
||||
Nil,
|
||||
}
|
||||
|
|
4
src/interpreter/value/pair.rs
Normal file
4
src/interpreter/value/pair.rs
Normal file
|
@ -0,0 +1,4 @@
|
|||
use super::Value;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct DotPair<'s>(pub Value<'s>, pub Value<'s>);
|
Loading…
Reference in a new issue