Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2ca2651010eafb94f6850df34122d7a6a787e7b9
Ticket: 1665441fffffffffffffffffffffffffffffffff
Generate an error on default arg followed by non-default arg
User & Date: lars_h on 2007-02-27 19:33:40
Changes

  1. icomment:
    Logged In: YES 
    user_id=938835
    Originator: NO
    
    Has the issue of how this is documented been considered?
    
    The [proc] manpage (8.5 currently on www.tcl.tk) says:
    Arguments with default values need not be specified in a procedure invocation. However, there must be enough actual arguments for all the formal arguments that don't have defaults, and there must not be any extra actual arguments.
    
    It does /not/ say arguments with defaults may only be given at the end. Even the error messages seem to agree with this, although an error is thrown:
    
    % info patchlevel
    8.5a3
    % proc prov {{opt 23} man} {list $opt $man}
    % prov 1
    wrong # args: should be "prov ?opt? man"
    % prov 1 2
    1 2
    
    
    
  2. login: "lars_h"
  3. mimetype: "text/plain"
  4. username: "lars_h"