Skip to content
Tcl Source Code Artifact [9ca2d4336b]
Login

Artifact [9ca2d4336b]

Artifact 9ca2d4336b21a53370c7c63f16b7b25bc8ca6d651cb7fd7eee647ecfdde3c4a9:


$o ajouter 2                                                   5
$o ajouter deux                                                ERREUR argument "n": expected integer but got "deux"
$o genre 7                                                     int
list [$o opt 1] [$o opt 1 2]                                   {1 5} {1 2}
$o moitiƩ 3                                                    1.5
$o rend                                                        ERREUR return value {int}: expected integer but got "pas un entier"
P new vis trois                                                ERREUR argument "stock": expected integer but got "trois"
$o pt {1 2}                                                    1.0 2.0 Point
$o get stock                                                   5
oo::objdefine $o method seul {{int}k} {expr {$k * 10}}; $o seul 4 40
$o seul x                                                      ERREUR argument "k": expected integer but got "x"
oo::class create Q {method m {a b} {list $a $b}}; [Q new] m 1 2 1 2
oo::class create P2 {superclass P; method ajouter {{int}n} {next [expr {$n*2}]}}; [P2 new a 1] ajouter 5 11
info class definition P opt                                    {n {m 5}} { list $n $m }
lindex [info class constructor P] 0                            nom stock
lindex [info object definition $o seul] 0                      k
oo::configurable create R {property y}; set r [R new]; $r configure -y 4; $r configure -y 4
set c [oo::copy $o]; list [$c seul 4] [catch {$c seul x}]      40 1
oo::copy P P3; [P3 new b 2] moitiƩ 5                           2.5
[geom::C new] nx {1 2}                                         1.0
oo::define geom::C method ny {{point}p} { return $p(y) }; [geom::C new] ny {1 2} 2.0
set a [geom::C new]; oo::objdefine $a method nz {{point}p} { expr {$p(x)+$p(y)} }; $a nz {1 2} 3.0
list [catch {proc f {a "b"c} {}} e1] [catch {oo::class create E {method m {a "b"c} {}}} e2] [expr {$e1 eq $e2}] 1 1 1