<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<pre class="code">The following examples in tutorial cause errors <tt>
Object</tt> o
o <tt>proc</tt> y {-a {-b {1 2 3}} x y} {
puts "$a $b $x $y"
}
<tt>Class</tt> P
P <tt>instproc</tt> y {-a:required {-b:boolean true}} {
puts "$a $b"
}
Thanks to Ben Thomasson for correcting this for me
the code should be
ALSO notice that one example is incorrect for -b passing a string 4 5 needs to be bound {4 5}
(tcl) 165 % o proc y {-a {-b {1 2 3}}<font color="#ff0000">} {</font> x y <font
color="#ff0000">}</font> {
puts "$a $b $x $y"
}
(tcl) 166 % <font color="#ff0000">o y -b 4 5 -a 1 3 4</font>
<font color="#ff0000">wrong # args: should be { x y }</font>
(tcl) 167 % o y -b {4 5} -a 1 3 4
1 4 5 3 4
(tcl) 168 % o y -a 1 3 4
1 1 2 3 3 4
(tcl) 169 % o y -a 1 -- -b -c
1 1 2 3 -b -c
(tcl) 170 %
(tcl) 174 % P instproc y {-a:required {-b:boolean true}} <font
color="#ff0000">{}</font> {
puts "$a $b"
}
(tcl) 175 % P p
::xotcl::p
(tcl) 176 % p y -a 1 -b 0
1 0
</pre>
</body>
</html>