Tcl ãã«ãã¤ã³ã® trace ã³ãã³ãã§å¤æ°ãã¢ã¯ã»ã¹ãããã¨ãã«å¼ã³åºãããããã·ã¼ã¸ã£ãç»é²ã§ãããä»åæ¯è¼ããè¨èªã®ä¸ã§ãã£ã¨ãçã£å½ãã¤å å®ãã¦ãããããã·ã¼ã¸ã£åãä¸ããä»æ§ãªã®ã§ããã·ã¼ã¸ã£ãäºãä½ãå¿ è¦ããããããã¯ãããå¤æ°ã1ã¤ããç¡ãå ´åãªã©ã¯å¾è¿°ã® Ruby ã¨æ¯ã¹ãã¨ããé¢åã proc hook {name1 name2 op} { if {$op == "write"} { upvar #0 $name1 var puts "$op $name1: $var" } else { puts "$op $name1" } } trace add variable foo {read write} hook set foo "hello world" set bar $foo å®è¡çµæã¯ä»¥ä¸ã F:\>tclsh tryme.tcl write foo: hell
{{#tags}}- {{label}}
{{/tags}}