Check-in [ab6da27502]
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix translation bugs that broke [dict] tests
Timelines: family | ancestors | descendants | both | notworking | kbk-refactor-callframe
Files: files | file ages | folders
SHA3-256:ab6da275020a92d99d89d1c6446d837e5944864845fa7b40928d27b968341f8c
User & Date: kbk 2019-01-29 02:00:01
Context
2019-01-29
13:19
Fix misorderered scalar check/copy to result check-in: 36e8177510 user: kbk tags: notworking, kbk-refactor-callframe
02:00
Fix translation bugs that broke [dict] tests check-in: ab6da27502 user: kbk tags: notworking, kbk-refactor-callframe
2019-01-23
02:12
Add conversion to IMPURE ZEROONE INT, needed in booltest. Keep code motion from messing with the callframe for now. Patch out the handful of remaining tests that abort. Next up: fix the dictest tests involving 'dict update', lsetest, and re-add support for direct ops. check-in: 27339e7e0c user: kbk tags: notworking, kbk-refactor-callframe
Changes

Changes to demos/perftest/tester.tcl.

   562    562       lappend l a b c d e f
   563    563       set x [lrange $l 0 1]
   564    564       set y [lrange $l 2 end]
   565    565       list $l $x $y
   566    566   }
   567    567   
   568    568   proc lsetest {l {ix { 2 }}} {
   569         -    for {set i 0} {$i < [llength $l]} {incr i} {
   570         -	lset l $i >[lindex $l $i]<
   571         -    }
          569  +    # for {set i 0} {$i < [llength $l]} {incr i} {
          570  +    # 	lset l $i >[lindex $l $i]<
          571  +    # }
   572    572       lset l $ix abc
          573  +    puts "After first lset: $l"
   573    574       lset l 1 1 def
          575  +    puts "After second lset: $l"
   574    576       return $l
   575    577   }
   576    578   proc lappendtest {l} {
   577    579       lappend l a
   578    580       lappend l b c
   579    581       return $l
   580    582   }
................................................................................
  2670   2672       numberitems numberitems2 numberitems3 doubleitems
  2671   2673       containment
  2672   2674       lsorttest
  2673   2675       lsortcmd
  2674   2676       # Dictionary operations (also see some [try] tests)
  2675   2677       dictest
  2676   2678       dictest2
  2677         -    # dictest3			TEMP generates incorrect code
         2679  +    dictest3
  2678   2680       dictest4 dictest5
  2679         -    # dictest6 dictest7		TEMP generates incorrect code
  2680         -    # dictest8			TEMP generates incorrect code
         2681  +    dictest6 dictest7
         2682  +    dictest8
  2681   2683       dictest9
  2682   2684       dictfor
  2683   2685       # Nonexistent variables
  2684   2686       nextest1
  2685   2687       nextest2
  2686   2688       nextest3
  2687   2689       nextest4

Changes to quadcode/constfold.tcl.

   734    734   	}
   735    735   	set bb [lindex $bbcontent $b]
   736    736   	lset bbcontent $b {}
   737    737   	lset bbcontent $b [lrange $bb[set bb ""] 0 $newpc]
   738    738       }
   739    739   
   740    740       my debug-constfold {
   741         -#	puts "After constfold:"
   742         -#	my dump-bb
          741  +	puts "After constfold:"
          742  +	my dump-bb
   743    743       }
   744    744       return $changed
   745    745   }

Changes to quadcode/translate.tcl.

   530    530   		set mid [list temp opnd0]
   531    531   		set val [list temp [incr depth -1]]
   532    532   		set idx 0
   533    533   		set toUpdate {}
   534    534   		foreach v [dict get $aux variables] {
   535    535   		    set r [my index-to-var $v]
   536    536   		    my generate-move-from-callframe $r
   537         -		    my generate-existence-check $pc $r
   538    537   		    my generate-scalar-check $pc $r {TCL WRITE VARNAME} \
   539    538   			"can't set \"%s\": variable is array"
   540    539   		    my error-quads $pc listIndex $mid $val [list literal $idx]
   541    540   		    my error-quads $pc dictGetOrNexist $r $var $mid
   542    541   		    lappend toUpdate [list literal [lindex $r 1]] $r
   543    542   		    incr idx
   544    543   		}
................................................................................
   569    568   		    my quads arrayExists $isary $r
   570    569   		    set n [llength $quads]
   571    570   		    my quads jumpFalse [list pc [expr {$n + 3}]] $isary
   572    571   		    my quads copy $mid Nothing
   573    572   		    my quads jump [list pc [expr {$n + 4}]]
   574    573   		    my quads extractScalar $mid $r
   575    574   		    # Write the value to the right key of the dict
   576         -		    my error-quads $pc dictSetOrUnset $updating $updating $key $mid
          575  +		    my error-quads $pc dictSetOrUnset \
          576  +			$updating $updating $key $mid
   577    577   		}
   578    578   		my quads copy $var $updating
   579    579   		my update-in-callframe [list literal [lindex $var 1]] $var
   580    580   	    }
   581    581   	    unsetScalar {
   582    582   		# TODO - This doesn't complain on unsetting a nonexistent
   583    583   		#        variable, it ignores '-nocomplain'
   584    584   		set var [my index-to-var [lindex $insn 2]]
   585    585   		my quads unset $var
   586         -		my update-in-callframe [list literal [lindex $var 1]] Nothing
          586  +		if {[lindex $var 0] eq "var"} {
          587  +		    my quads moveToCallFrame \
          588  +			{temp @callframe} {temp @callframe} \
          589  +			[list literal [lindex $var 1]] Nothing
          590  +		}
   587    591   	    }
   588    592   	    unsetArray {
   589    593   		# TODO - This doesn't complain on unsetting a nonexistent
   590    594   		#        element, it ignores '-nocomplain'
   591    595   		set idx [list temp [incr depth -1]]
   592    596   		set ary [my index-to-var [lindex $insn 2]]
   593    597   		my generate-move-from-callframe $ary