Tcl Library Source Code

View Ticket
Login
Ticket UUID: e99fe133e61b7868a4c2f7d9c2e6cb2f164a7246
Title: typo in math::combinatorics::permutations
Type: Bug Version: trunk
Submitter: emiliano Created on: 2025-01-30 01:48:26
Subsystem: math Assigned To:
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2025-02-09 15:46:44
Resolution: Fixed Closed By: arjenmarkus
    Closed on: 2025-02-09 15:46:44
Description:
On file modules/math/combinatoricsExt.tcl , line 53

https://core.tcl-lang.org/tcllib/file?ci=tip&name=modules/math/combinatoricsExt.tcl&ln=53

reads

    set newfactorial [lindex $$factorial end]

with two $$ on the "factorial" variable. While the code works because the element 0 (which becomes "$1" instead of "1") is never returned, this code path causes the list of cached factorials shimmer to a string and again to a list on every invocation. The obvious solution is to remove the extra "$".
User Comments: arjenmarkus added on 2025-02-09 15:46:44:
Corrected the typo - version 2.1.1 now.