Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 656c768fdba803a812511e8dfdcff3f61989a4a8
Ticket: 3553586fffffffffffffffffffffffffffffffff
Wrong argument to return command doesnt return error
User & Date: jmcuaz on 2012-08-02 11:47:35
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    In a proc we did the following mistake: 
    
    return expr {[dict exists $dict $key] ? [dict get $dict $key] : 0}
     wich ought to be :
    return [expr {[dict exists $dict $key] ? [dict get $dict $key] : 0}]
    
    The surprise is that the execution of the faulty code returns an empty string and not an error.
    It might be that the 2nd word "epr" has been intrepreted as an option argument for the third form of return syntax (i.e. return ?option value ...? ?result?), but shoudn't any option begin with a dash ?
    
    On an other (but related) subject, the doc is not very clear about the differences betwen the 2nd (i.e. return ?-code code? ?result?) an third form (return ?option value ...? ?result?) of the syntax of return command : are each form exclusive from the other or can they be mixed together as shown in the examples witten in TIP 90 ?
    
    Many thanks
    
    Jean-Marie
    
    
    
  4. foundin changed to: "obsolete: 8.5.10"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "jmcuaz"
  10. subsystem changed to: "18. Commands M-Z"
  11. title changed to:
    Wrong argument to return command doesnt return error
    
  12. type changed to: "Bug"