[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua library api style recommendations
- From: siiky <github-siiky@...>
- Date: Fri, 5 May 2023 23:30:41 +0100
I recently had this exact problem in a C library I'm working on. In the
end I went with something like the following:
// `d` for "destructive"
void foo_do_something_d (foo *a, foo *b)
{
// do something with a and b...
}
void foo_do_something (foo *r, foo *a, foo *b)
{
foo_copy_to(r, a);
foo_do_something_d(r, b);
}
(Didn't reply to the list by mistake, sorry for the duplicate, Jorge)