Index: Makefile.in =================================================================== diff -u -rd137fce76cdcb71cb10ea76a24e480923124d12c -rca94e89f9a531dd4c58e22f1b87c0b941689799a --- Makefile.in (.../Makefile.in) (revision d137fce76cdcb71cb10ea76a24e480923124d12c) +++ Makefile.in (.../Makefile.in) (revision ca94e89f9a531dd4c58e22f1b87c0b941689799a) @@ -498,8 +498,8 @@ # $(COMPILE) -c `@CYGPATH@ $(srcdir)/src/win/exampleA.c` -o $@ #======================================================================== -$(src_generic_dir)/predefined.h: $(src_generic_dir)/mk_predefined.tcl $(src_generic_dir)/predefined.tcl - (cd $(src_generic_dir); $(TCLSH) mk_predefined.tcl > predefined.h) +$(src_generic_dir)/predefined.h: $(src_generic_dir)/mk_predefined.tcl $(src_generic_dir)/nsf.tcl + (cd $(src_generic_dir); $(TCLSH) mk_predefined.tcl nsf.tcl > predefined.h) $(src_generic_dir)/tclAPI.h: $(src_generic_dir)/gentclAPI.tcl $(src_generic_dir)/gentclAPI.decls $(TCLSH) $(src_generic_dir)/gentclAPI.tcl > $(src_generic_dir)/tclAPI.h Index: TODO =================================================================== diff -u -re2f11549ef70518cca8c9c49b1d78f4383b00a87 -rca94e89f9a531dd4c58e22f1b87c0b941689799a --- TODO (.../TODO) (revision e2f11549ef70518cca8c9c49b1d78f4383b00a87) +++ TODO (.../TODO) (revision ca94e89f9a531dd4c58e22f1b87c0b941689799a) @@ -1520,6 +1520,19 @@ - renamed ::nsf::cmd::Object into ::nsf::methods::object - renamed ::nsf::cmd::Class into ::nsf::methods::class +- removed capitalization from exit handler interface +- reduced interface of exithandler to + ::nsf::exithandler set|get|unset ?arg? + +- renamed/removed remaining ::nsf::commands with capitalized names: + parametersFromSlots ==> parametersFromSlots + unsetUnknownArgs ==> __unset_unknown_args + infoError removed +- renamed predefined.tcl into nsf.tcl +- remaining cmds in nsf (except __*) containing + "_": ::nsf::provide_method, ::nsf::require_method + + TODO: - extend coro regression test - remove traces of xowish. remove tclAppInt? Index: generic/gentclAPI.decls =================================================================== diff -u -re2f11549ef70518cca8c9c49b1d78f4383b00a87 -rca94e89f9a531dd4c58e22f1b87c0b941689799a --- generic/gentclAPI.decls (.../gentclAPI.decls) (revision e2f11549ef70518cca8c9c49b1d78f4383b00a87) +++ generic/gentclAPI.decls (.../gentclAPI.decls) (revision ca94e89f9a531dd4c58e22f1b87c0b941689799a) @@ -194,7 +194,7 @@ objectMethod noinit NsfONoinitMethod { } -objectMethod require_namespace NsfORequireNamespaceMethod { +objectMethod requirenamespace NsfORequireNamespaceMethod { } objectMethod residualargs NsfOResidualargsMethod { Index: generic/mk_predefined.tcl =================================================================== diff -u -r8aaec98df564488dc8540cd078d6a32dd55a08f7 -rca94e89f9a531dd4c58e22f1b87c0b941689799a --- generic/mk_predefined.tcl (.../mk_predefined.tcl) (revision 8aaec98df564488dc8540cd078d6a32dd55a08f7) +++ generic/mk_predefined.tcl (.../mk_predefined.tcl) (revision ca94e89f9a531dd4c58e22f1b87c0b941689799a) @@ -1,9 +1,9 @@ -#!./nxsh +#!/bin/env tclsh # # A small script file that creates a static array from a tcl- # script for inclusion in c programs -gn # -set f [open predefined.tcl] +set f [open [lindex $argv 0]] set content [read $f] close $f Index: generic/nsf.c =================================================================== diff -u -r3adc7fb2f78db5aa79f1d662cb799ddc86fc5793 -rca94e89f9a531dd4c58e22f1b87c0b941689799a --- generic/nsf.c (.../nsf.c) (revision 3adc7fb2f78db5aa79f1d662cb799ddc86fc5793) +++ generic/nsf.c (.../nsf.c) (revision ca94e89f9a531dd4c58e22f1b87c0b941689799a) @@ -6857,7 +6857,7 @@ INCR_REF_COUNT(resultBody); if (paramDefs && paramPtr->possibleUnknowns > 0) - Tcl_AppendStringsToObj(resultBody, "::nsf::unsetUnknownArgs\n", (char *) NULL); + Tcl_AppendStringsToObj(resultBody, "::nsf::__unset_unknown_args\n", (char *) NULL); Tcl_AppendStringsToObj(resultBody, ObjStr(body), (char *) NULL); return resultBody; @@ -7829,8 +7829,8 @@ static CONST char * StripBodyPrefix(CONST char *body) { - if (strncmp(body, "::nsf::unsetUnknownArgs\n", 24) == 0) - body += 24; + if (strncmp(body, "::nsf::__unset_unknown_args\n", 28) == 0) + body += 28; return body; } @@ -10531,10 +10531,10 @@ if (result == TCL_OK) { if (ov[i] != elementObjPtr) { /* - The elementObjPtr differs from the input tcl_obj, we - switch to the version of this handler building an output - list - */ + * The elementObjPtr differs from the input Tcl_Obj, we + * switch to the version of this handler building an output + * list. + */ /*fprintf(stderr, "switch to output list construction for value %s\n", ObjStr(elementObjPtr));*/ *flags |= NSF_PC_MUST_DECR; @@ -10623,17 +10623,21 @@ } if (pcPtr->objv[i] != newValue) { - /* The output tcl_obj differs from the input, so the tcl_obj - was converted; in case we have set prevously must_decr - on newValue, we decr the refcount on newValue here and - clear the flag */ + /* + * The output Tcl_Obj differs from the input, so the + * Tcl_Obj was converted; in case we have set prevously + * must_decr on newValue, we decr the refcount on newValue + * here and clear the flag. + */ if (mustDecrNewValue) { DECR_REF_COUNT(newValue); pcPtr->flags[i] &= ~NSF_PC_MUST_DECR; } - /* the new output value itself might require a decr, so - set the flag here if required; this is just necessary - for multivalued converted output */ + /* + * The new output value itself might require a decr, so + * set the flag here if required; this is just necessary + * for multivalued converted output. + */ if (mustDecrList) { pcPtr->flags[i] |= NSF_PC_MUST_DECR; pcPtr->mustDecr = 1; @@ -10648,9 +10652,10 @@ pPtr->nameObj ? ObjStr(pPtr->nameObj) : pPtr->name, "' is missing", (char *) NULL); } else { - /* Use as dummy default value an arbitrary symbol, which must not be - * returned to the Tcl level level; this value is - * unset later by unsetUnknownArgs + /* + * Use as dummy default value an arbitrary symbol, which must + * not be returned to the Tcl level level; this value is unset + * later by NsfUnsetUnknownArgsCmd(). */ pcPtr->objv[i] = NsfGlobalObjs[NSF___UNKNOWN__]; } @@ -10739,8 +10744,10 @@ } } if (!found) { - /* we did not find the specified flag, the thing starting - with a '-' must be an argument */ + /* + * We did not find the specified flag, the thing starting + * with a '-' must be an argument + */ break; } } @@ -15566,7 +15573,23 @@ * needs probably modifications for earlier versions of Tcl. However, * since CANONICAL_ARGS requires Tcl 8.5 this is not an issue. */ -int +/* + *---------------------------------------------------------------------- + * NsfUnsetUnknownArgsCmd -- + * + * Unset variables set from arguments with the default dummy + * default value. The dummy default values are set by + * ArgumentDefaults() + * + * Results: + * Tcl result code. + * + * Side effects: + * unsets some variables + * + *---------------------------------------------------------------------- + */ +static int NsfUnsetUnknownArgsCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { CallFrame *varFramePtr = Tcl_Interp_varFramePtr(interp); @@ -16063,7 +16086,7 @@ #endif /*Tcl_CreateObjCommand(interp, "::nsf::K", NsfKObjCmd, 0, 0);*/ - Tcl_CreateObjCommand(interp, "::nsf::unsetUnknownArgs", NsfUnsetUnknownArgsCmd, 0, 0); + Tcl_CreateObjCommand(interp, "::nsf::__unset_unknown_args", NsfUnsetUnknownArgsCmd, 0, 0); #ifdef NSF_BYTECODE NsfBytecodeInit(); Index: generic/nsf.nxd =================================================================== diff -u --- generic/nsf.nxd (revision 0) +++ generic/nsf.nxd (revision ca94e89f9a531dd4c58e22f1b87c0b941689799a) @@ -0,0 +1,295 @@ +# @command assertion +# +# @parameter object:object +# @parameter assertionsubcmd:required +# @parameter arg + +# @command existsvar +# +# @parameter object:object +# @parameter var + +# @command methodproperty +# +# @parameter object:object +# @parameter -per-object:switch +# @parameter methodName +# @parameter methodproperty Accepts one of: {{{protected}}}, +# {{{redefine-protected}}}, {{{returns}}}, {{{slotobj}}} +# @parameter value + +# @command setter +# +# @parameter object:object +# @parameter -per-object:switch +# @parameter parameter + +# @command createobjectsystem +# +# @parameter rootClass +# @parameter rootMetaClass +# @parameter systemMethods:optional + +# @command dispatch +# +# @parameter object:object +# @parameter -objscope +# @parameter command +# @parameter args + +# @command deprecated +# +# @parameter what +# @parameter oldCmd +# @parameter newCmd:optional + +# @command objectproperty +# +# @parameter object:object +# @parameter objectkind Accepts one of: {{{type}}}, {{{object}}}, +# {{{class}}}, {{{baseclass}}}, {{{metaclass}}}, {{{hasmixin}}} +# @parameter value:optional + +# @command importvar +# +# @parameter object:object +# @parameter args + +# @command parametercheck +# +# @parameter -nocomplain +# @parameter param +# @parameter value:optional + +# @command forward +# +# @parameter object:object +# @parameter -per-object:switch +# @parameter method +# @parameter -default +# @parameter -earlybinding:switch +# @parameter -methodprefix +# @parameter -objscope:switch +# @parameter -onerror +# @parameter -verbose:switch +# @parameter target +# @parameter args + +# @command setvar +# +# @parameter object:object +# @parameter variable +# @parameter value + +# @command method +# +# @parameter object:object +# @parameter -inner-namespace +# @parameter -per-object +# @parameter -public +# @parameter name +# @parameter args +# @parameter body +# @parameter -percondition +# @parameter -postcondition + +# @command next +# +# Invokes the shadowed (i.e, same-named) method which is next along +# the precedence path and returns the results of this invocation. If +# {{{next}}} is called without arguments, the arguments of the current +# method (i.e., the arguments as present at the current callframe) are +# passed through to the shadowed method. If next is invoked with the +# flag --noArgs, the shadowed method is called without the active +# callframe arguments. If other arguments are specified for {{{next}}} +# explicitly, these will be passed instead. +# +# @parameter --noArgs:optional Deactivates the forward-passing of the current callframe's arguments +# @parameter args Explicitly declared arguments to pass to shadowed methods + + +# @command current +# +# An introspective command which allows you to explore the "Next" +# callstack from within the scope of a method (or procif bound to an +# object via {{{alias}}}). {{{current}}} computes callstack related +# information. If executed without specifying a subcommand, +# i.e. {{{[current]}}}, returns the name of the object, which is +# currently in execution. If called from outside a proc, it returns +# the error message "No current object". +# +# It comes with a variety of subcommands to query different bits of +# callstack information. See below. +# +# @sub-command class Returns the name of the class holding the +# currently executing per-class method, if and only if called from +# within a per-class method. Note, that this method-owning class may +# be different to the class of the current object. If called from +# within a per-object method, it returns an empty string. +# +# @sub-command proc Returns the name of the currently executing method. +# +# @sub-command callingclass Returns the name of the class which is +# calling into the executing method. +# +# @sub-command callingobject Returns the name of the object which is +# calling into the executing method. +# +# @sub-command calledclass Returns the name of the class that holds +# the originally (and now shadowed) target method (applicable in +# mixin classes and filters). +# +# @sub-command calledproc Returns the name of the target method +# (applicable in a filter only). +# +# @sub-command isnextcall Returns 1 if the executing method was +# invoked via {{@command ::nx::next}}, 0 otherwise. +# +# @sub-command next Returns the name of the method next on the +# precedence path as a string. +# +# @sub-command filterreg In a method serving as active filter, +# returns the name of the object (class) on which the method is +# registered as a filter. +# +# @sub-command callinglevel Returns the "original" callstack level +# calling into the executing method. Intermediary {{{next}}} calls +# are ignored in this computation. The level is returned in a form +# so that it can be used as first argument in {{@method ::nx::Object +# class uplevel}} or {{@method ::nx::Object class upvar}}. +# +# @sub-command activelevel Returns the actual callstack level calling +# into the executing method. The active might correspond the +# {{{callinglevel}}}, but this is not necessarily the case. The +# {{{activelevel}}} counts {{@command ::nx::next}} call. The level +# is returned in a form so that it can be used as first argument in +# {{@method ::nx::Object class uplevel}} or {{@method ::nx::Object +# class upvar}}. + +# @command configure +# +# A top-level configuration facility which allows you modify +# properties of the "Next" object system for the scope of an entire +# {{{interp}}}. + +# @command.sub-command {configure filter} +# +# Allows turning on or off filters globally for the current +# interpreter. By default, the filter state is turned off. This +# function returns the old filter state. This filterless {{{interp}}} +# state is needed for the serializer which should introspect and stream the +# objects and classes without being affected by active filter. +# +# @parameter toggle Accepts either "on" or "off" +# @return The current filter activation state + +# @command.sub-command {configure softrecreate} +# +# Allows controlling the scheme applied when recreating an object or a +# class. By default, it is set to {{{off}}}. This means that the +# object/class is destroyed and all relations +# (e.g. subclass/superclass) to other objects/classes are revoked as +# well. If softrecreate is set to {{{on}}}, the object is re-set, but not +# destroyed, the relations are +# kept. +# +# A "soft" recreation is important for e.g. reloading a file with +# class definitions (e.g. when used in OpenACS with file watching and +# reloading). With softrecreate set, it is not necessary to recreate +# dependent subclasses etc. Consider the example of a class hierarchy +# {{{A <- B <- C}}}. Without {{{softrecreate}}} set, a reload of +# {{{B}}} means first a destroy of B, leading to {{{A <- C}}}, and +# instances of {{{B}}} are re-classed to {{@object +# ::nx::Object}}. When softrecreate is set, the class hierarchy +# remains untouched. +# +# @parameter toggle Accepts either "on" or "off" +# @return The current toggle value + + +# @command.sub-command {configure objectsystems} +# +# A mere introspection subcommand. It gives you the top level of the +# current object system, i.e., the ruling root class and root +# meta-class. For "Next": +# +# {{{ +# configure objectsystems; # returns "::nx::Object ::nx::Class" +# }}} +# +# @return The active pair of root class and root meta-class + +# @command.sub-command {configure keepinitcmd} +# +# Usually, initcmd scripts are discarded by the {{{interp}}} once +# having been evaluated (in contrast to {{{proc}}} and {{{method}}} +# bodies). If you need them preserved for later introspection and +# processing (as in the "Next" documentation system), set this option +# to {{{true}}}. Then, the initcmd scripts are retained as a +# particular object variable ({{{__initcmd}}}) of classes and +# objects. It defaults to {{{false}}}. +# +# @parameter value:boolean Either {{{true}}} or {{{false}}} +# @return The current setting + +# @command alias +# +# @parameter object:object The target object which becomes the owner of +# the aliased command (method, object or command). +# +# @parameter -per-object:switch If the target object is a class, one can +# specify the binding scope (i.e., per-object or per-class) of the +# aliased command +# +# @parameter methodName The name of the alias. +# @parameter -nonleaf:switch ... +# @parameter -objscope:switch ... +# @parameter cmdName The alias source as a command handle (as returned by ...) + +# @command finalize + +# @command interp +# +# @parameter name +# @parameter args + +# @command is +# +# @parameter value +# @parameter constraint +# @parameter -hasmixin +# @parameter -type +# @parameter arg + +# @command my +# +# @parameter -local +# @parameter method +# @parameter args + +# @command relation +# +# @parameter object +# @parameter relationtype +# @parameter value + +# @command provide_method +# +# @parameter require_name +# @parameter definition +# @parameter script:optional + +# @command require_method +# +# @parameter object +# @parameter name +# @parameter per_object + +# @command mixin +# +# @parameter object +# @parameter args + +# @command tmpdir +# +# @return The platform-specific path name to the system-wide temporary directory \ No newline at end of file Index: generic/nsf.tcl =================================================================== diff -u --- generic/nsf.tcl (revision 0) +++ generic/nsf.tcl (revision ca94e89f9a531dd4c58e22f1b87c0b941689799a) @@ -0,0 +1,106 @@ +namespace eval ::nsf { + # + # get frequenly used primitiva into the ::nsf namespace + # + # Symbols reused in the next scripting language + + + namespace export next current + + # Symbols reused in XOTcl + + namespace export alias configure finalize interp is my relation + + # + # support for method provide and method require + # + + proc ::nsf::provide_method {require_name definition {script ""}} { + set ::nsf::methodIndex($require_name) [list definition $definition script $script] + } + + proc ::nsf::require_method {object name {per_object 0}} { + set key ::nsf::methodIndex($name) + if {[info exists $key]} { + array set "" [set $key] + if {$(script) ne ""} { + eval $(script) + } + if {$per_object} { + set cmd [linsert $(definition) 1 -per-object] + eval [linsert $cmd 1 $object] + } else { + eval [linsert $(definition) 1 $object] + } + } else { + error "cannot require method $name for $object, method unknown" + } + } + + # + # ::nsf::mixin + # + # provide a similar interface as for ::nsf::method, ::nsf::alias, ... + # + + proc ::nsf::mixin {object args} { + if {[lindex $args 0] eq "-per-object"} { + set rel "object-mixin" + set args [lrange $args 1 end] + } else { + set rel "mixin" + } + set oldSetting [::nsf::relation $object $rel] + # use uplevel to avoid namespace surprises + uplevel [list ::nsf::relation $object $rel [linsert $oldSetting end $args]] + } + + # + # provide some popular methods for "method require" + # + ::nsf::provide_method autoname {::nsf::alias autoname ::nsf::methods::object::autoname} + ::nsf::provide_method exists {::nsf::alias exists ::nsf::methods::object::exists} + + # + # exit handlers + # + proc ::nsf::exithandler {args} { + lassign $args op value + switch $op { + set {::proc ::nsf::__exithandler {} $value} + get {::info body ::nsf::__exithandler} + unset {proc ::nsf::__exithandler args {;}} + default {error "syntax: ::nsf::exithandler set|get|unset ?arg?"} + } + } + # initialize exit handler + ::nsf::exithandler unset + + # + # determine platform aware temp directory + # + + proc tmpdir {} { + foreach e [list TMPDIR TEMP TMP] { + if {[info exists ::env($e)] \ + && [file isdirectory $::env($e)] \ + && [file writable $::env($e)]} { + return $::env($e) + } + } + if {$::tcl_platform(platform) eq "windows"} { + foreach d [list "C:\\TEMP" "C:\\TMP" "\\TEMP" "\\TMP"] { + if {[file isdirectory $d] && [file writable $d]} { + return $d + } + } + } + return /tmp + } + + namespace export tmpdir + + # if HOME is not set, and ~ is resolved, Tcl chokes on that + if {![info exists ::env(HOME)]} {set ::env(HOME) /root} + +} Index: generic/predefined.h =================================================================== diff -u -r3adc7fb2f78db5aa79f1d662cb799ddc86fc5793 -rca94e89f9a531dd4c58e22f1b87c0b941689799a --- generic/predefined.h (.../predefined.h) (revision 3adc7fb2f78db5aa79f1d662cb799ddc86fc5793) +++ generic/predefined.h (.../predefined.h) (revision ca94e89f9a531dd4c58e22f1b87c0b941689799a) @@ -24,11 +24,6 @@ "uplevel [list ::nsf::relation $object $rel [linsert $oldSetting end $args]]}\n" "::nsf::provide_method autoname {::nsf::alias autoname ::nsf::methods::object::autoname}\n" "::nsf::provide_method exists {::nsf::alias exists ::nsf::methods::object::exists}\n" -"proc ::nsf::infoError msg {\n" -"regsub -all \" \" $msg \"\" msg\n" -"regsub -all \" \" $msg \"\" msg\n" -"regsub {\\\"} $msg \"\\\"info \" msg\n" -"error $msg \"\"}\n" "proc ::nsf::exithandler {args} {\n" "lassign $args op value\n" "switch $op {\n" Fisheye: Tag ca94e89f9a531dd4c58e22f1b87c0b941689799a refers to a dead (removed) revision in file `generic/predefined.nxd'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag ca94e89f9a531dd4c58e22f1b87c0b941689799a refers to a dead (removed) revision in file `generic/predefined.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: generic/tclAPI.h =================================================================== diff -u -re2f11549ef70518cca8c9c49b1d78f4383b00a87 -rca94e89f9a531dd4c58e22f1b87c0b941689799a --- generic/tclAPI.h (.../tclAPI.h) (revision e2f11549ef70518cca8c9c49b1d78f4383b00a87) +++ generic/tclAPI.h (.../tclAPI.h) (revision ca94e89f9a531dd4c58e22f1b87c0b941689799a) @@ -2272,7 +2272,7 @@ {"::nsf::methods::object::noinit", NsfONoinitMethodStub, 0, { } }, -{"::nsf::methods::object::require_namespace", NsfORequireNamespaceMethodStub, 0, { +{"::nsf::methods::object::requirenamespace", NsfORequireNamespaceMethodStub, 0, { } }, {"::nsf::methods::object::residualargs", NsfOResidualargsMethodStub, 1, { Index: library/nx/nx.tcl =================================================================== diff -u -re2f11549ef70518cca8c9c49b1d78f4383b00a87 -rca94e89f9a531dd4c58e22f1b87c0b941689799a --- library/nx/nx.tcl (.../nx.tcl) (revision e2f11549ef70518cca8c9c49b1d78f4383b00a87) +++ library/nx/nx.tcl (.../nx.tcl) (revision ca94e89f9a531dd4c58e22f1b87c0b941689799a) @@ -39,7 +39,7 @@ # foreach cmd [info command ::nsf::methods::object::*] { set cmdName [namespace tail $cmd] - if {$cmdName in [list "autoname" "exists" "filterguard" "instvar" "mixinguard" "require_namespace"]} continue + if {$cmdName in [list "autoname" "exists" "filterguard" "instvar" "mixinguard" "requirenamespace"]} continue ::nsf::alias Object $cmdName $cmd } @@ -324,7 +324,7 @@ ::nsf::require_method [::nsf::current object] [lindex $args 0] 0 } namespace { - ::nsf::dispatch [::nsf::current object] ::nsf::methods::object::require_namespace + ::nsf::dispatch [::nsf::current object] ::nsf::methods::object::requirenamespace } } } @@ -873,11 +873,11 @@ return [list oparam $objparamdefinition mparam $methodparamdefinition] } - proc ::nsf::parametersFromSlots {obj} { + proc ::nsf::parametersfromslots {obj} { set parameterdefinitions [list] foreach slot [::nsf::dispatch $obj ::nsf::methods::object::info::lookupslots -type ::nx::Slot] { # Skip some slots for xotcl; - # TODO: maybe different parameterFromSlots for xotcl? + # TODO: maybe different parametersfromslots for xotcl? if {[::nsf::is class ::xotcl::Object] && [::nsf::dispatch $obj ::nsf::methods::object::info::hastype ::xotcl::Object] && ([$slot name] eq "mixin" || [$slot name] eq "filter") @@ -890,7 +890,7 @@ Object protected method objectparameter {{lastparameter __initcmd:initcmd,optional}} { #puts stderr "... objectparameter [::nsf::current object]" - set parameterdefinitions [::nsf::parametersFromSlots [::nsf::current object]] + set parameterdefinitions [::nsf::parametersfromslots [::nsf::current object]] if {[::nsf::is class [::nsf::current object]]} { lappend parameterdefinitions -attributes:method,optional } @@ -983,7 +983,7 @@ } ############################################ - # system slots + # Register system slots ############################################ proc register_system_slots {os} { @@ -1280,7 +1280,7 @@ if {![info exists object]} {set object [::nsf::current object]} if {![::nsf::isobject $object]} {$class create $object} # reused in XOTcl, no "require" there, so use nsf primitiva - ::nsf::dispatch $object ::nsf::methods::object::require_namespace + ::nsf::dispatch $object ::nsf::methods::object::requirenamespace if {$withnew} { set m [ScopedNew new -volatile \ -container $object -withclass $class] @@ -1376,7 +1376,7 @@ ::nsf::relation $obj object-mixin [::nsf::relation $origin object-mixin] # reused in XOTcl, no "require" there, so use nsf primitiva if {[::nsf::dispatch $origin ::nsf::methods::object::info::hasnamespace]} { - ::nsf::dispatch $obj ::nsf::methods::object::require_namespace + ::nsf::dispatch $obj ::nsf::methods::object::requirenamespace } } else { namespace eval $dest {} Index: library/xotcl/library/xotcl2.tcl =================================================================== diff -u -re2f11549ef70518cca8c9c49b1d78f4383b00a87 -rca94e89f9a531dd4c58e22f1b87c0b941689799a --- library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision e2f11549ef70518cca8c9c49b1d78f4383b00a87) +++ library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision ca94e89f9a531dd4c58e22f1b87c0b941689799a) @@ -71,7 +71,7 @@ # provide the standard command set for ::xotcl::Object foreach cmd [info command ::nsf::methods::object::*] { set cmdName [namespace tail $cmd] - if {$cmdName in [list "setter" "require_namespace"]} continue + if {$cmdName in [list "setter" "requirenamespace"]} continue ::nsf::alias Object $cmdName $cmd } @@ -234,7 +234,7 @@ ::nsf::alias Object mixinguard ::nsf::methods::object::mixinguard ::nsf::alias Class instmixinguard ::nsf::methods::class::mixinguard - ::nsf::alias Object requireNamespace ::nsf::methods::object::require_namespace + ::nsf::alias Object requireNamespace ::nsf::methods::object::requirenamespace # define instproc and proc ::nsf::method Class instproc { @@ -288,10 +288,11 @@ Object instproc self {} {::xotcl::self} # - # objectparameter definition, backwards compatible + # objectparameter definition, backwards upward compatible. We use + # here the definition of parametersfromslots from nx.tcl # ::xotcl::Object instproc objectparameter {} { - set parameterdefinitions [::nsf::parametersFromSlots [self]] + set parameterdefinitions [::nsf::parametersfromslots [self]] lappend parameterdefinitions args #puts stderr "*** parameter definition for [self]: $parameterdefinitions" return $parameterdefinitions @@ -312,7 +313,7 @@ } ############################################ - # system slots + # Register system slots ############################################ proc register_system_slots {os} { # We need explicit ::xotcl prefixes, since they are always skipped @@ -346,9 +347,19 @@ Object create ::xotcl::objectInfo Object create ::xotcl::classInfo - # note, we are using ::nsf::infoError, defined my nsf + # note, we are using ::xotcl::infoError, defined below #Object instforward info -onerror ::nsf::infoError ::xotcl::objectInfo %1 {%@2 %self} #Class instforward info -onerror ::nsf::infoError ::xotcl::classInfo %1 {%@2 %self} + # + # error handler for info + # + #proc ::nsf::infoerror msg { + # #puts stderr "INFO ERROR: <$msg>\n$::errorInfo" + # regsub -all " " $msg "" msg + # regsub -all " " $msg "" msg + # regsub {\"} $msg "\"info " msg + # error $msg "" + #} ::nsf::alias Object info ::xotcl::objectInfo ::nsf::alias Class info ::xotcl::classInfo