Posted to tcl by GPS at Mon Nov 12 07:47:12 GMT 2007view raw
- coop::compile [lindex $argv 0] {
- structure s
- external function puts
- external function printf
-
- define s -message {char *:msg} {
- declare int x y
- printf [' "%d\n"] [puts msg]
- printf [' "Hello World"]
- }
- property s int x y
-
- define s +x {int:value} {
- printf [' "+x %d\n"] [+ [self x] value]
- self x value
- }
-
- function main {int:argc ; char *[]:argv} {
- declare-object o s
- set o [object s]
-
- o -message [' "hiya"]
- o +x 123
- o +x 456
-
- printf [' "%d\n"] argc
- printf [' "size of argv: %d\n"] [sizeof argv]
-
- puts [' "hello world"]
- return 0
- } int
- }
-