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

37 lines
664 B
C

#include <debug.h>
#include <string/inc.h>
#include "../struct.h"
#include "../new.h"
#include "struct.h"
#include "inheritance.h"
#include "new.h"
struct value* new_builtin_lambda_value(
struct gc* gc,
struct string* name,
builtin_funcptr_t funcptr)
{
ENTER;
struct value* super = new_value(
/* garbage collection/allocator: */ gc,
/* kind: */ vk_builtin_lambda,
/* inheritance: */ &builtin_lambda_value_inheritance);
struct builtin_lambda_value* this = &super->subclass.builtin_lambda;
this->name = inc_string(name);
this->funcptr = funcptr;
EXIT;
return super;
}