Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Saint: A dead sinner revised and edited. -- Ambrose Bierce


devel / comp.lang.mumps / Re: Traps as exceptions

SubjectAuthor
* Traps as exceptionsJens Lideström
+- Re: Traps as exceptionsK.S. Bhaskar
`* Re: Traps as exceptionsed de moel
 `- Re: Traps as exceptionsJens Lideström

1
Traps as exceptions

<963f86a4-f7f5-4a6d-9ba1-f5e20f86188bn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=350&group=comp.lang.mumps#350

  copy link   Newsgroups: comp.lang.mumps
X-Received: by 2002:a37:695:0:b0:69f:b916:2d8e with SMTP id 143-20020a370695000000b0069fb9162d8emr2661288qkg.680.1652426470628;
Fri, 13 May 2022 00:21:10 -0700 (PDT)
X-Received: by 2002:a05:6214:27e4:b0:45a:a04d:d835 with SMTP id
jt4-20020a05621427e400b0045aa04dd835mr3152058qvb.82.1652426470480; Fri, 13
May 2022 00:21:10 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.mumps
Date: Fri, 13 May 2022 00:21:10 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=81.232.46.228; posting-account=e6ZTGwoAAAD0RJ1tKSnsnYuh1JIHXrm6
NNTP-Posting-Host: 81.232.46.228
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <963f86a4-f7f5-4a6d-9ba1-f5e20f86188bn@googlegroups.com>
Subject: Traps as exceptions
From: jens.lidestrom@vgregion.se (Jens Lideström)
Injection-Date: Fri, 13 May 2022 07:21:10 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1666
 by: Jens Lideström - Fri, 13 May 2022 07:21 UTC

Hello, mumpstereers

The trap mechanism in Mumps has similarities with the exception mechanism in many other language.

Most examples I have seem of trap usage is for catching unintentional errors.

Is there also a way intentionally trigger an error, which can be caught by a trap, in a way that is similar to throwing an exception?

I am working with GT.M V7.0.

I’m learning about traps from here: http://tinco.pair.com/bhaskar/gtm/doc/books/pg/UNIX_manual/ch13s06.html

This question is cross-posted on Stack Overflow: https://stackoverflow.com/questions/72215952/traps-as-exceptions

Re: Traps as exceptions

<d4e58dbe-f3be-49b2-adf0-81cb5301e607n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=351&group=comp.lang.mumps#351

  copy link   Newsgroups: comp.lang.mumps
X-Received: by 2002:a05:620a:2988:b0:6a0:53e7:ed48 with SMTP id r8-20020a05620a298800b006a053e7ed48mr3210168qkp.604.1652440970990;
Fri, 13 May 2022 04:22:50 -0700 (PDT)
X-Received: by 2002:a05:6214:1d2a:b0:45a:964d:970b with SMTP id
f10-20020a0562141d2a00b0045a964d970bmr3789804qvd.91.1652440970772; Fri, 13
May 2022 04:22:50 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.mumps
Date: Fri, 13 May 2022 04:22:50 -0700 (PDT)
In-Reply-To: <963f86a4-f7f5-4a6d-9ba1-f5e20f86188bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=108.52.84.50; posting-account=zTPg1AoAAABx_LtAQ3dW6FBnU1dwmSvl
NNTP-Posting-Host: 108.52.84.50
References: <963f86a4-f7f5-4a6d-9ba1-f5e20f86188bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d4e58dbe-f3be-49b2-adf0-81cb5301e607n@googlegroups.com>
Subject: Re: Traps as exceptions
From: ksbhaskar@gmail.com (K.S. Bhaskar)
Injection-Date: Fri, 13 May 2022 11:22:50 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: K.S. Bhaskar - Fri, 13 May 2022 11:22 UTC

