cmdr
Check-in [7ab77ead21]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.

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

Overview
Comment:cmdr::actor - New feature "common -extend", enabling extension of a block instead of overwriting it.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7ab77ead21640a4cbd9456355fcb98608bf073ae
User & Date: aku 2014-05-16 00:29:39
Original Comment: cmdr::actor - New feature "common -extend", enabling extension of a block instead of ovrwriting it.
References
2014-05-28
23:33
cmdr::actor, cmdr::officer - Fix bug introduced with revision [7ab77ead21]. The option handling added to "actor::set" in that revision means that the command "my set *command* ..." storing the actual command line (i.e. user information) can break, trying to interpret application specific option information as something for the internal command. Fixed by adding "--" to "actor::set"s option handling, and using it for the breakable command to force interpretation of the user data as such. check-in: cd7539eb28 user: andreask tags: trunk
Context
2014-05-16
00:44
Fix inadvertent split of trunk check-in: 8ff369076f user: andreask tags: trunk
00:29
cmdr::actor - New feature "common -extend", enabling extension of a block instead of overwriting it. check-in: 7ab77ead21 user: aku tags: trunk
2014-04-23
05:39
Move the p-name helper command of validate::common into the parameter class, as a convenience method. check-in: 288c34780b user: aku tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to actor.tcl.

163
164
165
166
167
168
169
170
171



















172
173
174
175
176
177
178
...
341
342
343
344
345
346
347
348
	    return [$mysuper get $key]
	}
	# ... and fail if we are at the top.
	return -code error -errorcode {CMDR STORE UNKNOWN} \
	    "Expected known key for get, got \"$key\""
    }

    method set {key data} {
	debug.cmdr/actor {}



















	dict set mystore $key $data
	return
    }

    method lappend {key data} {
	debug.cmdr/actor {}
	catch { set value [my get $key] }
................................................................................

    ##
    # # ## ### ##### ######## #############
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::actor 1.2






|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
...
360
361
362
363
364
365
366
367
	    return [$mysuper get $key]
	}
	# ... and fail if we are at the top.
	return -code error -errorcode {CMDR STORE UNKNOWN} \
	    "Expected known key for get, got \"$key\""
    }

    method set {key args} {
	debug.cmdr/actor {}
	set extend 0
	while {[string match -* [lindex $args 0]]} {
	    set args [lassign $args o]
	    switch -exact -- $o {
		-extend {set extend 1}
		default {
		    return -code error -errorcode {CMDR SET UNKNOWN OPTION} \
			"Unknown option \"$o\", expcted -extend"
		}
	    }
	}
	if {[llength $args] != 1} {
	    return -code error -errorcode {CMDR SET WRONG-ARGS} \
		"Expected one argument."
	}
	set data [lindex $args 0]
	if {$extend} {
	    set data [my get $key]$data
	}
	dict set mystore $key $data
	return
    }

    method lappend {key data} {
	debug.cmdr/actor {}
	catch { set value [my get $key] }
................................................................................

    ##
    # # ## ### ##### ######## #############
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::actor 1.3