Index: tests/slottest.xotcl =================================================================== diff -u -r16664bdf30d1848e76699ac1859e97b6a427bdcb -r147831f1098cb9b96a28d4d5b0f9f3ccea35b9da --- tests/slottest.xotcl (.../slottest.xotcl) (revision 16664bdf30d1848e76699ac1859e97b6a427bdcb) +++ tests/slottest.xotcl (.../slottest.xotcl) (revision 147831f1098cb9b96a28d4d5b0f9f3ccea35b9da) @@ -429,6 +429,10 @@ puts stderr =====6 +####################################################### +# initcmd via slots +####################################################### +Test case initcmd set ::hu 0 Class C -slots { Attribute create x -initcmd {incr ::hu; set x 101} @@ -439,6 +443,10 @@ ? {c1 info vars} "x" ? {set ::hu 1} 1 +####################################################### +# nested contains +####################################################### +Test case nested-contains Class Point -parameter {{x 100} {y 300}} Class Rectangle -parameter {color} @@ -461,14 +469,19 @@ ? {r0 r2 color} green #puts [r0 serialize] +####################################################### +# assign via slots +####################################################### +Test case assign-via-slots -##### Class create A -slots { - Attribute create foo -default 1 -proc assign { domain var value} { - if {$value < 0 || $value > 99} { - error "$value is not in the range of 0 .. 99" + Attribute create foo -default 1 { + :method assign { domain var value} { + if {$value < 0 || $value > 99} { + error "$value is not in the range of 0 .. 99" + } + $domain set $var $value } - $domain set $var $value } }