wisp/src/value.rs

19 lines
432 B
Rust
Raw Normal View History

2022-07-20 17:56:00 -05:00
use crate::list::List;
use ordered_float::OrderedFloat;
2022-07-20 18:08:40 -05:00
use std::collections::BTreeMap;
2022-07-20 17:56:00 -05:00
/// A Wisp value
#[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub enum Value {
List(Box<List>),
Vector(Vec<Self>),
2022-07-20 18:08:40 -05:00
Map(BTreeMap<Self, Self>),
2022-07-20 17:56:00 -05:00
Symbol(String),
Keyword(String),
Function { args: Vec<Value>, body: Box<Value> },
Bool(bool),
Number(OrderedFloat<f64>),
String(String),
Nil,
}