lisp-take-1/value/user_lambda/new.c
2024-11-28 18:36:25 -06:00

50 lines
712 B
C

#include <debug.h>
#include "../struct.h"
#include "../new.h"
#include "../kind.h"
#include "struct.h"
#include "inheritance.h"
#include "new.h"
struct value* new_user_lambda_value(
struct gc* gc,
struct value* environment,
struct value* parameters,
struct value* body)
{
ENTER;
struct value* super = new_value(
/* garbage collector/allocator: */ gc,
/* kind: */ vk_user_lambda,
/* inheritance: */ &user_lambda_value_inheritance);
struct user_lambda_value* this = &super->subclass.user_lambda;
this->environment = environment;
this->parameters = parameters;
this->body = body;
EXIT;
return super;
}