lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Op Ma., 17 Sep. 2018 om 00:08 het Sean Conner <sean@conman.org> geskryf:
>
> It was thus said that the Great Sean Conner once stated:
> >
> > [2]   Personally, I don't think exceptions should exist as a concept in
>                                                    ^NOT
>
> >       user code at all.  If a program reeives a seg fault (a perfect
> >       example of an exception) then the program is borked---is is trying
> >       to reference memory that is not mapped into its memory space and
> >       trying to recover might not be the best approach (or even possible,
> >       depending upon where it happened).
>
>   Oops.

That single ^NOT, appearing in a non-monospaced font, correcting a
sentence starting "Personally" (which usually means that, in the
opinion of the author, a non-PC point of view will follow) makes it
totally impossible to figure out what you are trying to convey.

Do you basically agree that

(a) languages usually run from an interpreter or a host program (as
Lua is) should offer (as Lua does) three abnormal exits from a
program:
(i) to the previous level of execution [1]
(ii) to the host [2]
(iii) to the system [3]

(b) that the previous level should be allowed to intercept an exit to
the host [4]

c) that this degree of flexibilty is in fact quite rare in other
languages, even (if not especially) those with "try..except"
mechaniisms?

-- Dirk

[1] In Lua, by way of type and number of return values, especially
"false, message"'
[2] In Lua, by way of error())
[3] In Lua, by way of os.exit()
[4] In Lua, by way of pcall()