Initial commit

This commit is contained in:
2025-09-03 03:20:58 -07:00
commit 1e16b4d34e
20 changed files with 455 additions and 0 deletions

42
include/lisp/number.h Normal file
View File

@ -0,0 +1,42 @@
#ifndef INCLUDED_NUMBER_H
#define INCLUDED_NUMBER_H
#include "lisp/object.h"
#include "lisp/util.h"
LISP_BEGIN_DECLS
DECLARE_CLASS(Number);
DECLARE_CLASS(Float);
DECLARE_CLASS(Integer);
struct Number {
Object base;
};
struct NumberClass {
Class base;
Object *(*add)(Object *self, Object *other);
Object *(*sub)(Object *self, Object *other);
};
struct Float {
Number base;
double value;
};
struct FloatClass {
NumberClass base;
};
struct Integer {
Number base;
int64_t value;
};
struct IntegerClass {
NumberClass base;
};
LISP_END_DECLS
#endif