<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Kurt,<br>
<br>
uff, this was mean: i did take me a while that the dashes from your
examples are not minus<br>
signs, but different chars (hex e2 80 93; compare "–" with "-"). <br>
<br>
however, the bug occurs as well with the minus sign, so i expect these
dashes were<br>
introduced by your mail client.<br>
<br>
below is a patch for xotcl-1.3.9, that will be included in the
forthcoming xotcl 1.4.0<br>
<br>
-gustaf<br>
<br>
=========================================================<br>
--- generic/xotcl.c-orig 2005-12-09 10:43:19.000000000 +0100<br>
+++ generic/xotcl.c 2006-02-17 18:44:20.000000000 +0100<br>
@@ -10437,7 +10437,12 @@<br>
ordinaryArgsCounter++;<br>
}<br>
}<br>
- if (!argsDefined) {<br>
+ if (argsDefined) {<br>
+ if (ordinaryArgsCounter == 0) {<br>
+ Tcl_SetVar2(in, "args", 0, "", 0);<br>
+ }<br>
+ } else {<br>
+ /* !argsDefined */<br>
if (ordinaryArgsCounter != ordinaryArgsDefc) {<br>
/* we do not have enough arguments, maybe there are default
arguments<br>
for the missing args */<br>
<br>
=========================================================<br>
<br>
Kurt Stoll schrieb:
<blockquote
cite="midBFDC5D4D8B9FB544936B508A6B8F48AA6774EB@monk.echelon.echcorp.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="PersonName" downloadurl="http://www.microsoft.com">
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style></o:SmartTagType>
<div class="Section1">
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">I am having difficulty
getting non-positional arguments to
behave correctly with args. The simple example below shows what I have
found. This does not appear to be appropriate behavior. Am I doing
something wrong?<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";">Object obj<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";">obj proc pr1 {
{-npos default} args } {<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";"> puts "npos:
$npos"<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";"> puts "args:
$args"<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";">}<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";">> ## This
works:<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";">> obj pr1 a<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";">npos: default<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";">args: a<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";">><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";">> ## As does
this:<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";">> obj pr1
–npos 3 a<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";">npos: 3<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";">args: a<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";">><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";">> ## But this
does not:<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";">> obj pr1
–npos 3<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";">npos: 3<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";">args: -npos 3<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";">><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";">> ## I
expected args to be {}, but instead it
contains the non-positional parameter<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">Thanks for any insight
you can provide.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">-<st1:PersonName w:st="on">Kurt
Stoll</st1:PersonName><o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
</div>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Xotcl mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Xotcl@alice.wu-wien.ac.at">Xotcl@alice.wu-wien.ac.at</a>
<a class="moz-txt-link-freetext" href="http://alice.wu-wien.ac.at/mailman/listinfo/xotcl">http://alice.wu-wien.ac.at/mailman/listinfo/xotcl</a>
</pre>
</blockquote>
<br>
</body>
</html>