Menu

#152 Vector indices not working correctly

open
nobody
None
5
2018-02-13
2018-02-13
No

Hi,
I am trying BLT with Tcl 8.6 and have found that the following expression is broken (or at least changed since BLT2.4z)

[test12 1:14] ~> tclsh8.6
tclsh8.6 [/local0~] package require BLT
3.0
tclsh8.6 [/local0~] blt::vector create foo
::foo
tclsh8.6 [/local0~] foo append [list 1 2 3 4 5 6 7 8 9 10]
tclsh8.6 [/local0~] blt::vector expr foo(2)
3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 -2.4983353906949635e-127 -2.4983353906949635e-127
tclsh8.6 [/local0~] blt::vector expr foo(2:2)
3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 -2.4983353906949635e-127 -2.4983353906949635e-127
tclsh8.6 [/local0~] blt::vector expr foo(2:3)
3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 -2.4983353906949635e-127 -2.4983353906949635e-127
tclsh8.6 [/local0~] blt::vector expr foo(end)
10.0 -2.4983353906949635e-127 -2.4983353906949635e-127 -2.4983353906949635e-127 -2.4983353906949635e-127 -2.4983353906949635e-127 -2.4983353906949635e-127 -2.4983353906949635e-127 -2.4983353906949635e-127 -2.4983353906949635e-127

uname: FreeBSD test12.gsoft.com.au 12.0-CURRENT FreeBSD 12.0-CURRENT #0 r328919: Tue Feb 6 21:53:22 UTC 2018 darius@:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
Configure args: ./configure --prefix=/usr/local --with-tcl=/usr/local/lib/tcl8.6 --with-tk=/usr/local/lib/tk8.6 --with-tclincdir=/usr/local/include/tcl8.6 --with-tkincdir=/usr/local/include/tk8.6 --with-tcllibdir=/usr/local/lib --with-tklibdir=/usr/local/lib --with-xftincdir=/usr/local/include --with-xftlibdir=/usr/local/lib --enable-symbols --exec-prefix=/usr/local

Discussion

  • George A. Howlett

    I've committed a change to fix this. The vector duplication routine had the wrong length (it was using the length of the entire vector instead of the range). So it was grabbing values beyond the end of the vector.

    [What's weird is that your example ran correctly with Tcl8.5.]

    If you are still seeing this problem or any other, please let me know.
    Thank for the bug report. I really appreciate it.

    --gah

     
  • Daniel O'Connor

    Daniel O'Connor - 2018-02-13

    Lovely, thanks!
    I have a few other bugs - I'll report them as well.

     

Log in to post a comment.

MongoDB Logo MongoDB