Index: TODO =================================================================== diff -u -rfa93101c8752ada9299561f075b61c2e6144e3f5 -r99bb4b85e4a123d25f8b867b3498171eadaa2015 --- TODO (.../TODO) (revision fa93101c8752ada9299561f075b61c2e6144e3f5) +++ TODO (.../TODO) (revision 99bb4b85e4a123d25f8b867b3498171eadaa2015) @@ -1952,12 +1952,17 @@ } - extended regression test +- changes returns syntax from '->' to '-returns' +- xotcl2: fixed and completed results of "info instforward" and "info forward" +- serializer: fixed handling of nsf::configure options + TODO: - "-returns" * leave syntax as is for method? * handle "-returns" in serializer +- change allowempty to "orempty" or "empty" - extend coro regression test Index: library/nx/nx.tcl =================================================================== diff -u -rfa93101c8752ada9299561f075b61c2e6144e3f5 -r99bb4b85e4a123d25f8b867b3498171eadaa2015 --- library/nx/nx.tcl (.../nx.tcl) (revision fa93101c8752ada9299561f075b61c2e6144e3f5) +++ library/nx/nx.tcl (.../nx.tcl) (revision 99bb4b85e4a123d25f8b867b3498171eadaa2015) @@ -142,7 +142,7 @@ # define method "method" for Class and Object ::nsf::method Class method { - name arguments -> body -precondition -postcondition + name arguments -returns body -precondition -postcondition } { set conditions [list] if {[info exists precondition]} {lappend conditions -precondition $precondition} @@ -153,13 +153,13 @@ if {$r ne ""} { # the method was not deleted ::nsf::methodproperty $(object) $r call-protected [::nsf::dispatch $(object) __default_method_call_protection] - if {[info exists >]} {::nsf::methodproperty $(object) $r returns ${>}} + if {[info exists returns]} {::nsf::methodproperty $(object) $r returns $returns} } return $r } ::nsf::method Object method { - name arguments -> body -precondition -postcondition + name arguments -returns body -precondition -postcondition } { set conditions [list] if {[info exists precondition]} {lappend conditions -precondition $precondition} @@ -170,7 +170,7 @@ if {$r ne ""} { # the method was not deleted ::nsf::methodproperty $(object) $r call-protected [::nsf::dispatch $(object) __default_method_call_protection] - if {[info exists >]} {::nsf::methodproperty $(object) $r returns ${>}} + if {[info exists returns]} {::nsf::methodproperty $(object) $r returns $returns} } return $r } @@ -316,24 +316,24 @@ # # -frame object|method make only sense for c-defined cmds, # - Object public method alias {methodName -> {-frame default} cmd} { + Object public method alias {methodName -returns {-frame default} cmd} { array set "" [:__resolve_method_path -per-object $methodName] #puts "object alias $(object).$(methodName) $cmd" set r [::nsf::alias $(object) -per-object $(methodName) \ -frame $frame $cmd] ::nsf::methodproperty $(object) -per-object $r call-protected \ [::nsf::dispatch $(object) __default_method_call_protection] - if {[info exists >]} {::nsf::methodproperty $(object) $r returns ${>}} + if {[info exists returns]} {::nsf::methodproperty $(object) $r returns $returns} return $r } - Class public method alias {methodName -> {-frame default} cmd} { + Class public method alias {methodName -returns {-frame default} cmd} { array set "" [:__resolve_method_path $methodName] #puts "class alias $(object).$(methodName) $cmd" set r [::nsf::alias $(object) $(methodName) -frame $frame $cmd] ::nsf::methodproperty $(object) $r call-protected \ [::nsf::dispatch $(object) __default_method_call_protection] - if {[info exists >]} {::nsf::methodproperty $(object) $r returns ${>}} + if {[info exists returns]} {::nsf::methodproperty $(object) $r returns $returns} return $r } Index: tests/info-method.test =================================================================== diff -u -rfa93101c8752ada9299561f075b61c2e6144e3f5 -r99bb4b85e4a123d25f8b867b3498171eadaa2015 --- tests/info-method.test (.../info-method.test) (revision fa93101c8752ada9299561f075b61c2e6144e3f5) +++ tests/info-method.test (.../info-method.test) (revision 99bb4b85e4a123d25f8b867b3498171eadaa2015) @@ -49,9 +49,9 @@ {::C public method m-with-assertions {} {return proc-[self proc]} -precondition 1 -postcondition 2} ? {C info method parameter m} {x} ? {nx::Class info method parameter method} \ - {name arguments -> body -precondition -postcondition} + {name arguments -returns body -precondition -postcondition} ? {nx::Object info method parameter alias} \ - {methodName -> {-frame default} cmd} + {methodName -returns {-frame default} cmd} # raises currently an error ? {catch {C info method parameter a}} 1 Index: tests/parameters.test =================================================================== diff -u -rfa93101c8752ada9299561f075b61c2e6144e3f5 -r99bb4b85e4a123d25f8b867b3498171eadaa2015 --- tests/parameters.test (.../parameters.test) (revision fa93101c8752ada9299561f075b61c2e6144e3f5) +++ tests/parameters.test (.../parameters.test) (revision 99bb4b85e4a123d25f8b867b3498171eadaa2015) @@ -562,7 +562,7 @@ "query instparams with default, no paramdefs needed" ? {Class info method parameter method} \ - "name arguments -> body -precondition -postcondition" \ + "name arguments -returns body -precondition -postcondition" \ "query instparams for scripted method 'method'" ? {Object info method parameter ::nsf::forward} \ Index: tests/returns.test =================================================================== diff -u -rfa93101c8752ada9299561f075b61c2e6144e3f5 -r99bb4b85e4a123d25f8b867b3498171eadaa2015 --- tests/returns.test (.../returns.test) (revision fa93101c8752ada9299561f075b61c2e6144e3f5) +++ tests/returns.test (.../returns.test) (revision 99bb4b85e4a123d25f8b867b3498171eadaa2015) @@ -297,13 +297,13 @@ Test case int-returns-sugar { nx::Class create C { # scripted method without paramdefs - :method bar-ok1 {a b} -> integer {return 1} - :method bar-ok2 {a b} -> integer {return $a} + :method bar-ok1 {a b} -returns integer {return 1} + :method bar-ok2 {a b} -returns integer {return $a} # scripted method with paramdefs - :method bar-nok {a b:integer} -> integer {return a} + :method bar-nok {a b:integer} -returns integer {return a} # alias to tcl-cmd (no param defs) - :alias incr -> integer -frame object ::incr - :alias lappend -> integer -frame object ::lappend + :alias incr -returns integer -frame object ::incr + :alias lappend -returns integer -frame object ::lappend :create c1 }