Initial commit
This commit is contained in:
42
include/lisp/number.h
Normal file
42
include/lisp/number.h
Normal 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
|
Reference in New Issue
Block a user