From: Kautuk Consul <kconsul@linux.ibm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: aik@ozlabs.ru, Thomas Huth <thuth@redhat.com>,
slof@lists.ozlabs.org, kvm-ppc@vger.kernel.org
Subject: Re: [SLOF] [PATCH v3] slof/fs/packages/disk-label.fs: improve checking for DOS boot partitions
Date: Thu, 28 Mar 2024 16:32:20 +0530 [thread overview]
Message-ID: <ZgVOPOSekcbrBGCh@li-a450e7cc-27df-11b2-a85c-b5a9ac31e8ef.ibm.com> (raw)
In-Reply-To: <20240328104725.GJ19790@gate.crashing.org>
Hi,
On 2024-03-28 05:47:25, Segher Boessenkool wrote:
> On Thu, Mar 28, 2024 at 10:09:20AM +0530, Kautuk Consul wrote:
> > On 2024-03-27 08:43:25, Segher Boessenkool wrote:
> > > If an exception happens you can (should!) throw an exception. Which
> > > you can then catch at a pretty high level.
> > Ah, correct. Thanks for the suggestion! I think I will now try to throw
> > an exception from read-sector if all the code-paths imply that a "catch"
> > is in progress.
>
> Don't try to detect something is trying to catch things. Just throw!
> Always *something* will catch things (the outer interpreter, if nothing
> else), anyway. In SLOF this is very explicit:
>
> : quit
> BEGIN
> 0 rdepth! \ clear nesting stack
> [ \ switch to interpretation state
> terminal \ all input and output not redirected
> BEGIN
> depth . [char] > emit space \ output prompt
> refill WHILE
> space
> ['] interpret catch \ that is all the default throw/catch
> \ there is! no special casing needed
> dup print-status \ "ok" or "aborted" or abort" string
> REPEAT
> AGAIN ;
>
> The whole programming model is that you can blindly throw a fatal error
> whenever one happens. You cannot deal with it anyway, it is fatal!
> That is 98% or so of the exceptions you'll ever see. Very sometimes it
> is used for non-local control flow. That has its place, but please
> don't overuse that :-)
Okay, in the v4 I just sent I added a catch statement in the open method
of disk-label.fs to make sure that there is a catch for this throw. Can
you please check that and tell me if I need to remove that CATCH
statement ? My idea was that maybe I needed to add an appropriate CATCH
statement for this in open.
>
>
> Segher
prev parent reply other threads:[~2024-03-28 11:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-27 5:41 [PATCH v3] slof/fs/packages/disk-label.fs: improve checking for DOS boot partitions Kautuk Consul
2024-03-27 7:45 ` Thomas Huth
2024-03-27 7:49 ` Kautuk Consul
2024-03-27 13:43 ` [SLOF] " Segher Boessenkool
2024-03-28 4:39 ` Kautuk Consul
2024-03-28 10:47 ` Segher Boessenkool
2024-03-28 11:02 ` Kautuk Consul [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZgVOPOSekcbrBGCh@li-a450e7cc-27df-11b2-a85c-b5a9ac31e8ef.ibm.com \
--to=kconsul@linux.ibm.com \
--cc=aik@ozlabs.ru \
--cc=kvm-ppc@vger.kernel.org \
--cc=segher@kernel.crashing.org \
--cc=slof@lists.ozlabs.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).