Tcl Source Code

Hex Artifact Content
Login

Artifact 4dcb17b5492330a11581b75979f9177c49b6b39a:

Attachment "demo.tcl" to ticket [1511357fff] added by dgp 2006-06-23 21:43:49.
0000: 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20  package require 
0010: 54 63 6c 20 38 2e 35 0a 73 65 74 20 73 63 72 69  Tcl 8.5.set scri
0020: 70 74 20 5b 6f 70 65 6e 20 66 6f 6f 2e 74 63 6c  pt [open foo.tcl
0030: 20 77 5d 0a 66 63 6f 6e 66 69 67 75 72 65 20 24   w].fconfigure $
0040: 73 63 72 69 70 74 20 2d 65 6e 63 6f 64 69 6e 67  script -encoding
0050: 20 75 74 66 2d 38 0a 70 75 74 73 20 24 73 63 72   utf-8.puts $scr
0060: 69 70 74 20 22 70 72 6f 63 20 74 63 6c 3a 3a 6d  ipt "proc tcl::m
0070: 61 74 68 66 75 6e 63 3a 3a 5c 75 30 33 42 31 20  athfunc::\u03B1 
0080: 7b 7d 20 7b 70 75 74 73 20 53 55 43 43 45 53 53  {} {puts SUCCESS
0090: 3b 20 72 65 74 75 72 6e 20 30 7d 22 0a 70 75 74  ; return 0}".put
00a0: 73 20 24 73 63 72 69 70 74 20 22 65 78 70 72 20  s $script "expr 
00b0: 7b 5c 75 30 33 42 31 28 29 7d 22 0a 63 6c 6f 73  {\u03B1()}".clos
00c0: 65 20 24 73 63 72 69 70 74 0a 73 6f 75 72 63 65  e $script.source
00d0: 20 2d 65 6e 63 6f 64 69 6e 67 20 75 74 66 2d 38   -encoding utf-8
00e0: 20 66 6f 6f 2e 74 63 6c 0a 0a                     foo.tcl..