Index: xotcl/ChangeLog =================================================================== diff -u -r78e82b3563a644f2df47320eacc693f1b788b03c -rbb3c756fb47517596b9dbcb4e580aa1212827b41 --- xotcl/ChangeLog (.../ChangeLog) (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/ChangeLog (.../ChangeLog) (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) @@ -1,3 +1,110 @@ +2006-09-14 , Uwe Zdun + * Release of XOTcl 1.5.0 + +2006-09-13 Uwe Zdun + * Update of build files for windows + +2006-09-10 + * added method "contains" to create objects aggregated into + other objects (essentially a value added back-port of the OpenACS + version). + * based method "slots" on method "contains" for improved orthogonality + * rearranging sections in the tutorial + * deleted obsolete sections from the tutorial + * serializer: when an object is defined as exported, export the whole + object tree (no need to specify export of all slots for exported objects) + +2006-09-08 + * added -verbose to forward options + * added subst to the tcl-impored methods + * fixed a bug with .... -slots {Attribute new -name a1} + (Many thanks to neophytos for reporting} + * provide method serialize (for Object), when the serializer package is loaded + +2006-09-07 + * provided Tcl 8.5a4 compatibility + * spellechecking langref, make terminology more consistent + (naming of arguments like .e.g methodName) + +2006-09-04 + * update of tcl.m4 for newest TEA from CVS + +2006-09-03 + * "mixin|filter|instmixin|instfilter set ..." deprecated, use + "mixin|filter|instmixin|instfilter assign ..." instead + +2006-09-01 + * fixed a bug in the xotcl trace module (many thanks to jima for reporting) + * extended procsearch to report parametercmd and instparametercmd + +2006-08-30 + * extended procsearch to report as well [inst]parametercmd + +2006-08-26 + * extended procsearch to report as well [inst]forward and [inst]cmd + +2006-08-25 + * new subcommand "info slots" + * implemented backwards bug-compatible "info parameter", deprecated + +2006-08-23 + * added system slots and attribute slots (see documentation) + +2006-08-21 + * changed the implementation of the configure command + and setrelation command to use Tcl_GetIndexFromObj(); + * added the subcommand "class" and "superclass" to the + the setrelation command. + +2006-08-22 + * fixed a bug with nonpositional arguments, some + positional arguments and "args" + * fixed a bug in nonpositional arguments when called without + arguments + * improved error messages in connection with nonpositional arguments + * extended interface of XOTclErrBadVal() to provide better error messages + (this changes the stub interface, so we have to change the version number) + +2006-08-21 + * new command for registering predefined C-implemented Tcl commands + as methods + ::xotcl::alias | \ + ?-objscope? ?-per-object? + "-objscope" has the same meaning as for forwarder, + "-per-object" has the same meaning as for the method "method", + This command is somewhat similar to "[inst]forward -earlybinding", + but can be used to bootstrap xotcl (when e.g. no methods are + available). + +2006-07-20 + * Documentation bug: method volatile was documented + as a method of class, but is documented as a method of object + (Many thanks to Kristoffer for reporting) + +2006-05-22 + * package.xotcl: evaluating calls to "tcl_package" in the + global namespace instead of the current. This fixes problem of + xotcl 1.4.* with xotclide. Many thanks to + Bill Paulsen and Artur Trzewik for identifying the problem and + suggesting a fix. + +2006-04-20 + * xotcl.c: new option for the argument substitution. When the argument + list of the forward command contains "%argclindex {a b c}", then + depending of the number of arguments at invocation "a", "b" + or "c" is substituted. + * New option for forwarder: The option -earlybinding can be used to look + up the function pointer of the called Tcl command at + definition time of the forwarder instead of invocation time. + This option should only be used for calling C-implemented Tcl commands) + +2006-03-22 + * deprecated command filterappend, instfilterappend, mixinappend, + instmixinappend, tclcmd, insttclcmd deleted + +2006-03-20 + * allow single colons in method names (fix in xotcl.c, NSTail()) + 2006-02-17 , Uwe Zdun * release of 1.4.0 Index: xotcl/Makefile =================================================================== diff -u -rad8a63234e44a8788efede276e811051ab891fbe -rbb3c756fb47517596b9dbcb4e580aa1212827b41 --- xotcl/Makefile (.../Makefile) (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/Makefile (.../Makefile) (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) @@ -12,24 +12,24 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: Makefile,v 1.37 2005/09/09 21:09:01 neumann Exp $ +# RCS: @(#) $Id: Makefile,v 1.38 2006/09/14 06:36:01 neumann Exp $ #======================================================================== # Add additional lines to handle any additional AC_SUBST cases that # have been added in a customized configure script. #======================================================================== -#XOTCL_VERSION = 1.3.7 -XOTCL_VERSION = 1.3 +#XOTCL_VERSION = 1.5.0 +XOTCL_VERSION = 1.5 src_lib_dir = ${srcdir}/library src_doc_dir = ${srcdir}/doc src_test_dir = ${srcdir}/tests src_app_dir = ${srcdir}/apps src_generic_dir = ${srcdir}/generic -TCL_LIB_SPEC = -L/usr/local/lib -ltcl8.4 -TK_LIB_SPEC = -L/usr/local/lib -ltk8.4 -subdirs = library/store/XOTclSdbm/ library/store/XOTclGdbm/ library/xml/TclExpat-1.1/ +TCL_LIB_SPEC = -L/usr/local/src/tcl8.4.13/unix -ltcl8.4 +TK_LIB_SPEC = +subdirs = aol_prefix = /usr/local/aolserver # Requires native paths @@ -42,9 +42,9 @@ src_app_dir_native = `echo ${src_app_dir}` src_generic_dir_native = `echo ${src_generic_dir}` -libdirs = comm lib serialize actiweb rdf registry store xml patterns +libdirs = comm lib serialize libsrc = COPYRIGHT pkgIndex.tcl -appdirs = comm scripts utils actiweb persistence +appdirs = comm scripts utils appsrc = COPYRIGHT DOC_SOURCE = \ @@ -58,7 +58,7 @@ $(src_app_dir)/actiweb/univ/UNIVERSAL.xotcl \ $(src_app_dir)/utils/xo-*[a-z0-9] -export TCLLIBPATH=. ${srcdir} +#export TCLLIBPATH=. ${srcdir} mkinstalldirs= mkdir -p #======================================================================== # Nothing of the variables below this line should need to be changed. @@ -98,8 +98,8 @@ # configuration options) composed of the named objects. #======================================================================== -PKG_LIB_FILE = libxotcl1.3.7.dylib -PKG_STUB_LIB_FILE = libxotclstub1.3.7.a +PKG_LIB_FILE = libxotcl1.5.0.dylib +PKG_STUB_LIB_FILE = libxotclstub1.5.0.a lib_BINARIES = $(PKG_LIB_FILE) $(PKG_STUB_LIB_FILE) BINARIES = $(lib_BINARIES) @@ -126,13 +126,13 @@ INSTALL_SCRIPT = ${INSTALL} PACKAGE_NAME = xotcl -PACKAGE_VERSION = 1.3.7 +PACKAGE_VERSION = 1.5.0 CC = gcc -pipe CFLAGS_DEFAULT = -Os CFLAGS_WARNING = -Wall -Wno-implicit-int CLEANFILES = *.o *.a *.so *~ core gmon.out EXEEXT = -LDFLAGS_DEFAULT = -prebind -Wl,-search_paths_first +LDFLAGS_DEFAULT = -prebind -headerpad_max_install_names -Wl,-search_paths_first MAKE_LIB = ${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_LIBS} MAKE_SHARED_LIB = ${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_LIBS} MAKE_STATIC_LIB = ${STLIB_LD} $@ $(PKG_OBJECTS) @@ -141,21 +141,21 @@ RANLIB = : RANLIB_STUB = ranlib SHLIB_CFLAGS = -fno-common -SHLIB_LD = cc -dynamiclib ${LDFLAGS} +SHLIB_LD = ${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT} -Wl,-single_module SHLIB_LD_FLAGS = @SHLIB_LD_FLAGS@ -SHLIB_LD_LIBS = ${LIBS} -L/usr/local/lib -ltclstub8.4 -L/usr/local/lib -ltkstub8.4 +SHLIB_LD_LIBS = ${LIBS} -L/usr/local/src/tcl8.4.13/unix -ltclstub8.4 STLIB_LD = ${AR} cr -TCL_DEFS = -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DTCL_WIDE_INT_TYPE=long\ long -DWORDS_BIGENDIAN=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DNO_VALUES_H=1 -DNO_DLFCN_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -Dsocklen_t=unsigned -DHAVE_SIGNED_CHAR=1 -DHAVE_PUTENV_THAT_COPIES=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1 -TCL_BIN_DIR = /usr/local/lib -TCL_SRC_DIR = /Volumes/MacOS/Users/jago/tcl8.4.4 +TCL_DEFS = -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_ATFORK=1 -DTCL_THREADS=1 -DHAVE_COREFOUNDATION=1 -DHAVE_LIBKERN_OSATOMIC_H=1 -DHAVE_OSSPINLOCKLOCK=1 -DHAVE_COPYFILE=1 -DMAC_OSX_TCL=1 -DUSE_VFORK=1 -DTCL_DEFAULT_ENCODING=\"utf-8\" -DTCL_LOAD_FROM_MEMORY=1 -DTCL_WIDE_INT_TYPE=long\ long -DWORDS_BIGENDIAN=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_PUTENV_THAT_COPIES=1 -DHAVE_LANGINFO=1 -DHAVE_FTS=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1 +TCL_BIN_DIR = /usr/local/src/tcl8.4.13/unix +TCL_SRC_DIR = /usr/local/src/tcl8.4.13 # This is necessary for packages that use private Tcl headers -#TCL_TOP_DIR_NATIVE = $(TCL_SRC_DIR) +#TCL_TOP_DIR_NATIVE = "/usr/local/src/tcl8.4.13" # Not used, but retained for reference of what libs Tcl required TCL_LIBS = ${DL_LIBS} ${LIBS} ${MATH_LIBS} -pkgdatadir = /usr/local/share/xotcl1.3.7 -pkglibdir = /usr/local/lib/xotcl1.3.7 -pkgincludedir = /usr/local/include/xotcl1.3.7 +pkgdatadir = /usr/local/share/xotcl1.5.0 +pkglibdir = /usr/local/lib/xotcl1.5.0 +pkgincludedir = /usr/local/include/xotcl1.5.0 #======================================================================== # TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our @@ -169,20 +169,20 @@ DYLD_LIBRARY_PATH="$(EXTRA_PATH):$(DYLD_LIBRARY_PATH)" \ PATH="$(EXTRA_PATH):$(PATH)" \ TCLLIBPATH="$(top_builddir) ${srcdir}" -TCLSH_PROG = /usr/bin/tclsh8.4.4 +TCLSH_PROG = /usr/local/src/tcl8.4.13/unix/tclsh TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) SHARED_BUILD = 1 -INCLUDES = -I$(TCL_SRC_DIR)/generic -I$(TCL_SRC_DIR)/unix -I./generic -EXTRA_CFLAGS = -DXOTCLVERSION=\"1.3\" -DXOTCLPATCHLEVEL=\".7\" +INCLUDES = -I"/usr/local/src/tcl8.4.13/generic" -I"/usr/local/src/tcl8.4.13/unix" -I./generic +EXTRA_CFLAGS = -DXOTCLVERSION=\"1.5\" -DXOTCLPATCHLEVEL=\".0\" -DHAVE_TCL_COMPILE_H=1 # TCL_DEFS is not strictly need here, but if you remove it, then you # must make sure that configure.in checks for the necessary components # that your library may use. TCL_DEFS can actually be a problem if # you do not compile with a similar machine setup as the Tcl core was # compiled with. -#DEFS = $(TCL_DEFS) -DPACKAGE_NAME=\"xotcl\" -DPACKAGE_TARNAME=\"xotcl\" -DPACKAGE_VERSION=\"1.3.7\" -DPACKAGE_STRING=\"xotcl\ 1.3.7\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DWORDS_BIGENDIAN=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_READDIR_R=1 -DTCL_THREADS=1 -DTCL_WIDE_INT_TYPE=long\ long -DUSE_TCL_STUBS=1 -DCOMPILE_XOTCL_STUBS=1 $(EXTRA_CFLAGS) -DEFS = -DPACKAGE_NAME=\"xotcl\" -DPACKAGE_TARNAME=\"xotcl\" -DPACKAGE_VERSION=\"1.3.7\" -DPACKAGE_STRING=\"xotcl\ 1.3.7\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DWORDS_BIGENDIAN=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_READDIR_R=1 -DTCL_THREADS=1 -DTCL_WIDE_INT_TYPE=long\ long -DUSE_TCL_STUBS=1 -DCOMPILE_XOTCL_STUBS=1 $(EXTRA_CFLAGS) +#DEFS = $(TCL_DEFS) -DPACKAGE_NAME=\"xotcl\" -DPACKAGE_TARNAME=\"xotcl\" -DPACKAGE_VERSION=\"1.5.0\" -DPACKAGE_STRING=\"xotcl\ 1.5.0\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DWORDS_BIGENDIAN=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DTCL_WIDE_INT_TYPE=long\ long -DUSE_TCL_STUBS=1 -DCOMPILE_XOTCL_STUBS=1 $(EXTRA_CFLAGS) +DEFS = -DPACKAGE_NAME=\"xotcl\" -DPACKAGE_TARNAME=\"xotcl\" -DPACKAGE_VERSION=\"1.5.0\" -DPACKAGE_STRING=\"xotcl\ 1.5.0\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DWORDS_BIGENDIAN=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DTCL_WIDE_INT_TYPE=long\ long -DUSE_TCL_STUBS=1 -DCOMPILE_XOTCL_STUBS=1 $(EXTRA_CFLAGS) CONFIG_CLEAN_FILES = Makefile xotclConfig.sh apps/utils/xotclsh apps/utils/xowish unix/xotcl.spec unix/pkgIndex.unix autom4te.cache/ @@ -213,7 +213,7 @@ # of the Makefile, in the "BINARIES" variable. #======================================================================== -binaries: $(BINARIES) xotclsh xowish pkgIndex.tcl +binaries: $(BINARIES) xotclsh pkgIndex.tcl @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ for dir in $$dirs ; do \ if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ @@ -325,7 +325,7 @@ gdb: $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) -test: binaries libraries test-core test-actiweb +test: binaries libraries test-core #TESTFLAGS = -srcdir $(srcdir) test-core: $(TCLSH_PROG) @@ -337,6 +337,8 @@ -libdir $(PLATFORM_DIR) $(TESTFLAGS) $(TCLSH) $(src_test_dir_native)/forwardtest.xotcl \ -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_test_dir_native)/slottest.xotcl \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) $(TCLSH) $(src_test_dir_native)/xocomm.test \ -libdir $(PLATFORM_DIR) $(TESTFLAGS) test-actiweb: $(TCLSH_PROG) @@ -487,7 +489,7 @@ #======================================================================== clean: - -rm -rf $(BINARIES) $(CLEANFILES) xotclsh xowish pkgIndex.tcl ./receiver \ + -rm -rf $(BINARIES) $(CLEANFILES) xotclsh pkgIndex.tcl ./receiver \ $(target_doc_dir)/*-xotcl.html find ${srcdir} -type f -name \*~ -exec rm \{} \; @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ @@ -618,7 +620,7 @@ @echo " setenv TCLLIBPATH \"$(TCLLIBPATH)\"" @echo " and" @if test "x$(XOTCLSH)" = "x" ; then \ - echo " /usr/bin/tclsh8.4.4" ; \ + echo " /usr/local/src/tcl8.4.13/unix/tclsh" ; \ echo " package require XOTcl; namespace import -force xotcl::*" ; \ echo " or" ; \ echo " put the 'package require' line into your ~/.tclshrc" ; \ @@ -648,7 +650,7 @@ -type f -o -type l | fgrep -v CVS | fgrep -v SCCS | fgrep -v .junk| fgrep -v .db | fgrep -v "~" | fgrep -v "#" | fgrep -v /receiver/` \ ) -tar: +tar: libraries-pkgindex sh ./config/mktar.sh Index: xotcl/Makefile.in =================================================================== diff -u -r78e82b3563a644f2df47320eacc693f1b788b03c -rbb3c756fb47517596b9dbcb4e580aa1212827b41 --- xotcl/Makefile.in (.../Makefile.in) (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/Makefile.in (.../Makefile.in) (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) @@ -12,7 +12,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: Makefile.in,v 1.17 2006/02/18 22:17:32 neumann Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.18 2006/09/14 06:36:01 neumann Exp $ #======================================================================== # Add additional lines to handle any additional AC_SUBST cases that @@ -337,6 +337,8 @@ -libdir $(PLATFORM_DIR) $(TESTFLAGS) $(TCLSH) $(src_test_dir_native)/forwardtest.xotcl \ -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_test_dir_native)/slottest.xotcl \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) $(TCLSH) $(src_test_dir_native)/xocomm.test \ -libdir $(PLATFORM_DIR) $(TESTFLAGS) test-actiweb: $(TCLSH_PROG) Index: xotcl/apps/actiweb/AgentClient.xotcl =================================================================== diff -u -r78e82b3563a644f2df47320eacc693f1b788b03c -rbb3c756fb47517596b9dbcb4e580aa1212827b41 --- xotcl/apps/actiweb/AgentClient.xotcl (.../AgentClient.xotcl) (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/apps/actiweb/AgentClient.xotcl (.../AgentClient.xotcl) (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) @@ -1,5 +1,5 @@ #!/usr/bin/env tclsh -# $Id: AgentClient.xotcl,v 1.2 2006/02/18 22:17:32 neumann Exp $ +# $Id: AgentClient.xotcl,v 1.3 2006/09/14 06:36:02 neumann Exp $ #if {![info exists ACTIWEB_HOME]} {source ~/actiweb/paths.xotcl} package require XOTcl; namespace import -force xotcl::* package require xotcl::package @@ -18,7 +18,7 @@ # Object resultPrinter resultPrinter proc printResult {o m code result} { - if {$code == "OK"} { + if {$code eq "OK"} { puts stderr "[self] -- Result -- $m:\n$result" } else { puts stderr "[self] -- Error -- $m: \n$result" Index: xotcl/apps/actiweb/Counter.xotcl =================================================================== diff -u -rf7894d9be99a8da3a04218abcdb9bd46b6d625c8 -rbb3c756fb47517596b9dbcb4e580aa1212827b41 --- xotcl/apps/actiweb/Counter.xotcl (.../Counter.xotcl) (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/actiweb/Counter.xotcl (.../Counter.xotcl) (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) @@ -1,5 +1,6 @@ #!../../src/xotclsh -# $Id: Counter.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +# $Id: Counter.xotcl,v 1.2 2006/09/14 06:36:02 neumann Exp $ +#load /Users/neumann/src/xotcl-1.4.1/library/store/XOTclSdbm/libxotclsdbm1.2.dylib array set opts {-pkgdir .}; array set opts $argv lappend auto_path $opts(-pkgdir) Index: xotcl/apps/actiweb/univ/UNIVERSAL.xotcl =================================================================== diff -u -r78e82b3563a644f2df47320eacc693f1b788b03c -rbb3c756fb47517596b9dbcb4e580aa1212827b41 --- xotcl/apps/actiweb/univ/UNIVERSAL.xotcl (.../UNIVERSAL.xotcl) (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/apps/actiweb/univ/UNIVERSAL.xotcl (.../UNIVERSAL.xotcl) (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) @@ -1,5 +1,5 @@ #!/usr/bin/env tclsh -#$Id: UNIVERSAL.xotcl,v 1.4 2006/02/18 22:17:32 neumann Exp $ +#$Id: UNIVERSAL.xotcl,v 1.5 2006/09/14 06:36:02 neumann Exp $ package require XOTcl; namespace import -force xotcl::* array set opts { -ssl 0 -instanceFile UNIVERSAL.rdf -cssFile UNIVERSAL.css -root . -pkgdir .} @@ -70,7 +70,7 @@ } RDFdb instproc add {predicate subject object} { set s [self]::$subject - if {[my info children $s] == ""} { + if {[my info children $s] eq ""} { #puts stderr "create new resource $s" Resource create $s } @@ -92,7 +92,7 @@ RDFdb instproc querySubject {subject} { set s [self]::$subject set result "" - if {[my info children $s] != ""} { + if {[my info children $s] ne ""} { foreach att [lsort [$s info vars]] { lappend result $att [$s set $att] } @@ -152,7 +152,7 @@ set tech http://nm.wu-wien.ac.at/universal/rdf-technical set format [my substitute "$tech#Format"] set location [my substitute "$tech#Location"] - if {$format == "text/html"} { + if {$format eq "text/html"} { set label "go" } else { set label "Download [my substitute $tech#Size] bytes" } @@ -191,7 +191,7 @@ } regexp {^(.*)\#(.*)$} $attr _ ns property if {$ns != $lastns} { - if {$lastns != ""} { append result

\n } + if {$lastns ne ""} { append result

\n } append result "Attributes from namespace $ns:\n\n" set lastns $ns } Index: xotcl/apps/comm/get-regression-nb.xotcl =================================================================== diff -u -r78e82b3563a644f2df47320eacc693f1b788b03c -rbb3c756fb47517596b9dbcb4e580aa1212827b41 --- xotcl/apps/comm/get-regression-nb.xotcl (.../get-regression-nb.xotcl) (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/apps/comm/get-regression-nb.xotcl (.../get-regression-nb.xotcl) (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) @@ -144,7 +144,7 @@ proc clients {clients} { append cmd "[pwd]/$::argv0 -host $::host " \ "-parallel $::parallel -sequential $::sequential" - if {$::port != ""} {append cmd " -port $::port"} + if {$::port ne ""} {append cmd " -port $::port"} set starttime [clock clicks] set ::running $clients for {set s 0} {$s < $clients} {incr s} { @@ -181,7 +181,7 @@ proc assert {f r} { set got [eval $f] - if {[string compare $got $r]} { + if {$got ne $r } { puts stderr "assertion failed: \[$f\] == $r (got $got)" quit } else { @@ -256,7 +256,7 @@ incr ::total [psink set totalbytes] psink destroy } -if {$port != ""} {set port :$port} +if {$port ne ""} {set port :$port} if {$parallel} { Index: xotcl/apps/comm/get-regression.xotcl =================================================================== diff -u -r78e82b3563a644f2df47320eacc693f1b788b03c -rbb3c756fb47517596b9dbcb4e580aa1212827b41 --- xotcl/apps/comm/get-regression.xotcl (.../get-regression.xotcl) (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/apps/comm/get-regression.xotcl (.../get-regression.xotcl) (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) @@ -8,7 +8,7 @@ proc assert {f r} { set got [eval $f] - if {[string compare $got $r]} { + if {$got ne $r } { puts stderr "assertion failed: \[$f\] == $r (got $got)" quit } else { Index: xotcl/apps/comm/link-checker.xotcl =================================================================== diff -u -r78e82b3563a644f2df47320eacc693f1b788b03c -rbb3c756fb47517596b9dbcb4e580aa1212827b41 --- xotcl/apps/comm/link-checker.xotcl (.../link-checker.xotcl) (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/apps/comm/link-checker.xotcl (.../link-checker.xotcl) (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) @@ -1,5 +1,5 @@ #!/usr/bin/env tclsh -# $Id: link-checker.xotcl,v 1.2 2006/02/18 22:17:32 neumann Exp $ +# $Id: link-checker.xotcl,v 1.3 2006/09/14 06:36:02 neumann Exp $ # -gn july 2000 package require XOTcl; namespace import -force xotcl::* @@ -78,7 +78,7 @@ if {![my isLocal $url]} { if {$foreign} { #puts stderr "parenturl: [$request set parentUrl] -> [my isLocal [$request set parentUrl]]" - if {[$request info vars parentUrl] != "" && + if {[$request info vars parentUrl] ne "" && ![my isLocal [$request set parentUrl]]} { return [my report "ignored, nor local: $url"] } else { Index: xotcl/apps/comm/test-tls-server.xotcl =================================================================== diff -u -r78e82b3563a644f2df47320eacc693f1b788b03c -rbb3c756fb47517596b9dbcb4e580aa1212827b41 --- xotcl/apps/comm/test-tls-server.xotcl (.../test-tls-server.xotcl) (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/apps/comm/test-tls-server.xotcl (.../test-tls-server.xotcl) (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) @@ -1,5 +1,5 @@ #!../../src/xotclsh -# $Id: test-tls-server.xotcl,v 1.2 2006/02/18 22:17:32 neumann Exp $ +# $Id: test-tls-server.xotcl,v 1.3 2006/09/14 06:36:02 neumann Exp $ # # sample secure server that reflect all incoming data to the client # It uses tls1.3 package of Matt Newman @@ -28,7 +28,7 @@ return 0 } puts stderr n=<$n> - if {$verbose && $data != ""} { + if {$verbose && $data ne ""} { puts stderr "data=<$data>" } if {[eof $chan]} { ;# client gone or finished Index: xotcl/apps/comm/webserver.xotcl =================================================================== diff -u -rad8a63234e44a8788efede276e811051ab891fbe -rbb3c756fb47517596b9dbcb4e580aa1212827b41 --- xotcl/apps/comm/webserver.xotcl (.../webserver.xotcl) (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/apps/comm/webserver.xotcl (.../webserver.xotcl) (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) @@ -1,9 +1,9 @@ #!../../src/xotclsh -# $Id: webserver.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ +# $Id: webserver.xotcl,v 1.4 2006/09/14 06:36:02 neumann Exp $ array set opts {-root ../../doc -port 8086 -protected-port 9096 -pkgdir .} array set opts $argv lappend auto_path $opts(-pkgdir) -#if {$::tcl_platform(platform) == "windows"} {lappend auto_path .} +#if {$::tcl_platform(platform) eq "windows"} {lappend auto_path .} package require XOTcl; namespace import -force xotcl::* proc ! string { @@ -57,7 +57,7 @@ request specific infomation. }} SpecializedWorker instproc respond {} { - if {[my set resourceName] == "exit"} { + if {[my set resourceName] eq "exit"} { set ::forever 1 #my showVars #my set version 1.0;### ???? @@ -100,7 +100,7 @@ } else { set USER unknown } -if {$::tcl_platform(platform) == "windows"} { +if {$::tcl_platform(platform) eq "windows"} { set USER unknown } Index: xotcl/apps/scripts/soccerClub.xotcl =================================================================== diff -u -rf7894d9be99a8da3a04218abcdb9bd46b6d625c8 -rbb3c756fb47517596b9dbcb4e580aa1212827b41 --- xotcl/apps/scripts/soccerClub.xotcl (.../soccerClub.xotcl) (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/scripts/soccerClub.xotcl (.../soccerClub.xotcl) (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) @@ -1,4 +1,4 @@ -# $Id: soccerClub.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +# $Id: soccerClub.xotcl,v 1.2 2006/09/14 06:36:02 neumann Exp $ # This is a simple introductory example for the language XOTcl. # It demonstrates the basic language constructs on the example of # a soccer club. @@ -91,7 +91,7 @@ # Now let us build to example soccer team objects. SoccerTeam lyon -name "Olympique Lyon" -location "Lyon" -SoccerTeam bayernMunich -name "F.C. Bayern M�nchen" -location "Munich" +SoccerTeam bayernMunich -name "F.C. Bayern München" -location "Munich" # With 'addPlayer' we can create new aggregated player objects # @@ -105,9 +105,9 @@ # gives an invariant covering all instances of a class). In XOTcl # the rules are syntactically identical to 'if' statements Player instinvar { - {[my set playerRole] == "NONE" || - [my set playerRole] == "PLAYER" || - [my set playerRole] == "GOALY"} + {[my set playerRole] eq "NONE" || + [my set playerRole] eq "PLAYER" || + [my set playerRole] eq "GOALY"} } # If we break the invariant and turn assertions checking on, we should Index: xotcl/apps/utils/xotclsh =================================================================== diff -u -rad8a63234e44a8788efede276e811051ab891fbe -rbb3c756fb47517596b9dbcb4e580aa1212827b41 --- xotcl/apps/utils/xotclsh (.../xotclsh) (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/apps/utils/xotclsh (.../xotclsh) (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) @@ -1,7 +1,7 @@ -#!/usr/bin/tclsh8.4.4 +#!/usr/local/src/tcl8.4.13/unix/tclsh if {$argc == 0} { puts "Don't use [info script] as interactive shell! Use instead:" - puts " /usr/bin/tclsh8.4.4" + puts " /usr/local/src/tcl8.4.13/unix/tclsh" puts " package require XOTcl; namespace import ::xotcl::*" } else { package require XOTcl Index: xotcl/apps/utils/xowish =================================================================== diff -u -rad8a63234e44a8788efede276e811051ab891fbe -rbb3c756fb47517596b9dbcb4e580aa1212827b41 --- xotcl/apps/utils/xowish (.../xowish) (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/apps/utils/xowish (.../xowish) (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) @@ -1,5 +1,5 @@ #!@WISH_PROG@ -###!/usr/bin/tclsh8.4.4 +###!/usr/local/src/tcl8.4.13/unix/tclsh ###package require Tk if {$argc == 0} { puts "Don't use [info script] as interactive shell! Use instead:" Index: xotcl/configure =================================================================== diff -u -r78e82b3563a644f2df47320eacc693f1b788b03c -rbb3c756fb47517596b9dbcb4e580aa1212827b41 --- xotcl/configure (.../configure) (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/configure (.../configure) (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for xotcl 1.4.0. +# Generated by GNU Autoconf 2.59 for xotcl 1.5.0. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation @@ -267,8 +267,8 @@ # Identity of this package. PACKAGE_NAME='xotcl' PACKAGE_TARNAME='xotcl' -PACKAGE_VERSION='1.4.0' -PACKAGE_STRING='xotcl 1.4.0' +PACKAGE_VERSION='1.5.0' +PACKAGE_STRING='xotcl 1.5.0' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. @@ -777,7 +777,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xotcl 1.4.0 to adapt to many kinds of systems. +\`configure' configures xotcl 1.5.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -834,7 +834,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xotcl 1.4.0:";; + short | recursive ) echo "Configuration of xotcl 1.5.0:";; esac cat <<\_ACEOF @@ -979,7 +979,7 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -xotcl configure 1.4.0 +xotcl configure 1.5.0 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. @@ -993,7 +993,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xotcl $as_me 1.4.0, which was +It was created by xotcl $as_me 1.5.0, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -1571,7 +1571,7 @@ # do not modify the following lines manually, they are generated with changeXOTclVersion XOTCL_MAJOR_VERSION=1 -XOTCL_MINOR_VERSION=4 +XOTCL_MINOR_VERSION=5 XOTCL_RELEASE_LEVEL=.0 XOTCL_VERSION=${XOTCL_MAJOR_VERSION}.${XOTCL_MINOR_VERSION} @@ -10552,7 +10552,7 @@ } >&5 cat >&5 <<_CSEOF -This file was extended by xotcl $as_me 1.4.0, which was +This file was extended by xotcl $as_me 1.5.0, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -10607,7 +10607,7 @@ cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -xotcl config.status 1.4.0 +xotcl config.status 1.5.0 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" @@ -11213,3 +11213,7 @@ + + + + Index: xotcl/configure.in =================================================================== diff -u -r78e82b3563a644f2df47320eacc693f1b788b03c -rbb3c756fb47517596b9dbcb4e580aa1212827b41 --- xotcl/configure.in (.../configure.in) (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/configure.in (.../configure.in) (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) @@ -11,7 +11,7 @@ # for this package, and can be a relative path, such as: # #-------------------------------------------------------------------- -define(XOTclVersion, 1.4.0) +define(XOTclVersion, 1.5.0) AC_INIT([xotcl], [XOTclVersion]) #-------------------------------------------------------------------- @@ -103,7 +103,7 @@ # do not modify the following lines manually, they are generated with changeXOTclVersion XOTCL_MAJOR_VERSION=1 -XOTCL_MINOR_VERSION=4 +XOTCL_MINOR_VERSION=5 XOTCL_RELEASE_LEVEL=.0 XOTCL_VERSION=${XOTCL_MAJOR_VERSION}.${XOTCL_MINOR_VERSION} @@ -464,3 +464,7 @@ + + + + Index: xotcl/doc/index.html =================================================================== diff -u -rad8a63234e44a8788efede276e811051ab891fbe -rbb3c756fb47517596b9dbcb4e580aa1212827b41 --- xotcl/doc/index.html (.../index.html) (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/doc/index.html (.../index.html) (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) @@ -22,7 +22,7 @@

Index: xotcl/doc/langRef-xotcl.pdf =================================================================== diff -u -r78e82b3563a644f2df47320eacc693f1b788b03c -rbb3c756fb47517596b9dbcb4e580aa1212827b41 Binary files differ Index: xotcl/doc/langRef.xotcl =================================================================== diff -u -r78e82b3563a644f2df47320eacc693f1b788b03c -rbb3c756fb47517596b9dbcb4e580aa1212827b41 --- xotcl/doc/langRef.xotcl (.../langRef.xotcl) (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/doc/langRef.xotcl (.../langRef.xotcl) (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) @@ -1,15 +1,16 @@ -# $Id: langRef.xotcl,v 1.10 2006/02/18 22:17:33 neumann Exp $ -package provide XOTcl-langRef 1.4.0 +# $Id: langRef.xotcl,v 1.11 2006/09/14 06:36:02 neumann Exp $ +package provide XOTcl-langRef 1.5.0 package require XOTcl @ @File { description { XOTcl language reference. Describes predefined objects and classes. } "predefined primitives" { - XOTcl contains three predefined primitives: - <@p> - <@tt>self<@/tt> computes callstack related information. + XOTcl contains the following predefined primitives (Tcl commands): +

+
<@tt>self<@/tt>
+
computes callstack related information. It can be used in the following ways: <@UL> <@LI><@TT>self - returns the name @@ -50,38 +51,63 @@ <@li><@TT>self activelevel: Returns the level, from where the actual proc was invoked from. This might be the calling level or a next - call, whatsever is higher in the stack. The level is returned in a form + call, whatever is higher in the stack. The level is returned in a form it can be used as first argument in <@TT>uplevel or <@TT>upvar. <@/UL> - <@/p><@p> - <@tt>my someMethod<@/tt> is a short form for <@tt>[self] someMethod and can only be + <@/p> +
+ +
<@tt>my methodName<@/tt>
+
is a short form for <@tt>[self] methodName and can only be called in a context of an instproc or an method specific proc. It allows certain optimizations and shorter to write. <@/p><@p> - <@tt>next <@/tt> invokes the next shadowed (same-named) method on the + <@tt>next <@/tt>
invokes the next shadowed (same-named) method on the precedence path and returns its result. If <@tt>next is called without arguments, the arguments of the current method are passed through the called method. If <@tt>next is invoked with the flag <@tt>--noArgs, the shadowed method is called without arguments. If other arguments are specified for next, these will be used for the call. - <@/p> - <@/p><@p> - <@tt>::xotcl::configure filter ?on|off?<@/tt> allows to + <@/dd> +
<@tt>myvar varName
+
returns the fully qualified variable name of the specified + variable.

+

+ +
<@tt>myproc methodName ?args?
+
calls the specified XOTcl method without the need + of using "<@tt>[list [self] methodName ...]".

+

+ +
<@tt>::xotcl::alias class|obj ?-objscope? ?-per-object? cmdName
+
can be used to register predefined C-implemented Tcl commands as + methods. The option <@tt>-objscope has the same meaning as for forwarder + (instance variables of the calling object appear in the local scope of + the Tcl command), <@tt>-per-object has the same meaning as for + the method <@tt>method (when used on a class, the method is registered for the + class object only, but not for the instances). This command + can be used to bootstrap xotcl (when e.g. no methods are available).

+

+ +
::xotcl::configure filter ?on|off?<@/tt>
+
allows to turn 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 function is needed for the serializer that is intended - to serialize the objects classes independent of filter settings. - <@/p> - <@p> - <@tt>::xotcl::configure softrecreate ?on|off?<@/tt> allows to control + to serialize the objects classes independent of filter settings.

+

+ + +
<@tt>::xotcl::configure softrecreate ?on|off?<@/tt>
+
allows to control what should happen, when an object / a class is recreated. Per default it is set off, which means that the object/class is destroyed and all relations (e.g. subclass/superclass) to other objects/classes are destroyed as well. If <@tt>softrecreate is - set, the object is resetted, but not destroyed, the relations + set, the object is reseted, but not destroyed, the relations are kept. This is important, when e.g. reloading a file with class definitions (e.g. when used in OpenACS with file watching and reloading). With <@tt>softrecreate set, @@ -90,12 +116,14 @@ Example: e.g. there is a class hierarchy A <- B <- C Without <@tt>softrecreate set, a reload of B means first a destroy of B, leading to A <- C, and instances - of B are reclassed to ::xotcl::Object. When <@tt>softrecreate is - set, the structure remeans unchanged. - <@/p> + of B are re-classed to ::xotcl::Object. When <@tt>softrecreate is + set, the structure remains unchanged. +
+
+ } - date { $Date: 2006/02/18 22:17:33 $ } + date { $Date: 2006/09/14 06:36:02 $ } } ## @@ -110,7 +138,7 @@ @ Object instproc abstract { methtype "instproc or proc" - methname "name of abstract method" + methodName "name of abstract method" arglist "arguments" } { Description { @@ -186,12 +214,14 @@ } @ Object instproc class { - newClass "new class name" + newClass "?new class?" } { - Description { - Changes the class of an object dynamically to <@tt>newClass. - } - return "empty string" + Description { + Changes the class of an object dynamically to <@tt>newClass. + The method returns the current value of class, + when it is called without arguments. + } + return "if <@tt>newClass is not specified return class, otherwise empty" } @ Object instproc cleanup { @@ -208,21 +238,71 @@ ?args? "'-' method calls" } { Description { - Calls the '-' methods. I.e. evaluates arguments and calls + Calls the '-' (dash) methods. I.e. evaluates arguments and calls everything starting with '-' (and not having a digit a second char) as a method. Every list element until the next '-' - is interpreted as a method argument. configure is called + is interpreted as a method argument. configure/tt> is called before the constructor during initialization and recreation. - E.g. + In the following example, the variable set is called via + configure before init: <@pre class='code'> Object o -set x 4 - here: + The method configure can be called with the + dash-notation at arbitrary times: <@pre class='code'> o configure -set x 4 - is executed. + } + return "number of the skipped first arguments" +} +@ Object instproc contains { + "?-withnew?" "Option to overload new to create new objects within + the specified object. Per default, this option is turned on." + "?-object?" "object, in which the new objects should be created. + The default is the object, for which contains>/tt> was called." + "?-class?" "In combination with option -object: If the specified + object does not exist, create it from the specified class. The default + is ::xotcl::Object" + cmd "Tcl command to create multiple objects" +} { + Description { + This method can be used to create nested object structures + with little syntactic overhead. The method changes the namespace + to the specified object and creates objects there. + Optionally, a different object scope can be specified and + creating new objects in the specified scope can be turned off. + The following command creates a three rectangles, containing some + points. +
+  Class Point -parameter {{x 100} {y 300}}
+  Class Rectangle -parameter {color}
+
+  Rectangle r0 -color pink -contains {
+    Rectangle r1 -color red -contains {
+      Point x1 -x 1 -y 2
+      Point x2 -x 1 -y 2
+    }
+    Rectangle r2 -color green -contains {
+      Point x1
+      Point x2
+    }
   }
+
+ The resulting object structure looks like in the folloing + example (simplified). +
+   ::r0
+   ::r0::r1
+   ::r0::r1::x1
+   ::r0::r1::x2
+   ::r0::r2
+   ::r0::r2::x1
+   ::r0::r2::x2
+
+ } return "number of the skipped first arguments" } + + @ Object instproc copy { newName "destination of copy operation" } { @@ -261,7 +341,7 @@ @ Object instproc extractConfigureArg { al "Argument List Name" - name "Name of the Configure Argument to be extracted (should start with '-')" + name "Name of the configure argument to be extracted (should start with '-')" ?cutTheArg? "if cutTheArg not 0, it cut from upvar argsList, default is 0" } { Description { @@ -283,22 +363,23 @@ } @ Object instproc filter { - args "filter specification" + ?args? "filter specification" } { Description { If <@tt>$args is one argument, it specifies a list of filters to be set. Every filter must be an XOTcl proc/instproc within the object scope. If <@tt>$args it has more argument, the first one specifies the - action. Possible values are <@tt>set, <@tt>get, + action. Possible values are <@tt>assign, <@tt>get, <@tt>add or <@tt>delete, it modifies the current - settings as indicated. For more details, check the tutorial. + settings as indicated. For more details, check the + tutorial. } return "if <@tt>$args return empty current filters, otherwise empty" } @ Object instproc filterguard { - filtername "filter name of a registered filter" + filterName "filter name of a registered filter" guard "set of conditions to execute the filter" } { description { @@ -316,30 +397,37 @@ Search a full qualified method name that is currently registered as a filter. Return a list of the proc qualifier format: - 'objName|classname proc|instproc methodName'. + 'objName|className proc|instproc methodName'. } return "full qualified name, if filter is found, otherwise an empty string" } @ Object instproc forward { - name "name of forwarder method" - ?options? "-objscope, -methodprefix string, -default names" + methodName "name of forwarder method" + ?options? "-objscope, -methodprefix string, -default names, -earlybinding, -verbose" ?callee? "named of the called command or object" ?args? "arguments" } { Description { - Register a method (similar to a proc) for forwarding calls to - a callee (target tcl command, - other object). If the forwarder method is called, the actual arguments + Register an object specific method (similar to a proc) for forwarding calls to + a callee (target Tcl command, other object). + When the forwarder method is called, the actual arguments of the invocation are appended to the specified arguments. In callee an - arguments certain substituions can take place: -
  • %proc: subsituted by name of the forwarder method
  • -
  • %self: subsituted by name of the object
  • -
  • %1: subsituted by first argument of the invocation
  • + arguments certain substitutions can take place: +
    • %proc: substituted by name of the forwarder method
    • +
    • %self: substitute by name of the object
    • +
    • %1: substitute by first argument of the invocation
    • +
    • {%@POS value}: substitute the specified value in the argument list + on position POS, where POS can be a positive or negative integer + or end. Positive integers specify the position from the begin + of the list, while negative integer specify the position from the end. +
    • {%argclindex LIST}: take the nth argument of the specified list as + substitution value, where n is the number of arguments from the + invocation.
    • %%: a single percent.
    • -
    • %tcl-command: command to be executed; substituted by result.
    • +
    • %Tcl-command: command to be executed; substituted by result.
    Additionally each argument can be prefixed by the positional prefix %@POS (note the delimiting space at the end) that can be used to specify an @@ -352,8 +440,17 @@ in front of the second argument of the invocation,
  • -default is used for default method names (only in connection with %1)
  • +
  • -earlybinding: look up the function + pointer of the called Tcl command at + definition time of the forwarder instead of invocation time. + This option should only be used + for calling C-implemented Tcl commands, no procs etc.);
  • +
  • -verbose
  • : print the substituted command to stderr + before executing
- See tutorial for detailed examples. + See + tutorial + for detailed examples. } return "empty" } @@ -399,8 +496,8 @@ Returns the body of the specified proc (object specific method). <@li><@TT>objName info class ?classname?: - Returns the name of the class of the current object, if classname was - not specified, otherwise it returns 1 if classname matches the + Returns the name of the class of the current object, if className was + not specified, otherwise it returns 1 if className matches the object's class and 0 if not. <@li><@TT>objName info children ?pattern?: Returns the @@ -438,9 +535,6 @@ <@li><@TT>objName info invar: Returns object invariants. - <@li><@TT>objName info metadata ?pattern?: - Returns available metadata options. - <@li><@TT>objName info methods: Returns the list of all methods currently reachable for objName. Includes procs, instprocs, cmds, instcommands on object, class hierarchy and mixins. @@ -486,8 +580,8 @@ } @ Object instproc instvar { - v1 "instvar variable" - "?v2...vn?" "optional other instvar variables" + v1 "name of instance variable" + "?v2...vn?" "optional other names for instance variables" } { Description { Binds an variable of the object to the current method's scope. @@ -582,16 +676,19 @@ return "empty string" } + + @ Object instproc mixin { - args "mixin specification" + ?args? "mixin specification" } { Description { If <@tt>$args is one argument, it specifies a list of mixins to be set. Every mixin must be a defined class. If <@tt>$args has more argument, the first one specifies the - action. Possible values are <@tt>set, <@tt>get, + action. Possible values are <@tt>assign, <@tt>get, <@tt>add or <@tt>delete, it modifies the current - settings as indicated. For more details, check the tutorial. + settings as indicated. For more details, check the + tutorial. } return "if <@tt>$args empty return current mixins, otherwise empty" } @@ -603,6 +700,8 @@ Perform a deep move of the object/class (with all information, like class, parameter, filter, ...) to "newName". + Note that move is currently implemented as a copy plus + subsequent destroy operation. } return "empty string" } @@ -644,7 +743,7 @@ @ Object instproc proc { name "method name" - ?non-pos-args? "optinal non-positional arguments" + ?non-pos-args? "optional non-positional arguments" args "method arguments" body "method body" "?preAssertion?" "optional assertions that must hold before the proc executes" @@ -666,15 +765,18 @@ } @ Object instproc procsearch { - procname "simple proc name" + procName "simple proc name" } { Description { - Search for a proc or instproc on an object and return the fully + Search which method should be invoked for an object and return the fully qualified name of the method as a list in proc qualifier format: - 'objName|classname proc|instproc methodName'. E.g., + 'objName|className proc|instproc|forward|instforward|parametercmd|instparametercmd|cmd|instcmd methodName'. + The proc qualifier format reports the command used to create the method. The + only exception is instcmd and cmd, which refer to commands implemented in C. + E.g., <@pre class='code'> o procsearch set - returns <@pre>::xotcl::Object instproc set. + returns <@pre>::xotcl::Object instcmd set. } return "fully qualified name of the searched method or empty string if not found" } @@ -695,13 +797,13 @@ e.g. huge numbers of objects are created. <@TT>requireNamespace is often needed when e.g. using Tk widgets when variables are to be referenced via the namespace - (with <@TT>... -variable [self]::varname ...). + (with <@TT>... -variable [self]::varName ...). } return "empty string" } @ Object instproc set { - varname "name of the instance variable" + varName "name of the instance variable" ?value? "optional new value" } { Description { @@ -713,6 +815,18 @@ return "Value of the instance variable" } +@ Object instproc subst { + options "?-nobackslashes? ?-nocommands? ?-novariables?" + string "string to be substituted" +} { + Description { + Perform backslash, command, and variable substitutions + in the scope of the given object + (see documentation of Tcl command with the same name for details). + } + return "substituted string" +} + @ Object instproc trace { varName "name of variable" } { @@ -724,6 +838,7 @@ } @ Object instproc unset { + "?-nocomplain?" "possible error messages are suppressed" v1 "Variable to unset" "?v2...vn?" "Optional more vars to unset" } { @@ -740,21 +855,21 @@ Description { When this method is used without the optional level, it is a short form of the Tcl command - <@pre class='code'> upevel [self callinglevel] command ?args?<@/pre> - When it is called with the level, it is compatible with the original tcl command. + <@pre class='code'> uplevel [self callinglevel] command ?args?<@/pre> + When it is called with the level, it is compatible with the original Tcl command. } return "result of the command" } @ Object instproc upvar { ?level? "Level" - othervar localvar "referenced variable and variale in the local scope" - ?othervar localvar? "optional pairs of referenced and local variable names" + otherVar localVar "referenced variable and variable in the local scope" + ?otherVar localVar? "optional pairs of referenced and local variable names" } { Description { When this method is used without the optional level, it is a short form of the Tcl command - <@pre class='code'> upvar [self callinglevel] othervar localvar ?...?<@/pre>. - When it is called with the level, it is compatible with the original tcl command. + <@pre class='code'> upvar [self callinglevel] otherVar localVar ?...?<@/pre>. + When it is called with the level, it is compatible with the original Tcl command. } return "result of the command" } @@ -969,25 +1084,26 @@ } @ Class instproc instfilter { - args "instfilter specification" + ?args? "instfilter specification" } { Description { If <@tt>$args is one argument, it specifies a list of instfilters to be set. Every filter must be an XOTcl proc/instproc within the object scope. If <@tt>$args it has more argument, the first one specifies the - action. Possible values are <@tt>set, <@tt>get, + action. Possible values are <@tt>assign, <@tt>get, <@tt>add or <@tt>delete, it modifies the current - settings as indicated. For more details, check the tutorial. + settings as indicated. For more details, check the + tutorial. } return "if <@tt>$args return empty current instfilters, otherwise empty" } @ Class instproc instfilterguard { - filtername "filter name of a registered filter" + filterName "filter name of a registered filter" guard "set of conditions to execute the filter" } { description { @@ -1000,23 +1116,31 @@ @ Class instproc instforward { - name "name of forwarder method" - ?options? "-objscope, -methodprefix string, -default names" + methodName "name of forwarder method" + ?options? "-objscope, -methodprefix string, -default names, -earlybinding, -verbose" ?callee? "named of the called command or object" ?args? "arguments" } { Description { - Register a method (similar to an instproc) for forwarding calls to - a callee (target tcl command, - other object). If the forwarder method is called, the actual arguments + Register a method for the instances of a class (similar to an instproc) + for forwarding calls to a callee (target Tcl command, + other object). + When the forwarder method is called, the actual arguments of the invocation are appended to the specified arguments. In callee an - arguments certain substituions can take place: -
  • %proc: subsituted by name of the forwarder method
  • -
  • %self: subsituted by name of the object
  • -
  • %1: subsituted by first argument of the invocation
  • + arguments certain substitutions can take place: +
    • %proc: substituted by name of the forwarder method
    • +
    • %self: substitute by name of the object
    • +
    • %1: substitute by first argument of the invocation
    • +
    • {%@POS value}: substitute the specified value in the argument list + on position POS, where POS can be a positive or negative integer + or end. Positive integers specify the position from the begin + of the list, while negative integer specify the position from the end. +
    • {%argclindex LIST}: take the nth argument of the specified list as + substitution value, where n is the number of arguments from the + invocation.
    • %%: a single percent.
    • -
    • %tcl-command: command to be executed; substituted by result.
    • +
    • %Tcl-command: command to be executed; substituted by result.
    Additionally each argument can be prefixed by the positional prefix %@POS (note the delimiting space at the end) that can be used to specify an @@ -1026,11 +1150,20 @@
    • -objscope causes the target to be evaluated in the scope of the object,
    • -methodprefix string inserts the specified prefix - in front of the second argument of the invocation,
    • -
    • -default is used for default method names (only in - connection with %1). + in front of the second argument of the invocation,
    • +
    • -default is used for default method names (only + in connection with %1)
    • +
    • -earlybinding: look up the function + pointer of the called Tcl command at + definition time of the forwarder instead of invocation time. + This option should only be used + for calling C-implemented Tcl commands, no procs etc.);
    • +
    • -verbose
    • : print the substituted command to stderr + before executing
    - See tutorial for detailed examples. + See tutorial + for detailed examples. + } return "empty" } @@ -1048,15 +1181,16 @@ } @ Class instproc instmixin { - args "instmixin specification" + ?args? "instmixin specification" } { Description { If <@tt>$args is one argument, it specifies a list of instmixins to be set. Every instmixin must be a defined class. If <@tt>$args has more argument, the first one specifies the - action. Possible values are <@tt>set, <@tt>get, + action. Possible values are <@tt>assign, <@tt>get, <@tt>add or <@tt>delete, it modifies the current - settings as indicated. For more details, check the tutorial. + settings as indicated. For more details, check the + tutorial. } return "if <@tt>$args empty return current instmixins, otherwise empty" } @@ -1081,7 +1215,7 @@ @ Class instproc instproc { name "instance method name" - ?non-pos-args?" "optinal non-positional arguments" + ?non-pos-args?" "optional non-positional arguments" args "instance method arguments" body "instance method body" "?preAssertion?" "optional assertions that must hold before the proc executes" @@ -1108,7 +1242,7 @@ description { Convenience method to create an autonamed object. E.g.: <@pre class='code'> - Http new + HTTP new creates ::xotcl::__#0, a subsequent call creates ::xotcl::__#1, ...<@br> If <@tt>-childof obj is specified, the new object is created as a child of the specified object. @@ -1182,13 +1316,15 @@ } @ Class instproc superclass { - classList "list of classes" + classList "?list of classes?" } { description { Specify super-classes for a class. "superclass" changes the list - of superclasses dynamically to <@tt>classList. + of superclasses dynamically to <@tt>classList. + The method returns the current value of superclass, + when it is called without arguments. } - return "empty string" + return "if <@tt>classList is not specified return superclass(es), otherwise empty" } @ Class instproc unknown { @@ -1209,13 +1345,13 @@ return "Standard unknown mechanism returns result of create" } -@ Class instproc volatile { +@ Object instproc volatile { "" "" } { description { This method is used to specify that the object should be deleted automatically, when the current - tcl-proc/object-proc/instproc is left. Example: + Tcl-proc/object-proc/instproc is left. Example: <@pre class='code'> set x [Object new -volatile] } return "empty string" @@ -1240,6 +1376,73 @@ return "empty string" } +@ Class ::xotcl::Slot -superclass Object { + description { + A slot is a meta-object that manages property-changes of + objects. A property is either an attribute or a role of an + relation (e.g. in system slots). + The predefined system slots are class, + superclass, mixin, instmixin, + filter, instfilter. These slots appear + as methods of Object or Class. + +

    The slots provide a common query and setting interface. + Every multivalued slot provides e.g. a method add + to add a value to the list of values, and a method delete + which removes it. See for example the documentation of the slot + mixin.

    + + Parameters:

    +

+ + + + + + +
-name Name of the slot to access from an object the slot
-domain domain (object or class) of a slot on which it can be used
-multivalued boolean value for specifying single or multiple values (lists)
-defaultmethods list of two elements for specifying which methods are called + per default, when no slot method is explicitly specified
-manager the manager object of the slot (per default [self])
-per-object specify whether a slot should be used per class or per object; note that there is a restricted usage if applied per class, since defaults etc, work per initialization
+ +

For more details, consult the + tutorial.

+ } +} +@ Class Attribute -superclass ::xotcl::Slot { + description { + Attribute slots are used to manage the setting and querying + of instance variables. + + Parameters:

+ + + + + + +
-default specify a default value
-type specify the type of a slot
-initcmd specify a Tcl command to be executed when the value of the + associated variable is read the first time; allows lazy initialization
-valuecmd specify a Tcl command to be executed whenever the variable is read
-valuechangedcmd specify a Tcl command to be executed whenever the variable is changed
+ +

Example of a class definition with three attribute slots:

+
+  <@tt>Class Person -slots {
+    Attribute name
+    Attribute salary -default 0
+    Attribute projects -default {} -multivalued true
+  }
+  Person p1 -name "John Doe"
+
+
+   

The slot parameters default, initcmd and + valuecmd have to be used mutually exclusively. + For more details, consult the + tutorial. +

+ } +} + + + + #Class::Parameter instproc values {param args} #proc xotcl_mkindex Index: xotcl/doc/tutorial.html =================================================================== diff -u -r78e82b3563a644f2df47320eacc693f1b788b03c -rbb3c756fb47517596b9dbcb4e580aa1212827b41 --- xotcl/doc/tutorial.html (.../tutorial.html) (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/doc/tutorial.html (.../tutorial.html) (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) @@ -1,10 +1,10 @@ - + XOTcl - Tutorial - +