Index: TODO =================================================================== diff -u -r764ac30a3ca9712d9fc59853b36759e1dd146114 -reb758924a74f48512c98a40a539ab0c4e5a35de9 --- TODO (.../TODO) (revision 764ac30a3ca9712d9fc59853b36759e1dd146114) +++ TODO (.../TODO) (revision eb758924a74f48512c98a40a539ab0c4e5a35de9) @@ -4712,6 +4712,7 @@ - tested with mongodb 2.4.5 - added example scripts rosetta-sudoku.{tcl,html} and tk-ludo.{tcl,html} +- added sample script doc/example-scripts/tk-geo.tcl mongodb: - integrated configuration of mongodb into toplevel configfile @@ -4722,9 +4723,39 @@ - reduced verbosity of nx-mongo.tcl (added verbosty variable) nsf.c +- don't call postcondition, when the command/invariant have returned already an error - fixed a bug where turning on assertions could swallow result-codes +- fix potential crash when preconditions are empty - extended regression test + +serializer +- fix object mehtod serializeExportedMethod: targetName might have been uninitialized + +nsf.c +- reduce variable scope +- remove uncalled static function + +nsf.c +- fixed a bug where turning on assertions could swallow result-codes +- extended regression test +nsf.c: +- added flag -checkalways to nsf::proc and nsf::asm::proc (for the + latter just a placeholder for now). If the flag is used, it will cause argument + testing independently from the "configure checkarguments" setting. + To force argument checking always is useful e.g. for checking + external values (e.g. in a web server) +- nsf: added switch "-checkalways" to nsf::method::create +- nx: added switch "checkalways" to "method" and "object method" +- extended regression test + +xotcl2: +- fixed "... info defaults ..." and "... info instdefaults ..." + emulation in XOTcl 2 +- fixed error message +- extended regression test +- bumped revision of nsf/xotcl/nx to 2.0b6 + ======================================================================== TODO: Index: configure =================================================================== diff -u -r5c3834b15078b31970db26d0c65030ed1f66b18d -reb758924a74f48512c98a40a539ab0c4e5a35de9 --- configure (.../configure) (revision 5c3834b15078b31970db26d0c65030ed1f66b18d) +++ configure (.../configure) (revision eb758924a74f48512c98a40a539ab0c4e5a35de9) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for nsf 2.0b5. +# Generated by GNU Autoconf 2.69 for nsf 2.0b6. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -577,8 +577,8 @@ # Identity of this package. PACKAGE_NAME='nsf' PACKAGE_TARNAME='nsf' -PACKAGE_VERSION='2.0b5' -PACKAGE_STRING='nsf 2.0b5' +PACKAGE_VERSION='2.0b6' +PACKAGE_STRING='nsf 2.0b6' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -701,7 +701,6 @@ NSF_MINOR_VERSION NSF_MAJOR_VERSION NSF_VERSION -test_mongodb subdirs PKG_CFLAGS PKG_LIBS @@ -1323,7 +1322,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 nsf 2.0b5 to adapt to many kinds of systems. +\`configure' configures nsf 2.0b6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1384,7 +1383,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of nsf 2.0b5:";; + short | recursive ) echo "Configuration of nsf 2.0b6:";; esac cat <<\_ACEOF @@ -1499,7 +1498,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -nsf configure 2.0b5 +nsf configure 2.0b6 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1864,7 +1863,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by nsf $as_me 2.0b5, which was +It was created by nsf $as_me 2.0b6, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2438,7 +2437,6 @@ subdirs="" -test_mongodb="" if ! test "$with_mongodb" = no; then test_mongodb=test-mongdb @@ -2452,7 +2450,6 @@ - #-------------------------------------------------------------------- # __CHANGE__ # Set your package name and version numbers here. The NODOT_VERSION is @@ -9531,7 +9528,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by nsf $as_me 2.0b5, which was +This file was extended by nsf $as_me 2.0b6, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -9584,7 +9581,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -nsf config.status 2.0b5 +nsf config.status 2.0b6 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Index: configure.ac =================================================================== diff -u -r8f3d1bd416081d538dcfaddd0e50fc0c65694c24 -reb758924a74f48512c98a40a539ab0c4e5a35de9 --- configure.ac (.../configure.ac) (revision 8f3d1bd416081d538dcfaddd0e50fc0c65694c24) +++ configure.ac (.../configure.ac) (revision eb758924a74f48512c98a40a539ab0c4e5a35de9) @@ -11,7 +11,7 @@ # for this package, and can be a relative path, such as: # #-------------------------------------------------------------------- -define(NsfVersion, 2.0b5) +define(NsfVersion, 2.0b6) AC_INIT([nsf], [NsfVersion]) #-------------------------------------------------------------------- Index: library/nx/nx.tcl =================================================================== diff -u -r7c2e28b93b02c29f19dc1f58642c5a29a894d24e -reb758924a74f48512c98a40a539ab0c4e5a35de9 --- library/nx/nx.tcl (.../nx.tcl) (revision 7c2e28b93b02c29f19dc1f58642c5a29a894d24e) +++ library/nx/nx.tcl (.../nx.tcl) (revision eb758924a74f48512c98a40a539ab0c4e5a35de9) @@ -29,7 +29,7 @@ # SOFTWARE. # package require nsf -package provide nx 2.0b5 +package provide nx 2.0b6 namespace eval ::nx { Index: library/nx/pkgIndex.tcl =================================================================== diff -u -r9e766c226c7ddb35a4aa20ca7a9e8d6678a7c9e2 -reb758924a74f48512c98a40a539ab0c4e5a35de9 --- library/nx/pkgIndex.tcl (.../pkgIndex.tcl) (revision 9e766c226c7ddb35a4aa20ca7a9e8d6678a7c9e2) +++ library/nx/pkgIndex.tcl (.../pkgIndex.tcl) (revision eb758924a74f48512c98a40a539ab0c4e5a35de9) @@ -8,6 +8,6 @@ # script is sourced, the variable $dir must contain the # full path name of this file's directory. -package ifneeded nx 2.0b5 [list source [file join $dir nx.tcl]] +package ifneeded nx 2.0b6 [list source [file join $dir nx.tcl]] package ifneeded nx::class-method 1.0 [list source [file join $dir class-method.tcl]] package ifneeded nx::plain-object-method 1.0 [list source [file join $dir plain-object-method.tcl]] Index: library/xotcl/library/pkgIndex.tcl =================================================================== diff -u -r9e766c226c7ddb35a4aa20ca7a9e8d6678a7c9e2 -reb758924a74f48512c98a40a539ab0c4e5a35de9 --- library/xotcl/library/pkgIndex.tcl (.../pkgIndex.tcl) (revision 9e766c226c7ddb35a4aa20ca7a9e8d6678a7c9e2) +++ library/xotcl/library/pkgIndex.tcl (.../pkgIndex.tcl) (revision eb758924a74f48512c98a40a539ab0c4e5a35de9) @@ -8,4 +8,4 @@ # script is sourced, the variable $dir must contain the # full path name of this file's directory. -package ifneeded XOTcl 2.0b5 [list source [file join $dir xotcl2.tcl]] +package ifneeded XOTcl 2.0b6 [list source [file join $dir xotcl2.tcl]] Index: library/xotcl/library/xotcl2.tcl =================================================================== diff -u -r880487204ff2da18d2d25ebd727b9b4bbda86c8e -reb758924a74f48512c98a40a539ab0c4e5a35de9 --- library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision 880487204ff2da18d2d25ebd727b9b4bbda86c8e) +++ library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision eb758924a74f48512c98a40a539ab0c4e5a35de9) @@ -28,7 +28,7 @@ # SOFTWARE. # -package provide XOTcl 2.0b5 +package provide XOTcl 2.0b6 package require nx ####################################################### @@ -554,21 +554,19 @@ argName [$o ::nsf::methods::${scope}::info::method args $method] \ flag [$o ::nsf::methods::${scope}::info::method parameter $method] { if {$argName eq $arg} { - # upvar 2 $varName default - # use "my" here to avoid surprises with aliases or interceptors - $o upvar $varName default - #puts "--- info_default var '$varName' level=[info level]" + # we are in a proc, so using builtin "upvar" is safe + upvar $varName default if {[llength $flag] == 2} { set default [lindex $flag 1] - #puts stderr "--- get $scope default for $o $method $arg => $default" + #puts "--- get $scope default for $o $method $arg => setting default to '$default'" return 1 } - #puts stderr "--- get $scope default for $o $method $arg fails" + #puts "--- get $scope default for $o $method $arg fails" set default "" return 0 } } - error "procedure \"$method\" doesn't have an argument \"$varName\"" + error "procedure \"$method\" doesn't have an argument \"$arg\"" } proc ::xotcl::info_forward_options {list} { @@ -603,9 +601,15 @@ return [my {*}$cmd] } :proc default {method arg varName} { + # + # We are called from object "objectInfo". The true caller is 2 + # levels up. + # + :upvar 2 $varName defaultVar # pass varName to be able produce the right error message - set r [::xotcl::info_default object [self] $method $arg $varName] - #puts "--- var '$varName' level=[info level]" + set r [::xotcl::info_default object [self] $method $arg defaultVar] + #if {$r == 1 && ![info exists defaultVar]} {error inconsistency} + #puts "--- objectInfo default: var '$varName' level=[info level]" return $r } :proc filter {-order:switch -guards:switch pattern:optional} { @@ -687,8 +691,14 @@ :alias classchildren ::nsf::methods::object::info::children :alias classparent ::nsf::methods::object::info::parent :proc default {method arg varName} { - set r [::xotcl::info_default object [self] $method $arg $varName] - #puts "--- var '$varName' level=[info level]" + # + # We are called from object "classInfo". The true caller is 2 + # levels up. + # + :upvar 2 $varName defaultVar + set r [::xotcl::info_default object [self] $method $arg defaultVar] + #puts "--- classInfo default: var '$varName' level=[info level] result $r exists [info exists defaultVar]" + #if {$r == 1 && ![info exists defaultVar]} {error inconsistency} return $r } :proc heritage {pattern:optional} { @@ -706,7 +716,14 @@ return [my {*}$cmd] } :proc instdefault {method arg varName} { - set r [::xotcl::info_default class [self] $method $arg $varName] + # + # We are called from object "classInfo". The true caller is 2 + # levels up. + # + :upvar 2 $varName defaultVar + set r [::xotcl::info_default class [self] $method $arg defaultVar] + #puts "--- classInfo instdefault: var '$varName' level=[info level]" + #if {$r == 1 && ![info exists defaultVar]} {error inconsistency} return $r } :alias instfilter ::nsf::methods::class::info::filtermethods Index: library/xotcl/tests/slottest.xotcl =================================================================== diff -u -r45e24b34c85bf0fc3e14db5250550100bd07ff31 -reb758924a74f48512c98a40a539ab0c4e5a35de9 --- library/xotcl/tests/slottest.xotcl (.../slottest.xotcl) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) +++ library/xotcl/tests/slottest.xotcl (.../slottest.xotcl) (revision eb758924a74f48512c98a40a539ab0c4e5a35de9) @@ -141,6 +141,27 @@ ? {O2 superclass} "::M" # +# test "... info default ..." and "... info instdefault ..." +# +::nx::test case info-default { + ::xotcl::Class create ::Test + ::Test proc m0 {-id:required {-flag:boolean true} -switch:switch x {y 1}} {return 0} + ::Test instproc m1 {-id:required {-flag:boolean true} -switch:switch x {y 1}} {return 0} + + ? {::Test info default m0 y default0} 1 + ? {info exists default0} 1 + + ? {::Test info default m0 x default1} 0 + + unset -nocomplain default0 default1 + + ? {::Test info instdefault m1 y default0} 1 + ? {info exists default0} 1 + + ? {::Test info instdefault m1 x default1} 0 + } + +# # The main difference between an Attribute and a Role is that it # references some other objects # Index: library/xotcl/tests/testx.xotcl =================================================================== diff -u -r4b9ddd1b06ce34fd352791fcae53ad91a79b43ce -reb758924a74f48512c98a40a539ab0c4e5a35de9 --- library/xotcl/tests/testx.xotcl (.../testx.xotcl) (revision 4b9ddd1b06ce34fd352791fcae53ad91a79b43ce) +++ library/xotcl/tests/testx.xotcl (.../testx.xotcl) (revision eb758924a74f48512c98a40a539ab0c4e5a35de9) @@ -4160,7 +4160,7 @@ "Defaults for instproc" catch {C info instdefault m2 xxx e} msg - errorCheck $msg {procedure "m2" doesn't have an argument "e"} \ + errorCheck $msg {procedure "m2" doesn't have an argument "xxx"} \ "Defaults instproc error" C instproc m3 { Index: win/pkg.vc =================================================================== diff -u -rc7abd01585e06664f9925485f2c1a5d6a2dbdabb -reb758924a74f48512c98a40a539ab0c4e5a35de9 --- win/pkg.vc (.../pkg.vc) (revision c7abd01585e06664f9925485f2c1a5d6a2dbdabb) +++ win/pkg.vc (.../pkg.vc) (revision eb758924a74f48512c98a40a539ab0c4e5a35de9) @@ -3,4 +3,4 @@ PACKAGE_MAJOR = 2 PACKAGE_MINOR = 0 -PACKAGE_VERSION = "2.0b5" +PACKAGE_VERSION = "2.0b6"