Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by ZiiS

2 months ago

At least in Lua then the rule is simply 'last thing a function dose' this is unambiguous. `return f()` is always a tail call and `return f() + 1` never is.

3 comments

ZiiS

Reply

normie3000  2 months ago

What about:

return 1 + f()

?

  • ZiiS  2 months ago

    No, the last thing is the +; which can't run till it knows both values. (Reverse Polish notation is clearer, but humans prefer infix operators for some reason)

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities