A tiny bit of code by RS puzzles me
From: Helmut Giese (hgiese_at_ratiosoft.com)
Date: 11/27/04
- Previous message: Donald Arseneau: "Re: binding to ComboBox changes"
- Next in thread: Bruce Hartweg: "Re: A tiny bit of code by RS puzzles me"
- Reply: Bruce Hartweg: "Re: A tiny bit of code by RS puzzles me"
- Reply: Andreas Leitgeb: "Re: A tiny bit of code by RS puzzles me"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 27 Nov 2004 02:15:10 GMT
Hello out there,
passing some time, reading Dr. Dobb's Tcl-URL from Nov. 23 and
following some links I hit on http://mini.net/tcl/4613. There you find
some code snippet to implement type checking:
---
proc integer args {
foreach arg $args {
uplevel 1 "trace var $arg w {incr $arg 0 ;#}"
}
}
integer i
set i x
# - > can't set "i": expected integer but got "x"
---
The principle is clear, but I started wondering about the curious
';#}' construct. The first thing to do is of course to remove ';#' but
it's there for a purpose: Omitting it produces the error message
can't set "i": wrong # args: should be "incr varName ?increment?"
I stared for a while, but it's late now and I give up. Could someone
please explain what this ';#}' construct does? What does [incr] see,
if it's not there?
Any insight will be greatly appreciated.
Best regards and good night
Helmut Giese
- Previous message: Donald Arseneau: "Re: binding to ComboBox changes"
- Next in thread: Bruce Hartweg: "Re: A tiny bit of code by RS puzzles me"
- Reply: Bruce Hartweg: "Re: A tiny bit of code by RS puzzles me"
- Reply: Andreas Leitgeb: "Re: A tiny bit of code by RS puzzles me"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|