1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
pub mod comp;
pub mod gc;
pub mod matrix;
pub mod hash;
pub mod exception;
pub mod function;
pub mod fmt;
pub mod index;
pub mod clone;
use crate::prelude::*;
#[derive(Clone)]
pub enum Value {
Nil,
Bool(bool),
Int(i64),
Float(f64),
Ratio(Rational64),
Complex(Complex64),
Regex(Rc<Regex>),
String(Rc<str>),
List(Gc<Vec<Value>>),
Matrix(Gc<Matrix>),
Table(Gc<ValueMap>),
Function(Rc<Function>),
Range(Rc<(i64, i64, bool)>),
Iter(Rc<Function>),
File(Rc<RefCell<File>>),
Exception(Exception),
}
impl From<&str> for Value {
fn from(value: &str) -> Self {
Value::String(Rc::from(value))
}
}
|