Tcl Library Source Code

Check-in [3f2d995fa7]
Login

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

Overview
Comment:Updated to only append one name if array is not being used
Timelines: family | ancestors | descendants | both | add-lazyset
Files: files | file ages | folders
SHA3-256:3f2d995fa7b0df95faaeb19d399242868a06f9a46477a778613fe69789679566
User & Date: rkeene 2018-12-31 04:49:33
Context
2019-02-21
23:39
Import trunk fixes Tweak manpage a bit for easier version update. Tweak package index to check core version. Closed-Leaf check-in: ca21301c2a user: aku tags: add-lazyset
2018-12-31
04:49
Updated to only append one name if array is not being used check-in: 3f2d995fa7 user: rkeene tags: add-lazyset
04:48
Added documentation for lazyset check-in: 63c4b82f14 user: rkeene tags: add-lazyset
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to modules/lazyset/lazyset.tcl.

48
49
50
51
52
53
54



55





56
57
58
59
60
61
62
			set varname $name1
		}
	}

	if {$appendArgs} {
		append finalCode {
			set args [lrange $args 1 end]



			append code " " [list $name1 $name2 {*}$args]





		}
	}

	append finalCode {
		set result [uplevel 1 $code]

		uplevel 1 [list unset -nocomplain $varname]







>
>
>
|
>
>
>
>
>







48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
			set varname $name1
		}
	}

	if {$appendArgs} {
		append finalCode {
			set args [lrange $args 1 end]
		}
		if {$isArray} {
			append finalCode {
				append code " " [list $name1 $name2 {*}$args]
			}
		} else {
			append finalCode {
				append code " " [list $name1 {*}$args]
			}
		}
	}

	append finalCode {
		set result [uplevel 1 $code]

		uplevel 1 [list unset -nocomplain $varname]

Changes to modules/lazyset/lazyset.test.

1
2
3
4
5
6
7
8
..
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# lazyset.test - Copyright (c) 2019 Roy Keene
#
# -------------------------------------------------------------------------

source [file join \
	[file dirname [file dirname [file join [pwd] [info script]]]] \
	devtools testutilities.tcl]

................................................................................
	}
	set test
} -cleanup {
	unset test
} -result {ok}

test lazyset-withargs-1.0 {} -body {
	::lazyset::variable test [list apply {{name1 name2} {
		return ok
	}}]
	set test
} -cleanup {
	unset test
} -result {ok}

test lazyset-withargs-2.0 {} -body {
	::lazyset::variable test [list apply {{result name1 name2} {
		return $result
	}} ok]
	set test
} -cleanup {
	unset test
} -result {ok}

|







 







|








|







1
2
3
4
5
6
7
8
..
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# lazyset.test - Copyright (c) 2018 Roy Keene
#
# -------------------------------------------------------------------------

source [file join \
	[file dirname [file dirname [file join [pwd] [info script]]]] \
	devtools testutilities.tcl]

................................................................................
	}
	set test
} -cleanup {
	unset test
} -result {ok}

test lazyset-withargs-1.0 {} -body {
	::lazyset::variable test [list apply {{name} {
		return ok
	}}]
	set test
} -cleanup {
	unset test
} -result {ok}

test lazyset-withargs-2.0 {} -body {
	::lazyset::variable test [list apply {{result name} {
		return $result
	}} ok]
	set test
} -cleanup {
	unset test
} -result {ok}