[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Exception handling (was Re: ...add to Lua...)
- From: Dirk Laurie <dirk.laurie@...>
- Date: Mon, 17 Sep 2018 10:26:12 +0200
Op Ma., 17 Sep. 2018 om 09:36 het Sean Conner <sean@conman.org> geskryf:
>
> It was thus said that the Great Dirk Laurie once state
> >
> > 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.
>
> I messed that up (I can't read today---it was fine as it was originally).
I'm not quoting your good, clear explanation, but would urge readers
whose mail clients are good enough to reread it.
> Now, on to your questions ...
>
> > 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:
>
> What do you mean by "program?" [8]
...
> What do you mean by "host?"
As used the Lua manual: "Lua ... works embedded in a host client,
called the embedding program or simply the host."
> Because my definition is the same as "system", which you list below.
I was hoping that my footnotes, giving the corresponding Lua
functions, would make that clear.
> > [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()
But let's try again.
Level 0 Operating system (whether shell or GUI)
Level 1 Invokes a command or starts an application called "lua",
"python", "perl", "ruby", "js", "apl", "love", "luatex" etc.
Level 2 which invokes code written in a 'scripting" language
Level 3 which calls a function
Level 4 which calls a function
...
Level n which encounters a condition that makes it impossible to go
on as normal.
Now from level n, Lua code can say: return to level 0 (bypassing all
finalizers not regestered at that level) or return to level 1
(allowing various sorts of recovery) or drop down to level n-1
(passing the buck). In addidition, Level n-1 may disallow a direct
return to Level 1.
The questions to agree or disagree on are:
(a) All languages that involve at least Levels 0,1,2 should offer all
those options.
(b) Very few except Lua actually offer that.
> [9] I wrote about it a bit here:
>
> http://boston.conman.org/2009/12/01.2
>
> (near the bottom)---I classified four categories for errors, along
> with three ways of handling them, but I've thought hard about that
> since then and modified my position somewhat (two two ways of
> handling errors).
I think I understand both that post and your explanation of the 2x2
position, but it will require a chain of deductions to move from there
to answers to my questions, and I don't wish to second-guess you :-)
-- Dirk