Finished WIP (rebase this)
All checks were successful
per-push tests / build (push) Successful in 34s
per-push tests / test-frontend (push) Successful in 31s
per-push tests / test-utility (push) Successful in 36s
per-push tests / test-backend (push) Successful in 30s
per-push tests / timed-decomposer-parse (push) Successful in 34s

Signed-off-by: Ava Affine <ava@sunnypup.io>
This commit is contained in:
Ava Apples Affine 2025-07-26 05:19:20 +00:00
parent 1359ebdded
commit 63aa66952f
3 changed files with 151 additions and 107 deletions

View file

@ -39,18 +39,6 @@ use organelle::Number;
* function to pass around heap allocated Rcs.
*/
#[derive(Clone, PartialEq)]
pub enum Datum {
Number(Number),
Bool(bool),
Cons(Cons),
Symbol(String),
Char(u8),
String(Vec<u8>),
Vector(RefCell<Vec<Gc<Datum>>>),
ByteVector(RefCell<Vec<u8>>),
}
/* Gc
* This is a heap allocated Rc passed around such that it fits into
* a physical register. The pointer is to a Box<Rc<T>>, but custom
@ -78,6 +66,7 @@ impl<T: PartialEq> PartialEq for Gc<T> {
fn eq(&self, other: &Self) -> bool {
self.deref().eq(other.deref())
}
fn ne(&self, other: &Self) -> bool {
self.deref().ne(other.deref())
}
@ -143,6 +132,19 @@ impl<T: Clone> Gc<T> {
}
}
#[derive(Clone, PartialEq)]
pub enum Datum {
Number(Number),
Bool(bool),
Cons(Cons),
Symbol(String),
Char(u8),
String(Vec<u8>),
Vector(RefCell<Vec<Gc<Datum>>>),
ByteVector(RefCell<Vec<u8>>),
None
}
#[derive(Clone, PartialEq)]
pub struct Cons(pub Option<Gc<Datum>>, pub Option<Gc<Datum>>);