Project

General

Profile

Actions

Feature #12543

open

explicit tail call syntax: foo() then return

Added by mame (Yusuke Endoh) over 8 years ago. Updated over 3 years ago.

Status:
Assigned
Target version:
-
[ruby-core:76235]

Description

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


Files

then_return.patch (9.18 KB) then_return.patch mame (Yusuke Endoh), 07/02/2016 05:23 PM

Related issues 2 (0 open2 closed)

Related to Ruby master - Feature #6602: Tail call optimization: enable by default?Feedbackko1 (Koichi Sasada)Actions
Has duplicate Ruby master - Feature #16945: Enable TCO by use of special formClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0