Skip to content
Tcl Source Code History Of Ticket ba6ab5eb7be96501
Login

History Of Ticket ba6ab5eb7be96501

Artifacts Associated With Ticket ba6ab5eb7be96501

  1. Ticket change [f986157749] (rid 184342) by aspect on 2020-07-05 13:41:16:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      Setup:
      
      % info patch
      8.6.10
      % proc gen {} {yield; return -code break}
      
      As expected:
      
      % apply {{} {coroutine t1 gen}}
      % while 1 t1
      
      Bug:
      
      % coroutine t2 gen
      % while 1 t2
      invoked "break" outside of a loop
          while executing
      "gen"
          invoked from within
      "t2"
          ("while" body line 1)
          invoked from within
      "while 1 t2"
      
      
      As a workaround, using [tailcall break] in place of [return -code break] works.
      
    5. foundin initialized to: "8.6.10"
    6. is_private initialized to: "0"
    7. login: "aspect"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Minor"
    11. status initialized to: "Open"
    12. submitter initialized to: "aspect"
    13. subsystem initialized to: "60. NRE and coroutines"
    14. title initialized to:
      [return -code] behaviour depends on how coroutine was started
      
    15. type initialized to: "Bug"
  2. Ticket change [20dd04dfc0] (rid 184343) by aspect on 2020-07-05 14:26:14:

    1. icomment:
      The plot thickens:
      
      Works as a script:
      
      $ tclsh <(echo 'proc t {} {yield 1 ; tailcall break} ; coroutine t1 t ; while 1 {puts [t1]}')
      
      
      Fails interactively:
      
      $ tclsh < <(echo 'proc t {} {yield 1 ; tailcall break} ; coroutine t1 t ; while 1 {puts [t1]}')
      invoked "break" outside of a loop
      
    2. login: "aspect"
    3. mimetype: "text/plain"