flint icon indicating copy to clipboard operation
flint copied to clipboard

No context for destructors of major types

Open tthsqe12 opened this issue 5 years ago • 1 comments

Many of the types taking a context (fq_nmod, fq_nmod_poly, ...) pretend that the context is required for destruction, possibly for consistency in the interface. Considering the fact that the ctx is not needed here, and nemo doesn't even provide the correct ctx to the _clear fxns, why don't we drop the pretense and get rid of this argument?

tthsqe12 avatar Jun 22 '20 08:06 tthsqe12

@fredrik-johansson This goes into a broader picture of unused arguments. I am for keeping unused arguments as long as it is kept for consistency and it is highlighted in the source code (but not necessarily the header file) that the argument is not used (e.g. FLINT_UNUSED).

However, I believe it is very wise to document that arguments are not needed in certain functions. But I think it would be not-so-clever to do this manually in case it changes in the future (i.e. it should be automated).

albinahlback avatar Oct 08 '24 10:10 albinahlback