Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #54852

Re: Dynamic programming in Forth

From Alex <alex@rivadpm.com>
Newsgroups comp.lang.forth
Subject Re: Dynamic programming in Forth
Date 2017-02-14 16:34 +0000
Organization A noiseless patient Spider
Message-ID <o7vbfg$utv$1@dont-email.me> (permalink)
References <3cc99bb7-98df-41b6-a313-2e64e8a83e5c@googlegroups.com> <e5ff5dcb-6ac9-46db-9975-ee3bd71926bb@googlegroups.com> <o7v00u$lo7$1@dont-email.me> <97f17def-4eb6-477a-bc87-e5274a2f5deb@googlegroups.com> <1fa6bb93-34af-48a8-bc6a-d556db1fc53f@googlegroups.com>

Show all headers | View raw


On 2/14/2017 15:44, minforth@arcor.de wrote:
> the additional charm that one can take advantage of Forth's
> stack-cleaning CATCH/THROW mechanism

Which is exacty how I feel about CATCH and THROW. They are, to me, not a 
means of indicating errors or exceptions, but a means of providing a 
type of checkpoint with backtracking.

There are limitations; there's no guarantee that your newly 
depth-restored stack will have usable contents for example, or that some 
other global-ish variable or event hasn't hosed your environment. And 
restoring the input source is a hard trick, given that a THROW might 
happen a very long way indeed from the original CATCH.

But given these known limitations, they're still a very useful pair of 
words.

-- 
Alex

Back to comp.lang.forth | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: Dynamic programming in Forth lehs <skydda.barnen@gmail.com> - 2017-02-14 03:53 -0800
  Re: Dynamic programming in Forth "David N. Williams" <williams@umich.edu> - 2017-02-14 08:19 -0500
    Re: Dynamic programming in Forth lehs <skydda.barnen@gmail.com> - 2017-02-14 06:03 -0800
      Re: Dynamic programming in Forth minforth@arcor.de - 2017-02-14 07:44 -0800
        Re: Dynamic programming in Forth Alex <alex@rivadpm.com> - 2017-02-14 16:34 +0000

csiph-web