Index: TODO =================================================================== diff -u -r89b5047e54e47a88a7de75d8523a07ffa5743407 -r30173337f3b4d0d9c224713b2c86c622b26f3046 --- TODO (.../TODO) (revision 89b5047e54e47a88a7de75d8523a07ffa5743407) +++ TODO (.../TODO) (revision 30173337f3b4d0d9c224713b2c86c622b26f3046) @@ -979,6 +979,8 @@ (such as e.g. "::C instproc foo") - changed "next" to current in documentation framework and templates +- updated migration guide, added section for callstack introspection +- updated serializer for new names TODO: - nameing Index: doc/next-migration.html =================================================================== diff -u -r66d3afcb91282c93bbb5cc6e6452d8358a6a275d -r30173337f3b4d0d9c224713b2c86c622b26f3046 --- doc/next-migration.html (.../next-migration.html) (revision 66d3afcb91282c93bbb5cc6e6452d8358a6a275d) +++ doc/next-migration.html (.../next-migration.html) (revision 30173337f3b4d0d9c224713b2c86c622b26f3046) @@ -272,6 +272,8 @@ #     instforward
#     parametercmd
#     instparametercmd
+ #
+ # All these methods return empty.
@@ -281,6 +283,8 @@ #     setter
#     alias
#     attribute
+ #
+ # All these methods return method-handles.
@@ -865,7 +869,10 @@ XOTclNext Scripting Language obj info filter ?-order? ?-guards? ?pattern? - obj info filter ?-order? ?-guards? ?pattern? + # ... info filter -order ... returns now + method-handles
+ # instead of triples (applies to all three variants)


+ obj info filter ?-order? ?-guards? ?pattern? cls info filter ?-order? ?-guards? ?pattern? @@ -1013,6 +1020,71 @@ +

Callstack Introspection

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
XOTclNext Scripting Language
selfcurrent
+
+ current object +
self classcurrent class
self proccurrent method
self callingclasscurrent currentclass
self callingobjectcurrent callingobject
self callingproccurrent callingmethod
self calledclasscurrent calledclass
self calledproccurrent calledmethod
self isnextcallcurrent isnextcall
self next# returns now method-handle
+ current next
self filterreg# returns now method-handle
+ current filterreg
self callinglevelcurrent callinglevel
self activelevelcurrent activelevel
+ +

Predefined Methods

Dispatch, Aliases, etc.

Assertions

@@ -1062,11 +1134,21 @@

Incompatibilities between Next Scripting/XOTcl 2.0 and XOTcl 1.*

Resolvers

-

The tesolvers of the Next Scripting Framework are used as well +

The resolvers of the Next Scripting Framework are used as well within XOTcl 2.0. When names starting with single colons are used in XOTcl 1.* scripts, conflicts will arise.

+

Slots

+

All slots are now always next-scripting objects. +

+ +

Obsolete commands

+ +

Parameterclasses were rarely used and have been replaced by the more +general object parameterization. Therefore, cl info +parameterclass has been removed. +

Stronger Checking

The Next Scripting Framework performs stronger checking than XOTcl @@ -1075,17 +1157,7 @@

Different results

