[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Goto and return ('end' expected)
- From: Rena <hyperhacker@...>
- Date: Wed, 6 May 2015 13:10:43 -0400
On Wed, May 6, 2015 at 12:51 PM, Parke <email@example.com> wrote:
> On Wed, May 6, 2015 at 9:22 AM, Hisham <firstname.lastname@example.org> wrote:
>> The point is not how to workaround this. Aapo's question still stands.
> In other languages where return is a statement, when debugging I often
> insert returns mid-function to disable functionality. I assume the
> Lua requires return at the end of blocks to avoid confusion:
> function foo ()
> a ()
> b ()
> c () -- foo will return c()
> d ()
I use "do return end" for that. There's no confusion like in foo() and
it's clear what your intent is. Just having a naked "return" partway
through a block is not only possibly ambiguous, but often a sign that
something's been misplaced.
Sent from my Game Boy.