Artifact 1652550086efccf414428958fe24a5d423adc2c0b9ef3f5684b5a864dda2bf4e:
- File typeparse/tests_tclsh/t122_formes.tcl — part of check-in [83801ad6ad] at 2026-11-24 09:32:02 on branch tip-764_tcl90 — typeparse v17o: block-wise type map, path windows, views on object lists - type map: evaluated in blocks of 256 elements when the expression computes in doubles only (columns gathered, each operation applied to the whole block); flagged elements are evaluated again one by one, so results stay identical to expr. TCL_TYPE_NOBLOCK=1 to compare. - Windows $L((s0,s1,...):end:step): one column per start, same step, complete windows only, for reading and writing (set L((0,1)::2) $X $Y). - Ranges of a typed list of objects are views (shared base, start, step, count), without touching the elements; type map reads them in their base. - Typed columns are written in place (objects, cells, num), without checking the elements again. - set {T}x $v with v already of type T keeps the value as is (instead of unfolding and checking it again); fast creation of list.num. - $L(a:b:c) outside procedures uses the same direct reads as compiled code. - Fix: a fully substituted index stays a single name in the fast paths too ($L($s) with s = 1:3 looks for the element 1:3). - Tests t125, t126. New example exemples/tcllib_geometry/COMPARAISON.md: the geometry chain in ten variants, from plain Tcl to fully typed C. No core patch. (user: Florentis, size: 1339) [annotate] [blame] [check-ins using]
# t122 : formes d'un type (type def T DEF {-compact}F) : le même type sous # deux dispositions ; une forme entre telle quelle là où T est attendu ; # vers la forme, un cast écrit ; type cast passe de l'une à l'autre. type def poly list.double {-compact}polyc proc f {{poly}p} { list [type get $p] [type is {compact?}$p] } proc g {{polyc}p} { type get $p } proc h {{poly}p} { set p [type cast poly {1 2 3}]; type get $p } set o [type cast poly {1 2 3}] set c [type cast polyc $o] puts "cast : [type get $o] [type is {compact?}$o] / [type get $c] [type is {compact?}$c]" set r [type cast poly $c] puts "retour : [type get $r] [type is {compact?}$r] $r" puts "{poly} reçoit polyc : [f $c] ; poly : [f $o]" puts "{polyc} reçoit polyc : [g $c]" catch {g $o} e; puts "{polyc} reçoit poly : $e" puts "réaffectation dans la famille : [h $c]" catch {set {polyc}x $o} e; puts "set {polyc} : $e" set {poly}y $c; puts "set {poly} d'un polyc : [type get $y]" puts "définition : [type def polyc]" catch {type def pp list.string {-compact}ppc} e; puts "list.string : [string range $e 0 40]..." puts "pp retiré : [catch {type def pp}]" catch {type def qq list.double {-strict}qqc} e; puts "option : $e" catch {type def rr list.double rrc} e; puts "sans option : $e" catch {type def {pa({type}T)} {list.$T} {-compact}pac} e; puts "famille : $e"