Re: Bug 4689 & deprecating limroot

Stavros Macrakis <[email protected]> Wed, 27 May 2026 15:42:53 -0400
Newsgroups gmane.comp.mathematics.maxima.general
Message-ID <CACLVabVe4Ds9bEbB9kf50w2rCpKsps22z1RjK-cYOUy4DobphQ@mail.gmail.com>
I see that *defmfun / deprecated-p *gives a warning at runtime.
Wouldn't it be better to give a warning at compile time?
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