2024-04-06 18:44:58 +00:00
|
|
|
#ifndef SK_NFUN_H
|
|
|
|
#define SK_NFUN_H
|
|
|
|
|
|
|
|
#include "commons.h"
|
|
|
|
#include "state.h"
|
|
|
|
|
2024-04-10 08:53:07 +00:00
|
|
|
typedef SK (*nfun_body)(struct state*, struct sym*, struct vec*);
|
2024-04-06 18:44:58 +00:00
|
|
|
|
|
|
|
struct nfun
|
|
|
|
{
|
|
|
|
nfun_body body;
|
2024-04-07 03:23:59 +00:00
|
|
|
int arity;
|
2024-04-06 18:44:58 +00:00
|
|
|
};
|
|
|
|
|
2024-04-07 03:23:59 +00:00
|
|
|
void nfun_init(struct nfun* self, nfun_body body, int arity);
|
2024-04-06 18:44:58 +00:00
|
|
|
void nfun_free(struct nfun* self);
|
|
|
|
|
|
|
|
SK nfun_call(struct nfun* self,
|
|
|
|
struct state* state,
|
2024-04-10 08:53:07 +00:00
|
|
|
struct sym* sym,
|
2024-04-06 18:44:58 +00:00
|
|
|
struct vec* args);
|
|
|
|
#endif
|