@@ -1104,6 +1176,6 @@
- Last modified: Wed Aug 4 11:06:52 CEST 2010 + Last modified: Tue Aug 10 20:35:08 CEST 2010 Index: library/serialize/serializer.tcl =================================================================== diff -u -r8274c68ad85f12b1e4a41a01273079405fa865ef -r30173337f3b4d0d9c224713b2c86c622b26f3046 --- library/serialize/serializer.tcl (.../serializer.tcl) (revision 8274c68ad85f12b1e4a41a01273079405fa865ef) +++ library/serialize/serializer.tcl (.../serializer.tcl) (revision 30173337f3b4d0d9c224713b2c86c622b26f3046) @@ -154,7 +154,7 @@ :method init {} { # Never serialize the (volatile) serializer object - :ignore [self] + :ignore [::nx::core::current object] } :method warn msg { @@ -179,7 +179,7 @@ # we export the object tree. set oo $o while {1} { - if {[::nx::core::existsvar [self class] exportObjects($o)]} { + if {[::nx::core::existsvar [::nx::core::current class] exportObjects($o)]} { return 1 } # we do this for object trees without object-less namespaces @@ -213,7 +213,7 @@ set :level($stratum) {} foreach c $set { set oss [set :serializer($c)] - if {[$oss needsNothing $c [self]]} { + if {[$oss needsNothing $c [::nx::core::current object]]} { lappend :level($stratum) $c } } @@ -247,7 +247,7 @@ #.warn "serialize $i" #append result "# Stratum $l\n" set oss [set :serializer($i)] - append result [$oss serialize $i [self]] \n + append result [$oss serialize $i [::nx::core::current object]] \n } } foreach e $list { @@ -292,7 +292,7 @@ # assumes $o to be fully qualified set instances [Serializer allChildren $o] foreach oss [ObjectSystemSerializer info instances] { - $oss registerSerializer [self] $instances + $oss registerSerializer [::nx::core::current object] $instances } :serialize-objects $instances 1 } @@ -358,7 +358,7 @@ # don't filter anything during serialization set filterstate [::nx::core::configure filter off] - set s [:new -childof [self] -volatile] + set s [:new -childof [::nx::core::current object] -volatile] if {[info exists ignoreVarsRE]} {$s ignoreVarsRE $ignoreVarsRE} if {[info exists ignore]} {$s ignore $ignore} @@ -398,13 +398,13 @@ } :object method methodSerialize {object method prefix} { - set s [:new -childof [self] -volatile] + set s [:new -childof [::nx::core::current object] -volatile] concat $object [$s method-serialize $object $method $prefix] } :object method deepSerialize {-ignoreVarsRE -ignore -map args} { :resetPattern - set s [:new -childof [self] -volatile] + set s [:new -childof [::nx::core::current object] -volatile] if {[info exists ignoreVarsRE]} {$s ignoreVarsRE $ignoreVarsRE} if {[info exists ignore]} {$s ignore $ignore} @@ -416,7 +416,7 @@ } # include Serializer in the serialized code - :exportObjects [self] + :exportObjects [::nx::core::current object] } @@ -429,8 +429,8 @@ :method init {} { # Include object system serializers and the meta-class in "Serializer all" - Serializer exportObjects [self class] - Serializer exportObjects [self] + Serializer exportObjects [::nx::core::current class] + Serializer exportObjects [::nx::core::current object] } # @@ -468,7 +468,7 @@ # Communicate responsibility to serializer object $s foreach i $instances { if {![::nx::core::objectproperty $i type ${:rootClass}]} continue - $s setObjectSystemSerializer $i [self] + $s setObjectSystemSerializer $i [::nx::core::current object] } } @@ -480,10 +480,10 @@ if {[:matchesIgnorePattern $i] && ![$s isExportedObject $i]} { continue } - $s setObjectSystemSerializer $i [self] + $s setObjectSystemSerializer $i [::nx::core::current object] lappend instances $i } - #$s warn "[self] handled instances: $instances" + #$s warn "[::nx::core::current object] handled instances: $instances" return $instances } @@ -555,7 +555,7 @@ if {![info exists methods($o)]} continue append r \n $methods($o) } - #puts stderr "[self] ... exportedMethods <$r\n>" + #puts stderr "[::nx::core::current object] ... exportedMethods <$r\n>" return "$r\n" } @@ -661,7 +661,7 @@ :method Object-serialize {o s} { :collect-var-traces $o $s append cmd [list [$o info class] create \ - [::nx::core::dispatch $o -objscope ::xotcl::self]] + [::nx::core::dispatch $o -objscope ::nx::core::current object]] append cmd " -noinit\n" foreach i [lsort [::nx::core::cmd::ObjectInfo::methods $o]] { @@ -703,7 +703,7 @@ # register serialize a global method ::nx::Object method serialize {} { - ::Serializer deepSerialize [self] + ::Serializer deepSerialize [::nx::core::current object] } } @@ -789,7 +789,7 @@ :method Object-serialize {o s} { :collect-var-traces $o $s - append cmd [list [$o info class] create [::nx::core::dispatch $o -objscope ::xotcl::self]] + append cmd [list [$o info class] create [::nx::core::dispatch $o -objscope ::nx::core::current object]] # slots needs to be initialized when optimized, since # parametercmds are not serialized append cmd " -noinit\n" @@ -847,7 +847,7 @@ # register serialize a global method for XOTcl ::xotcl::Object instproc serialize {} { - ::Serializer deepSerialize [self] + ::Serializer deepSerialize [::nx::core::current object] } Index: tests/doc.tcl =================================================================== diff -u -r89b5047e54e47a88a7de75d8523a07ffa5743407 -r30173337f3b4d0d9c224713b2c86c622b26f3046 --- tests/doc.tcl (.../doc.tcl) (revision 89b5047e54e47a88a7de75d8523a07ffa5743407) +++ tests/doc.tcl (.../doc.tcl) (revision 30173337f3b4d0d9c224713b2c86c622b26f3046) @@ -695,14 +695,18 @@ # TODO: there is still --noArgs on [next], which does not correspond # to single-dashed flags used elsewhere. Why? # - # (a) backward compatibility and (b) dow you have suggestions? + # (a) backward compatibility and (b) do you have suggestions? # TODO: renaming of self to current? # # what do you mean by "renaming"? both commands were available # since a while. Maybe we should not import "self" into next scripting. - # DONE (sel is not imported anymore, all occurnces in next tests are changed) - # Not sure, we should keep since, since it will be a problem in many scripts. + # + # DONE (self is not imported anymore, all occurrences in next tests are changed) + # Not sure, we should keep since, since it will be a problem in many scripts + # (e.g. in all slots, since slots are always next objects; maybe some advanced + # OpenACS users will be hit). + # # TODO: is [self callingclass] == [[self callingobject] info class]? # @@ -715,11 +719,13 @@ # operation (less generic). ... same for "filterreg" # # this is most likely "self next" and "self filterreg", - # but as well for .e.g "info filter ... -order ..." + # but applies as well for .e.g "info filter ... -order ..." # there are already changes to xotcl (see migration guide). # since the handle works now as well for "info method", # this could be effectively done, but it requires # backward compatibility. + # + # DONE } if {$log} {