Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: ca65eefcd63b3d845426c8c4dc26ce692f19112e
Ticket: 3483088fffffffffffffffffffffffffffffffff
[tailcall next] doesn't work ... should it?
User & Date: dkf on 2012-02-10 21:15:25
Changes

  1. closedate changed to: "2012-02-10T14:15:25"
  2. closer changed to: "dkf"
  3. foundin changed to: "obsolete: 8.6b2"
  4. icomment:
    
    
    allow_comments - 1
    
    [tailcall foo] is like [return [uplevel foo]] apart from some quoting issues and the context in which [foo] is resolved. (But there's only one [next], so the resolution will be consistent.) Thus, [tailcall next] only works at all when the _caller_ of the object can do a [next], which means that it needs to be done inside a method called from inside a method. I'm guessing that that's something you don't need. :-) It's complaining about the wrong # args because that's what the caller's next method implementation wants (I guess).
    
    So... it works, but not in the way you would reasonably want. (Remember, [next] effectively does an [uplevel] inside itself so methods don't need to know about potential subclasses overriding them. It also _requires_ that the caller be an object method body context, since it uses that to know what is going on.) To do anything else would require teaching [tailcall] to know specially about [next] and vice versa, which would be rather disgustingly nasty.
    
    
  5. login: "dkf"
  6. mimetype: "text/plain"
  7. resolution changed to: "Works For Me"
  8. status changed to: "Closed"
  9. username: "dkf"