Skip to content
Tcl Source Code View Ticket
Login

View Ticket

[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.