Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2016-06-27
13:46 • Closed ticket [c3d956be5b]: proc doesn't work as documented plus 5 oth... artifact: 4da6462d10 user: dkf
13:46
[c3d956be5b] Clearer text about positioning of optional arguments. check-in: 48ebae8786 user: dkf tags: core-8-6-branch
13:44
[c3d956be5b] Clearer text about positioning of optional arguments. check-in: 06af0634c4 user: dkf tags: trunk
2016-06-21
23:32 • New ticket [c3d956be5b] proc doesn't work as documented. artifact: c95ffb8544 user: pointsman

[proc] doesn't work as documented

Closed / Acceptedc3d956be5bb16eb7ad8e9980d74509cba4e8e1ebCreated 10 years agoUpdated 10 years ago
Descriptionplain2016-06-21 23:32:11
proc foo { {arg1 default} arg2} {
  puts $arg1
}
foo

=> wrong # args: should be "foo ?arg1? arg2"

It would be more to the point, if the error message reads "should be
"foo arg1 arg2"". But more than that: man n proc tells at the end of
the first paragraph of the description:

   Arguments with default values that are followed by non-defaulted
   arguments become required arguments. In 8.6 this will be considered
   an error.

Seems, they are not. Since I'm fine with the situation, as they was up
to 8.6 (arguments with default values that are followed by
non-defaulted arguments become required arguments) simplest solution
would be to adjust the documentation (remove "In 8.6 this will be
considered an error") until the implementation is already there.
Referenced by2
dkf Closed ticket [c3d956be5b]. [History diff]2016-06-27 13:46:54
Log in (anonymous is fine) to add a comment.