lambda-calculus/value/lambda/new.c
2025-01-13 20:36:07 -06:00

37 lines
672 B
C

#include <debug.h>
#include <environment/inc.h>
#include <string/inc.h>
#include <expression/inc.h>
#include "../new.h"
#include "inheritance.h"
#include "struct.h"
#include "new.h"
struct value* new_lambda_value(
struct environment* environment,
struct string* variable_name,
struct expression* body)
{
ENTER;
struct lambda_value* this = (void*) new_value(
vk_lambda,
&lambda_value_inheritance,
sizeof(*this));
this->environment = inc_environment(environment);
this->variable_name = inc_string(variable_name);
this->body = inc_expression(body);
EXIT;
return (void*) this;
}