Clean some stuff up

This commit is contained in:
2026-01-29 21:42:47 -08:00
parent e5def8a0ad
commit a76e6a335d
3 changed files with 28 additions and 31 deletions

View File

@@ -21,13 +21,16 @@ struct LambdaList {
};
#define MAX_NATIVE_FUNCTION_ARGS 5
union native_function {
LispVal *(*zero)(void);
LispVal *(*one)(LispVal *);
LispVal *(*two)(LispVal *, LispVal *);
LispVal *(*three)(LispVal *, LispVal *, LispVal *);
LispVal *(*four)(LispVal *, LispVal *, LispVal *, LispVal *);
LispVal *(*five)(LispVal *, LispVal *, LispVal *, LispVal *, LispVal *);
struct native_function {
bool no_eval_args;
union {
LispVal *(*zero)(void);
LispVal *(*one)(LispVal *);
LispVal *(*two)(LispVal *, LispVal *);
LispVal *(*three)(LispVal *, LispVal *, LispVal *);
LispVal *(*four)(LispVal *, LispVal *, LispVal *, LispVal *);
LispVal *(*five)(LispVal *, LispVal *, LispVal *, LispVal *, LispVal *);
} addr;
};
struct interp_function {
@@ -40,18 +43,13 @@ typedef enum {
FUNCTION_INTERP,
} LispFunctionType;
struct function_flags {
LispFunctionType type : 2;
unsigned int no_eval_args : 1;
};
DEFOBJTYPE(Function, FUNCTION, FUNCTIONP, {
LispVal *name; // symbol (or nil for a lambda)
struct function_flags flags;
LispFunctionType type;
struct LambdaList args;
LispVal *docstr;
union {
union native_function native;
struct native_function native;
struct interp_function interp;
} impl;
});