Jim Tcl
Check-in [013bf547ba]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Support lambda even if references are disabled

It's convenient to support a non-gc lambda, even if references are disabled.

Signed-off-by: Steve Bennett <steveb@workware.net.au>

Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:013bf547bae38f6368c24ec7e499799c1d80d457
User & Date: steveb@workware.net.au 2017-08-31 23:01:15
Context
2017-08-31
23:01
tests: binary tests require pack on jim

Avoid failing many tests if binary.tcl is available put pack isn't enabled.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 00ead1b118 user: steveb@workware.net.au tags: trunk

23:01
Support lambda even if references are disabled

It's convenient to support a non-gc lambda, even if references are disabled.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 013bf547ba user: steveb@workware.net.au tags: trunk

2017-08-27
00:14
tests/timer.test: Remove timer-6.5

This test is essentially the same as timer-6.4 except with tighter timing requirements. Remove it to prevent spurious failures.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: bc826458e7 user: steveb@workware.net.au tags: trunk

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to stdlib.tcl.

1







2
3
4
5
6
7
8
# Implements script-based standard commands for Jim Tcl








# Creates an anonymous procedure
proc lambda {arglist args} {
	tailcall proc [ref {} function lambda.finalizer] $arglist {*}$args
}

proc lambda.finalizer {name val} {

>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Implements script-based standard commands for Jim Tcl

if {![exists -command ref]} {
	# No support for references, so create a poor-man's reference just good enough for lambda
	proc ref {args} {{count 0}} {
		format %08x [incr count]
	}
}

# Creates an anonymous procedure
proc lambda {arglist args} {
	tailcall proc [ref {} function lambda.finalizer] $arglist {*}$args
}

proc lambda.finalizer {name val} {

Changes to tcltest.tcl.

162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
		return 1
	} else {
		set ::tcltest::testConstraints($constraint) $bool
	}
}

testConstraint {utf8} [expr {[string length "\xc2\xb5"] == 1}]
testConstraint {references} [expr {[info commands ref] ne ""}]
testConstraint {jim} 1
testConstraint {tcl} 0

proc bytestring {x} {
	return $x
}








|







162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
		return 1
	} else {
		set ::tcltest::testConstraints($constraint) $bool
	}
}

testConstraint {utf8} [expr {[string length "\xc2\xb5"] == 1}]
testConstraint {references} [expr {[info commands getref] ne ""}]
testConstraint {jim} 1
testConstraint {tcl} 0

proc bytestring {x} {
	return $x
}

Changes to tests/alias.test.

58
59
60
61
62
63
64

65
66
67
68
69
70
71
72
73
} {3}

test curry-1.4 "Two word curry" {
	set two [curry info exists]
	list [$two x] [$two y]
} {1 0}


collect
test curry-1.5 "Delete curry" {
	unset one two
	collect
} {2}

test local-1.2 "local curry in proc" {
	proc a {} {
		local set p [curry info exists]







>
|
<







58
59
60
61
62
63
64
65
66

67
68
69
70
71
72
73
} {3}

test curry-1.4 "Two word curry" {
	set two [curry info exists]
	list [$two x] [$two y]
} {1 0}

test curry-1.5 "Delete curry" references {
	collect

	unset one two
	collect
} {2}

test local-1.2 "local curry in proc" {
	proc a {} {
		local set p [curry info exists]