On Friday, May 13, 2022 at 3:21:11 AM UTC-4, jens.li...@vgregion.se wrote:
> Hello, mumpstereers
>
> The trap mechanism in Mumps has similarities with the exception mechanism in many other language.
>
> Most examples I have seem of trap usage is for catching unintentional errors.
>
> Is there also a way intentionally trigger an error, which can be caught by a trap, in a way that is similar to throwing an exception?
>
> I am working with GT.M V7.0.
>
> I’m learning about traps from here: http://tinco.pair.com/bhaskar/gtm/doc/books/pg/UNIX_manual/ch13s06.html
>
> This question is cross-posted on Stack Overflow: https://stackoverflow.com/questions/72215952/traps-as-exceptions

Jens, does ZMESSAGE (https://docs.yottadb.com/ProgrammersGuide/commands.html#zmessage) help?

Regards
– Bhaskar

Re: Traps as exceptions

<e8fdb02f-73f0-4aee-b4bd-0162518abf38n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=352&group=comp.lang.mumps#352

  copy link   Newsgroups: comp.lang.mumps
X-Received: by 2002:a05:6214:518c:b0:45a:8430:1737 with SMTP id kl12-20020a056214518c00b0045a84301737mr3929347qvb.4.1652442937261;
Fri, 13 May 2022 04:55:37 -0700 (PDT)
X-Received: by 2002:a05:622a:40c:b0:2f4:aa26:4e9e with SMTP id
n12-20020a05622a040c00b002f4aa264e9emr4003939qtx.302.1652442937091; Fri, 13
May 2022 04:55:37 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.mumps
Date: Fri, 13 May 2022 04:55:36 -0700 (PDT)
In-Reply-To: <963f86a4-f7f5-4a6d-9ba1-f5e20f86188bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=71.174.62.16; posting-account=j7lJmQoAAADTx0Apfk15DZ7D0qlYy4zv
NNTP-Posting-Host: 71.174.62.16
References: <963f86a4-f7f5-4a6d-9ba1-f5e20f86188bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e8fdb02f-73f0-4aee-b4bd-0162518abf38n@googlegroups.com>
Subject: Re: Traps as exceptions
From: eddemoel@gmail.com (ed de moel)
Injection-Date: Fri, 13 May 2022 11:55:37 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1377
 by: ed de moel - Fri, 13 May 2022 11:55 UTC

See also: http://71.174.62.16/Demo/AnnoStd?Frame=Main&Page=a106012&Edition=1995
As an example, you could code:
Set a=1 Set $Ecode=",U123," Set b=2
Setting the value of $ECode triggers an error, and the Set b=2 would never be reached.

Hope this helps,
Ed

Re: Traps as exceptions

<2e362aff-94ff-4309-b286-13e385d76fc2n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=354&group=comp.lang.mumps#354

  copy link   Newsgroups: comp.lang.mumps
X-Received: by 2002:a37:7c8:0:b0:69f:c5f8:85a2 with SMTP id 191-20020a3707c8000000b0069fc5f885a2mr3591101qkh.662.1652446689201;
Fri, 13 May 2022 05:58:09 -0700 (PDT)
X-Received: by 2002:a05:620a:400f:b0:6a0:5a16:69f3 with SMTP id
h15-20020a05620a400f00b006a05a1669f3mr3500870qko.103.1652446689066; Fri, 13
May 2022 05:58:09 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.mumps
Date: Fri, 13 May 2022 05:58:08 -0700 (PDT)
In-Reply-To: <e8fdb02f-73f0-4aee-b4bd-0162518abf38n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=81.232.46.228; posting-account=e6ZTGwoAAAD0RJ1tKSnsnYuh1JIHXrm6
NNTP-Posting-Host: 81.232.46.228
References: <963f86a4-f7f5-4a6d-9ba1-f5e20f86188bn@googlegroups.com> <e8fdb02f-73f0-4aee-b4bd-0162518abf38n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2e362aff-94ff-4309-b286-13e385d76fc2n@googlegroups.com>
Subject: Re: Traps as exceptions
From: jens.lidestrom@vgregion.se (Jens Lideström)
Injection-Date: Fri, 13 May 2022 12:58:09 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1382
 by: Jens Lideström - Fri, 13 May 2022 12:58 UTC

Thanks Ed and Bhaskar!

ZMESSAGE and $Ecode are exactly the mechanisms I was looking for.

I don't understand how I could have missed them in the manual. I will investigate them.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor