Re: Bug 4689 & deprecating limroot
Raymond Toy <[email protected]> Wed, 27 May 2026 13:45:50 -0700
| Newsgroups | gmane.comp.mathematics.maxima.general |
|---|---|
| Message-ID | <[email protected]> |
On 5/27/26 12:42 PM, Stavros Macrakis wrote: > I see that *defmfun / deprecated-p *gives a warning at runtime. > Wouldn't it be better to give a warning at compile time? |defmfun| is for functions that a user might call. If it’s done at compile-time, no user will ever know that the function is deprecated. Hence, it happens at run-time. This reminds me that there are a few deprecated functions that I said I would remove after a release. Well, there was a release not long ago, so it’s time to make them go away for real. It would be kind of nice if there were a end-of-life date for the deprecated function so that we would get an error if we tried to compile the function after the end-of-life date. On the other hand, that’s just more random code to maintain with rather limited utility. > SBCL provides the *sb-ext:deprecated* declaration, which allows the > compiler to issue a warning or error. > I don't know if other implementations offer that, but it can be > emulated using *warn *at macro-expansion time. > > On Wed, May 27, 2026 at 8:25 AM David Scherfgen via Maxima-discuss > <[email protected]> wrote: > > For defmfun, there's a :deprecated keyword argument, if I remember > correctly. For purely internal functions, we could create a macro > like defun-deprecated for defining a function that raises the error. > > Barton Willis via Maxima-discuss > <[email protected]> schrieb am Mi., 27. Mai > 2026, 14:05: > > To fix bug 4689 <https://sourceforge.net/p/maxima/bugs/4689/>, > I revised the cryptically named function |colexpt|. The > revised code no longer requires the function |limroot|. Since > |limroot| is not called by any other function and does not > appear to be generally useful, I propose to deprecating it. > Accordingly, I propose replacing > > (defun limroot (exp power) > (cond ((or (atom exp) (not (member (caar exp) '(mtimes > mexpt) :test #'eq))) > > (limroot (list '(mexpt) exp 1) power)) ;This is strange-JIM. > ((mexptp exp) (m^ (cadr exp) > (sratsimp (m* (caddr exp) (m^ power -1.))))) > (t (m*l (mapcar #'(lambda (x) > (limroot x power)) > (cdr exp)))))) > > with > > (defun limroot (&rest args) > "limroot is deprecated and no longer available." > (declare (ignore args)) > (merror "limroot is deprecated and no longer available.")) > > If anyone has an emotional attachment to |limroot|, speak now > or forever hold your peace. There is always the possibility > that someone has 1970s-era code on a floppy disk in a sock > drawer that still calls it. > More seriously: Maxima does not have a uniform mechanism for > deprecating functions. If anyone has suggestions for a better > approach, I’m happy to hear them. > > --Barton > > > > _______________________________________________ > Maxima-discuss mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > > _______________________________________________ > Maxima-discuss mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > > > > _______________________________________________ > Maxima-discuss mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/maxima-discuss ​ _______________________________________________ Maxima-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/maxima-discuss