Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #50100
| Newsgroups | comp.lang.forth |
|---|---|
| Date | 2016-08-14 14:05 -0700 |
| References | <noqejl$k6$1@dont-email.me> |
| Message-ID | <cefcd277-b7bf-4e2e-a22e-69e29a64e548@googlegroups.com> (permalink) |
| Subject | Re: A use for quotations |
| From | hughaguilar96@gmail.com |
On Sunday, August 14, 2016 at 11:51:36 AM UTC-7, Gerry wrote: > The use of CATCH and THROW handles backtracking in the event of failure. > I had some qualms about (mis)using exceptions for this purpose but it is > so convenient that I did it anyway despite reduced efficiency. This is the only use that I have ever made of CATCH and THROW. In my LC53 encryption-cracking program I did a recursive-descent traversal through all the possible keys. When I found a key that worked, I did a THROW to escape. At this time, I was likely several levels deep in recursion, so with THROW I was able to clear out the return-stack and get back to the top --- this was much more efficient than unwinding all the recursion a step at a time, testing the same flag at every step. If I were to write a regexp package, I would use this same technique. I may yet write one, although I don't really like regexp much so this isn't a high priority for me.
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
A use for quotations Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2016-08-14 19:51 +0100
Re: A use for quotations Bernd Paysan <bernd.paysan@gmx.de> - 2016-08-14 19:44 +0000
Re: A use for quotations Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2016-08-14 22:57 +0100
Re: A use for quotations hughaguilar96@gmail.com - 2016-08-14 14:05 -0700
Re: A use for quotations Cecil Bayona <cbayona@cbayona.com> - 2016-08-14 16:16 -0500
Re: A use for quotations "HAA" <someone@microsoft.com> - 2016-08-17 11:29 +1000
Re: A use for quotations Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2016-08-17 10:06 +0100
Re: A use for quotations "HAA" <someone@microsoft.com> - 2016-08-18 12:18 +1000
Re: A use for quotations Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2016-08-19 16:07 +0100
Re: A use for quotations "Elizabeth D. Rather" <erather@forth.com> - 2016-08-19 09:35 -1000
Re: A use for quotations Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2016-08-19 23:03 +0100
Re: A use for quotations "HAA" <someone@microsoft.com> - 2016-08-20 13:19 +1000
Re: A use for quotations Coos Haak <htrofhc@gmail.com> - 2016-08-20 14:55 +0200
Re: A use for quotations anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-08-20 15:38 +0000
Re: A use for quotations "HAA" <someone@microsoft.com> - 2016-08-22 14:58 +1000
Re: A use for quotations Julian Fondren <julian.fondren@gmail.com> - 2016-08-22 04:18 -0700
Re: A use for quotations Coos Haak <htrofhc@gmail.com> - 2016-08-22 15:13 +0200
Re: A use for quotations "HAA" <someone@microsoft.com> - 2016-08-24 22:20 +1000
Re: A use for quotations hughaguilar96@gmail.com - 2016-08-24 09:44 -0700
Re: A use for quotations Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2016-08-25 10:09 +0100
Re: A use for quotations "HAA" <someone@microsoft.com> - 2016-08-27 12:24 +1000
Re: A use for quotations humptydumpty <ouatubi@gmail.com> - 2016-08-17 00:55 -0700
Re: A use for quotations hughaguilar96@gmail.com - 2016-08-17 02:19 -0700
Re: A use for quotations humptydumpty <ouatubi@gmail.com> - 2016-08-17 07:49 -0700
Re: A use for quotations humptydumpty <ouatubi@gmail.com> - 2016-08-17 08:18 -0700
Re: A use for quotations Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2016-08-17 10:30 +0100
Re: A use for quotations Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2016-08-17 10:34 +0100
Re: A use for quotations humptydumpty <ouatubi@gmail.com> - 2016-08-17 07:43 -0700
Re: A use for quotations anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-08-18 07:35 +0000
csiph-web