Index: tests/parameters.tcl =================================================================== diff -u -r4dc0f6d2bab7c95b74c346604e63cecec770f8fc -rb6d81c6521d1e1d58f00763f5ab30a0946cc222a --- tests/parameters.tcl (.../parameters.tcl) (revision 4dc0f6d2bab7c95b74c346604e63cecec770f8fc) +++ tests/parameters.tcl (.../parameters.tcl) (revision b6d81c6521d1e1d58f00763f5ab30a0946cc222a) @@ -77,6 +77,9 @@ ? {::nsf::is switch 1} {invalid value constraints "switch"} ? {::nsf::is superclass M} {invalid value constraints "superclass"} + # don't allow convert + ? {::nsf::is integer,convert 1} {invalid value constraints "integer,convert"} + # tcl checker ? {::nsf::is upper ABC} 1 ? {::nsf::is upper Abc} 0 @@ -933,11 +936,12 @@ } } Class create C { - :method foo {s:sex,multivalued} {return $s} + :method foo {s:sex,multivalued,convert} {return $s} + :method bar {s:sex,multivalued} {return $s} } C create c1 ? {c1 foo {male female mann frau}} "m f m f" - + ? {c1 bar {male female mann frau}} "male female mann frau" Object create tmpObj tmpObj method type=mType {name value arg:optional} { @@ -966,7 +970,7 @@ } } Object create o { - :method foo {x:integer,slot=::mySlot} { + :method foo {x:integer,slot=::mySlot,convert} { return $x } } @@ -1012,6 +1016,7 @@ Class create Person { :attribute sex { :type "sex" + :convert true :method type=sex {name value} { #puts stderr "[self] slot specific converter" switch -glob $value { @@ -1025,7 +1030,7 @@ Person create p1 -sex male ? {p1 sex} m - Person method foo {s:sex,slot=::Person::slot::sex} {return $s} + Person method foo {s:sex,slot=::Person::slot::sex,convert} {return $s} ? {p1 foo male} m ? {p1 sex male} m }