Issue #12543 has been updated by Yusuke Endoh.

Subject changed from explicit tal call syntax: foo() then return to explicit tail call syntax: foo() then return

----------------------------------------
Feature #12543: explicit tail call syntax: foo() then return
https://bugs.ruby-lang.org/issues/12543#change-59469

* Author: Yusuke Endoh
* Status: Open
* Priority: Normal
* Assignee: Yukihiro Matsumoto
----------------------------------------
How about introducing a new syntax for tail call?

```
def foo()
  foo()
end
foo() #=> stack level too deep
```

```
def bar()
  bar() then return
end
bar() #=> infinite loop
```

* no new keyword (cf. `goto foo()`)
* no conflict with any existing syntax
* an experimental patch is available (attached)
* no shift/reduce nor reduce/reduce conflict in parse.y

-- 
Yusuke Endoh <mame / ruby-lang.org>

---Files--------------------------------
then_return.patch (9.18 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>