# XOTcl provides only method deletion with +# the equivalent of Tcl's "proc foo {} {}" +/obj/ proc foo {} {} +/cls/ instproc foo {} {} + +# No support for attribute deletion
Index: TODO =================================================================== diff -u -re29434ffef30bea10b7422f1f295787d41377839 -re570f0508ee82bd7aeea0409c64855bb99ea5cee --- TODO (.../TODO) (revision e29434ffef30bea10b7422f1f295787d41377839) +++ TODO (.../TODO) (revision e570f0508ee82bd7aeea0409c64855bb99ea5cee) @@ -2803,21 +2803,22 @@ -nsf.c: added c-implementation of "/object/ info slots" to share implementation details and reduce scattering +- migration guide + * included change in "info heritage" + * included "info slots" + * included "info parameter" + * included "delete method" + * included "delete attribute" + TODO: -- missing in c-based "info slots": - * handle object specific "info slots" in C? - * "info slots", "info parameter" are not in the migration guide - * add method "delete method" and "delete attribute" to the migration guide +- add "link" form 2.4 (parameters) to "info parameters" - MixinComputeOrderFullList() could receive a flag to store source classes in checkList - if the check on eg. info-heritage-circular in test/info.method.tcl fails, we get an exception. -- what to do with "info heritage": - document changed results in cases of per-class mixins in migratin guide - - ::nsf::method::exists /handle/ -> check, if handle is a handle of a registered method (to be be used in serializer alias-dependency) - profiling missing when NSF_INVOKE_SHADOWED_TRADITIONAL is turned off. Index: doc/next-migration.html =================================================================== diff -u -r01cc3b2a2d0ccf8b420fb73ab01c70308ac85d90 -re570f0508ee82bd7aeea0409c64855bb99ea5cee --- doc/next-migration.html (.../next-migration.html) (revision 01cc3b2a2d0ccf8b420fb73ab01c70308ac85d90) +++ doc/next-migration.html (.../next-migration.html) (revision e570f0508ee82bd7aeea0409c64855bb99ea5cee) @@ -1582,7 +1582,67 @@ the default protection for attributes. The defaults can be overwritten also e.g. on a class level.
+NX provides an explicit delete method for the deletion of methods +and attributes.
XOTcl | +Next Scripting Language | +
---|---|
+
+ # XOTcl provides only method deletion with +# the equivalent of Tcl's "proc foo {} {}" +/obj/ proc foo {} {} +/cls/ instproc foo {} {} + +# No support for attribute deletion |
+
+
+ # Deletion of Methods +# +/obj/ delete method /name/ +/cls/ ?class? delete method /name/ + +# Deletion of Attributes +/obj/ delete attribute /name/ +/cls/ ?class? delete attribute /name/ |
+
The Next Scripting Framework defines Tcl resolvers for method and @@ -2391,8 +2451,8 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
# Value constraints for parameter -# not available
# No value constraints for parameter +# available
# List slot objects defined for obj -/obj/ info lookup slots ?-type /type/? ?-source -all
application
baseclasses? ?pattern? -# Returns list of slot objects of specified type (class) and origin
-
info lookup can be used as well to determine, where exactly an artefact is located. One can obtain this way a method handle, where a method or filter is defined.
XOTcl | +Next Scripting Language | +
---|---|
+
+ # n.a. |
+
+
+ # Return list of slots objects defined on the +# object or class +# +# -source might be all|application|baseclasses +# -type is the class of the slot object +# -closure includes slots of superclasses + +/obj/ info slots ?-type ...? ?pattern? +/cls/ class info slots ?-type ...? ?pattern? +/cls/ info slots ?-type ...? ?-source ...? ?-closure? ?pattern? |
+
XOTcl | +Next Scripting Language | +
---|---|
+
+ # n.a. |
+
+
+ # Return parameter(s) provided by class for +# its instances; defines, how objects of this +# class can be configured. If name is provided +# only the named object parameter is returned +# otherwise the full list. +# +# +# Return object parameters with leading dashes +# for non-positional object parameters and +# defaults +/cls/ info parameter list ?name? + +# Return just the names of the parameters +/cls/ info parameter name ?name? + +# Return the full parameter specs +/cls/ info parameter spec ?name? + +# Return in the Tcl parameter syntax +/cls/ info parameter syntax ?name? |
+
In NX all introspection options for filters are grouped under info filter and all introspection options for mixins are under info mixin. Therefore, NX follows here the approach of using hierarchical @@ -4800,7 +4975,7 @@
As mentioned earlier, info method definition can be used on every kind of method.
/obj/ info method definition /methodName/
/obj/ info method definition /methodName/ +/cls/ ?class? info method definition /methodName/-
# n.a.
/cls/ info method definition /methodName/
NX supports method-handles to provide means to obtain further information about a method or to change maybe some properties of a method. When a method is created, the method creating method returns @@ -4917,40 +5067,15 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ info method handle /methodName/
/obj/ info method handle /methodName/ +/cls/ ?class? info method handle /methodName/-
# n.a.
/cls/ ?class? info method handle /methodName/
The method info method type is new in NX to obtain the type of the specified method.
NX provides a richer set of introspection options to obtain information, where mixins classes are mixed into.
Similar as noted before, NX uses rather a hierarchical approach of naming using multiple layers of subcommands).
Call-stack introspection is very similar in NX and XOTcl. NX uses for subcommand the term current instead of self, since self has a strong connotation to the current object. The term proc is renamed @@ -6103,7 +6228,14 @@ # alternate approach via Next Scripting Framework ::nsf::relation f1 class ::nx::Object
info heritage returns in XOTcl 1 the transitive superclass +hierarchy, which is equivalent with info superclass -closure and +therefore not necessary. In XOTcl 2 (and NX), info heritage includes +as well the transitive per-class mixins.
Since the Next Scripting Framework supports the so-called ensemble @@ -6176,7 +6308,7 @@