Index: TODO =================================================================== diff -u -r2f7d2e507326a689d70c580f4cf8c4c82c420bac -r21e04cc3b201da5acfc77f7b05308f1ddfa606dc --- TODO (.../TODO) (revision 2f7d2e507326a689d70c580f4cf8c4c82c420bac) +++ TODO (.../TODO) (revision 21e04cc3b201da5acfc77f7b05308f1ddfa606dc) @@ -5502,10 +5502,23 @@ - see no need, why we should "set nodashalnum for int types" - extended regression test +nsf.c: +- remove redundant null check for object and add assertion + documentation: - add current args to migration guide - fix cut&paste error: replace "current currentclass" by "current calledclass" +Migration guide and tutorial: +- updated "/cls/ info superclasses" and "/cls/ info subclasses" +- updated "/cls/ info mixins" and "/obj/ info object mixins" +- updated "/cls/ info filters" and "/obj/ info object filters" +- dropped "/cls/ info mixin guard" and "/obj/ info object mixin guard" + dropped "/cls/ info filter guard" and "/obj/ info object filter guard" + (use "-guard option insteads) +- updated "/cls/ mixins ...", "/obj/ object mixins ...", + "/cls/ filteres ...", "/obj/ object filters ..." + ======================================================================== TODO: Index: doc/next-migration.html =================================================================== diff -u -r2f7d2e507326a689d70c580f4cf8c4c82c420bac -r21e04cc3b201da5acfc77f7b05308f1ddfa606dc --- doc/next-migration.html (.../next-migration.html) (revision 2f7d2e507326a689d70c580f4cf8c4c82c420bac) +++ doc/next-migration.html (.../next-migration.html) (revision 21e04cc3b201da5acfc77f7b05308f1ddfa606dc) @@ -3622,16 +3622,19 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
# Register per-class mixin and guard for
+
# Register/clear per-class mixin and guard for
 # a class
 
-/cls/ mixin add|set|clear ...
-/cls/ mixin guard /mixin/ ?condition?
+/cls/ mixins add|set|clear ...
+/cls/ mixins guard /mixin/ ?condition?
 /cls/ configure -mixin ...
 
-# Query per-class mixin
-/cls/ mixin get
-/cls/ cget -mixin
+# Query per-class mixins +/cls/ mixins get +/cls/ cget -mixins + +# Query per-class mixins (without guards) +/cls/ mixins classes
@@ -3648,7 +3651,7 @@
/obj/ mixin ...
 /obj/ mixinguard /mixin/ ?condition?
 
-# Query per-object mixin
+# Query per-object mixins
 /obj/ mixin
-
# Register per-object mixin and guard for
+
# Register/clear per-object mixin and guard for
 # an object
 
-/obj/ object mixin add|set|clear ...
-/obj/ object mixin guard /mixin/ ?condition?
-/obj/ configure -object-mixin ...
+/obj/ object mixins add|set|clear ...
+/obj/ object mixins guard /mixin/ ?condition?
+/obj/ configure -object-mixins ...
 
 # Query per-object mixin
-/obj/ object mixin get
-/obj/ cget -object-mixin
+/obj/ object mixins get +/obj/ cget -object-mixin + +# Query per-object mixins (without guards) +/cls/ mixins classes @@ -3722,16 +3728,19 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
# Register per-class filter and guard for
+
# Register/clear per-class filter and guard for
 # a class
 
-/cls/ filter add|set|clear ...
-/cls/ filter guard /filter/ ?condition?
-/cls/ configure -filter ...
+/cls/ filters add|set|clear ...
+/cls/ filters guard /filter/ ?condition?
+/cls/ configure -filters ...
 
-# Query per-class filter
-/cls/ filter get
-/cls/ cget -filter
+# Query per-class filters +/cls/ filters get +/cls/ cget -filters + +# Query per-class filters (without guards) +/cls/ filters methods
@@ -3758,16 +3767,19 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
# Register per-object filter and guard for
+
# Register(clear per-object filter and guard for
 # an object
 
-/obj/ object filter add|set|clear ...
-/obj/ object filter guard /filter/ ?condition?
-/obj/ configure -object-filter ...
+/obj/ object filters add|set|clear ...
+/obj/ object filters guard /filter/ ?condition?
+/obj/ configure -object-filters ...
 
-# Query per-object filter
-/cls/ object filter get
-/obj/ cget -object-filter
+# Query per-object filters +/cls/ object filters get +/obj/ cget -object-filters + +# Query per-object filters (without guards) +/cls/ object filters methods @@ -3789,7 +3801,82 @@ syntax. In addition, NX provides means to query the type of a method, and NX allows to filter by the type of the method.

-

2.6.1. List methods defined by classes

+

2.6.1. List sub- and superclass relations

+

While XOTcl used singular words for introspecting sub- and superclass +relations, NX uses plural word to indicate that potentially a list of +values is returned.

+
+ +++ + + + + + + + + + + + + + + + +
XOTcl Next Scripting Language
+
+
/cls/ info superclass ?pattern?
+
+
/cls/ info superclasses ?pattern?
+
+
/cls/ info subclass ?pattern?
+
+
/cls/ info subclasses -type setter ?pattern?
+
+
+
+

2.6.2. List methods defined by classes

While XOTcl uses different names for obtaining different kinds of methods defined by a class, NX uses info methods in an orthogonal manner. NX allows as well to use the call protection to filter the @@ -3920,7 +4007,7 @@

-

2.6.2. List methods defined by objects

+

2.6.3. List methods defined by objects

While XOTcl uses different names for obtaining different kinds of methods defined by an object, NX uses info methods in an orthogonal manner. NX allows as well to use the call protection to filter the @@ -4051,7 +4138,7 @@

-

2.6.3. Check existence of a method

+

2.6.4. Check existence of a method

NX provides multiple ways of checking, whether a method exists; one can use info method exists to check, if a given method exists (return boolean), or one can use info methods ?pattern?, where @@ -4109,7 +4196,7 @@

-

2.6.4. List callable methods

+

2.6.5. List callable methods

In order to obtain for an object the set of artefacts defined in the class hierarchy, NX uses info lookup. One can either lookup methods (via info lookup methods) or slots (via info lookup slots). The @@ -4289,7 +4376,7 @@

-

2.6.5. List object/class where a specified method is defined

+

2.6.6. List object/class where a specified method is defined

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.

@@ -4369,7 +4456,7 @@
-

2.6.6. List definition of scripted methods

+

2.6.7. List definition of scripted methods

XOTcl contains a long list of info subcommands for different kinds of methods and for obtaining more detailed information about these methods.

@@ -4644,7 +4731,7 @@
-

2.6.7. List Configure Parameters

+

2.6.8. List Configure Parameters

The way, how newly created objects can be configured is determined in NX via properties. The configuration happens during creation via the methods create or new or during runtime via configure. These @@ -4724,7 +4811,7 @@

-

2.6.8. List Variable Declarations (property and variable)

+

2.6.9. List Variable Declarations (property and variable)

-

2.6.9. List Slots

+

2.6.10. List Slots

-

2.6.10. List Filter or Mixins

-

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 -subcommands rather than using a flat namespace.

+

2.6.11. List Filter or Mixins

+

In NX all introspection options for filters are provided via +info filters and all introspection options for mixins are +provided via info mixins.

-
/obj/ info object filter methods \
-   ?-guards? ?pattern?
-/obj/ info object filter guard /name/
+
/obj/ info object filters \
+   ?-guards? ?pattern?
+
/cls/ info filters \
+   ?-guards? ?pattern?
+
/obj/ info object mixins \
+   ?-guards? ?pattern?
+
/cls/ info mixins \
+   ?-closure? ?-guards? ?-heritage? ?pattern?
@@ -4935,9 +5020,8 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ info filter methods \
-   ?-guards? ?pattern?
-/cls/ info filter guard /name/
@@ -4964,9 +5048,8 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ info object mixin classes \
-   ?-guards? ?pattern?
-/obj/ info object mixin guard /name/
@@ -4994,16 +5077,15 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ info mixin classes \
-   ?-closure? ?-guards? ?pattern?
-/cls/ info mixin guard /name/
-

2.6.11. List definition of methods defined by aliases, setters or forwarders

+

2.6.12. List definition of methods defined by aliases, setters or forwarders

As mentioned earlier, info method definition can be used on every kind of method. The same call can be used to obtain the definition of a scripted method, a method-alias, a forwarder or a setter method.

@@ -5053,7 +5135,7 @@
-

2.6.12. List Method-Handles

+

2.6.13. List Method-Handles

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 @@ -5124,7 +5206,7 @@

-

2.6.13. List type of a method

+

2.6.14. List type of a method

The method info ?object? method type is new in NX to obtain the type of the specified method.

@@ -5173,7 +5255,7 @@
-

2.6.14. List the scope of mixin classes

+

2.6.15. List the scope of mixin classes

NX provides a richer set of introspection options to obtain information, where mixins classes are mixed into.

@@ -5296,7 +5378,7 @@
-

2.6.15. Check properties of object and classes

+

2.6.16. Check properties of object and classes

Similar as noted before, NX uses rather a hierarchical approach of naming using multiple layers of subcommands).

@@ -5515,7 +5597,7 @@
-

2.6.16. Call-stack Introspection

+

2.6.17. Call-stack Introspection

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 @@ -6304,7 +6386,7 @@ alter all object/class relations (including class/superclass/object-mixin/…) nsf::relation::set. The class and superclass can be certainly queried -in all variants with info class or info superclass.

+in all variants with info class or info superclasses.