mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2025-12-31 23:00:54 -08:00
New slot setter/reader for the C interface
This commit is contained in:
parent
7fd98105fb
commit
47ce3f53e5
2 changed files with 18 additions and 0 deletions
|
|
@ -291,3 +291,18 @@ cl_class_of(cl_object x)
|
|||
t = cl_find_class(1, Ct);
|
||||
@(return t)
|
||||
}
|
||||
|
||||
cl_object
|
||||
ecl_slot_value(cl_object x, const char *slot)
|
||||
{
|
||||
cl_object slot_name = c_string_to_object(slot);
|
||||
return funcall(3, @'slot-value', x, slot_name);
|
||||
}
|
||||
|
||||
cl_object
|
||||
ecl_slot_value_set(cl_object x, const char *slot, cl_object value)
|
||||
{
|
||||
cl_object slot_name = c_string_to_object(slot);
|
||||
cl_object slot_setter = c_string_to_object("(SETF SLOT-VALUE)");
|
||||
return funcall(4, ecl_fdefinition(slot_setter), value, x, slot_name);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -682,6 +682,9 @@ extern cl_object ecl_allocate_instance(cl_object clas, cl_index size);
|
|||
extern cl_object ecl_instance_ref(cl_object x, cl_fixnum i);
|
||||
extern cl_object ecl_instance_set(cl_object x, cl_fixnum i, cl_object v);
|
||||
extern cl_object si_copy_instance(cl_object x);
|
||||
|
||||
extern cl_object ecl_slot_value(cl_object x, const char *slot);
|
||||
extern cl_object ecl_slot_value_set(cl_object x, const char *slot, cl_object y);
|
||||
#endif /* CLOS */
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue