Clean some stuff up
This commit is contained in:
@@ -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;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user