I copy and pasted what you posted, and still get the error:<br>invalid command name &quot;s1&quot;<br><br><div class="gmail_quote">On Thu, May 8, 2008 at 10:59 AM, Gustaf Neumann &lt;<a href="mailto:neumann@wu-wien.ac.at">neumann@wu-wien.ac.at</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Matthew Smith schrieb:<div class="Ih2E3d"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
 &nbsp; &nbsp;Putting in:<br>
 &nbsp; &nbsp; s1 push a<br>
 &nbsp; &nbsp;results in an error, however I can do:<br>
<br>
what is the error? this indicates that you have not defined the method push correctly<br>
<br>
I get:<br>
&nbsp;invalid command name &quot;s1&quot;<br>
</blockquote></div>
this indicates, that you have not created an object s1. Your program<br>
should look like the following.....<div class="Ih2E3d"><br>
<br>
hope this helps<br>
-gustaf neumann<br>
<br></div>
===========================================<div class="Ih2E3d"><br>
package require XOTcl; namespace import ::xotcl::*<br>
<br></div><div class="Ih2E3d">
Class Stack<br>
Stack instproc init {} {<br>
 &nbsp; my instvar things<br></div><div class="Ih2E3d">
 &nbsp; set things &quot;&quot;<br>
}<br>
Stack instproc push {thing} {<br>
 &nbsp; my instvar things<br>
 &nbsp; set things [concat [list $thing] $things]<br>
 &nbsp; return $thing<br>
}<br>
Stack instproc pop {} {<br>
 &nbsp; my instvar things<br>
 &nbsp; set top [lindex $things 0]<br>
 &nbsp; set things [lrange $things 1 end]<br>
 &nbsp; return $top<br>
}<br>
<br>
set s1 [Stack new]<br>
<br></div>
s1 push a<br>
s1 push b<br>
<br>
set x [s1 pop]<br>
puts &quot;The popped value is $x&quot;<br>
===========================================<br>
<br>
</blockquote></div><br>