Artifact 3c35f0abe5574a4d94ccfb275a9727353da56e60c588b6cbbdc2cde724304bcc:
- File typeparse/tests_tclsh/t98_depliage.out — part of check-in [2ce9df4c51] at 2026-11-05 13:22:58 on branch tip-764_tcl90 — v16r 1. Typed procedures: added syntax for configuring the unfolding of product and sum types: the prefix {*} applied to a type unfolds it into a list: ``` proc {{*}vector}h {h} {(0,$h)}; h 100 ; # {0 100} ``` the prefix {**} applied to a type unfolds it into a dict: ``` proc {{**}vector}h {h} {(0,$h)}; h 100 ; # {x 0 y 100} ``` This unfolding occurs recursively (deeply). 2. Example: the `math::geometry` package, reformulated using the types and expressions from TIP 759. (user: Florentis, size: 682) [annotate] [blame] [check-ins using]
{*} liste: {0 5} 2 {} {} 0 5 {**} dict: {x 0 y 5} 5 {} sans dépliage: {0 5} 1 point rect {*}: {{0 0} {10 10}} 10 {} rect {**}: {nw {x 0 y 0} se {x 10 y 10}} 10 list.point: {{1 2} {3 4}} {{x 1 y 2} {x 3 y 4}} 2 somme {*}: {1 2} aucune somme {**}: {en {x 1 y 2}} aucune mauvais retour: ERREUR return value {point}: expected floating-point number but got "a" type {{*}T}: {1 2} 2 {x 1 y 2} {} type {{*}T} liste: {{1 2} {3 4}} {nw {x 1 y 2} se {x 3 y 4}} type {{*}T} erreur: ERREUR expected floating-point number but got "a" type proc: {{*}point} {{**}point} type inconnu: ERREUR bad return type {zz}: unknown type "zz" compact: {1.0 2.0 3.0} {} {1.0 2.0 3.0} déjà typé: {3 4} 2 {}