#2747 variables are not local in share/numeric/interpol.mac

None
closed
nobody
interpol (1)
5
2014-06-07
2014-06-04
Sergey Litvinov
No

Some variables in share/numeric/interpol.mac are no local. An error can be triggered in the following way.

Maxima branch_5_33_base_11_ga62a528 http://maxima.sourceforge.net
using Lisp SBCL 1.1.11
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) load("interpol")$

(%i2) tab[any]:=error()$

(%i3) cspline([1, 2, 3], [1, 2 ,3]);

#0: lambda([any],error())(any=2)
#1: cspline(tab=[1,2,3],select=[[1,2,3]])(interpol.mac line 230)
 -- an error. To debug this try: debugmode(true);

Please consider a patch attached to fix this.

1 Attachments

Discussion

    • status: open --> closed
     
  • Bug fixed. Let me know if you have problems
    Thanks for the report.

    --
    Mario

     
  • Thank you for the prompt replay and a bug fix.

    I think your commit makes cspline and other functions work on a copy
    of the input list(s). So list(s) user passes arguments are not
    modified. This certainly prevents many problems.

    But it is also safer to make all symbols one uses in subscripted
    expression local (see a patch in the attachments to the bug
    report).

    Otherwise the functions are confused if a subscripted function with
    the same name is defined. With the last version I can have

    Maxima branch_5_33_base_98_g62595e9_dirty http://maxima.sourceforge.net
    using Lisp SBCL 1.1.14.debian
    Distributed under the GNU Public License. See the file COPYING.
    Dedicated to the memory of William Schelter.
    The function bug_report() provides bug reporting information.
    
    (%i1) load("interpol")$
    (%i2) tab2[any]:=error()$
    (%i3) cspline([1,2,3], [1, 2, 3])$
    
    #0: lambda([any],error())(any=2)
    #1: cspline(tab=[1,2,3],select=[[1,2,3]])(interpol.mac line 230)
    -- an error. To debug this try: debugmode(true);