put more stuff in consutils

This commit is contained in:
2023-12-26 11:45:25 +01:00
parent 58f56f158d
commit 4513ec82aa
6 changed files with 74 additions and 71 deletions

View File

@@ -9,11 +9,12 @@
#include <cstdint>
enum class CellType {
NIL,
INT,
CONS
};
using CellValType = int64_t;
struct Cell {
explicit Cell(CellType type) : _type(type) {}
virtual ~Cell() = 0;
@@ -24,9 +25,9 @@ struct Cell {
struct ValueCell : public Cell {
ValueCell() = delete;
explicit ValueCell(int64_t val) : Cell(CellType::INT), _val(val) {}
explicit ValueCell(CellValType val) : Cell(CellType::INT), _val(val) {}
int64_t _val;
CellValType _val;
};
struct ConsCell : public Cell {